Article

Table of Contents
Theme:
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $300 by adding new articles!

Install osTicket with a LAMP Stack on Fedora 34

Author: Francis Ndungu

Last Updated: Tue, Jun 15, 2021
Fedora Server Apps

Introduction

osTicket is a web-based open-source ticketing system for streamlining your customers' experience. It's written in PHP and MySQL/MariaDB. On top of its easy-to-follow installation process, osTicket comes with rich dashboard reports, configurable help topics, service level agreements, ticket filters, and built-in API. osTicket is free, and more than 5 million users rely on the software to seamlessly route customers' queries created via web forms, emails, or API. In this guide, you'll create a robust customer support portal with osTicket on a LAMP stack running on Fedora 34.

Prerequisites

Before you proceed, make sure you have the following.

1. Install the Dependencies

Make sure your system is up to date.

$ sudo dnf -y upgrade

Install the following helper packages.

$ sudo dnf install -y socat git wget unzip nano

Install the required PHP extensions.

$ sudo dnf install -y php-{cli,fpm,common,mbstring,curl,gd,mysqlnd,json,xml,intl,pecl-apcu,opcache}

To load the new PHP extensions, restart the httpd service.

$ sudo systemctl restart httpd

2. Create the Database

osTicket relies on a database to store tickets and other information. You must set up one for it to work.

Log in to your MySQL/MariaDB server as root.

$ sudo mysql -u root -p

Enter the root password for your MySQL/MariaDB server and press ENTER to continue.

Create a database and name it os_ticket. You can use any name here, but having a descriptive name will help you easily identify the database and troubleshoot problems if they occur later. Next, create a user named os_ticket_user. Then, exit from the MySQL/MariaDB command-line interface.

Choose the commands below depending on your choice of the database server. Remember to replace EXAMPLE_PASSWORD with a strong value.

  • If you use MySQL:

    mysql> CREATE DATABASE os_ticket;
           CREATE USER 'os_ticket_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD';
           GRANT ALL PRIVILEGES ON os_ticket.* TO 'os_ticket_user'@'localhost';
           FLUSH PRIVILEGES;
           EXIT;
    
  • If you use MariaDB:

    MariaDB> CREATE DATABASE os_ticket;
             GRANT ALL PRIVILEGES on os_ticket.* TO 'os_ticket_user'@'localhost' identified by 'EXAMPLE_PASSWORD';
             EXIT;
    

3. Install osTicket

You'll install the osTicket under the /var/www/ directory. To keep things simple, create a child directory and name it os_ticket.

$ sudo mkdir -p /var/www/os_ticket

Change the ownership of the directory to your current username to avoid permission issues when installing the package.

$ sudo chown -R $USER:$USER /var/www/os_ticket

Navigate to the /var/www/os_ticket directory.

$ cd /var/www/os_ticket

Use the Linux wget command to download the latest stable osTicket version.

$ wget https://github.com/osTicket/osTicket/releases/download/v1.15.2/osTicket-v1.15.2.zip

Unzip the osTicket-v1.15.2.zip archive file.

$ unzip osTicket-v1.15.2.zip

Delete the zip file after you've extracted it.

$ rm osTicket-v1.15.2.zip

Copy the sample configuration file to ost-config.php.

$ sudo cp upload/include/ost-sampleconfig.php upload/include/ost-config.php

Change the ownership of the entire /var/www/os_ticket directory to the apache user.

$ sudo chown -R apache:apache /var/www/os_ticket

Set the correct permissions for the /var/www/os_ticket directory.

$ sudo chmod -R 755 /var/www/os_ticket

4. Disable SELinux

Open the file /etc/selinux/config using nano.

$ sudo nano /etc/selinux/config

Find the line SELINUX=enforcing.

...
SELINUX=enforcing
...

Change the value of SELINUX from enforcing to disabled.

...
SELINUX=disabled
...

Reboot the server to load the new SELinux configurations.

$ sudo reboot

5. Create the Virtual Host File

Create a new os_ticket.conf virtual host file under the /etc/httpd/conf/ directory.

 $ sudo nano /etc/httpd/conf.d/os_ticket.conf

Enter the information below into the file. Replace example.com with the correct domain name or public IP address of your server.

<VirtualHost *:80>
  ServerAdmin webmaster@example.com
  DocumentRoot /var/www/os_ticket/upload
  ServerName example.com
  ErrorLog logs/example.com-error_log
  CustomLog logs/example.com-access_log common
</VirtualHost>

Save and close the file.

Restart Apache to load the new configuration.

$ sudo systemctl restart httpd

6. Finish the Installation

Visit your server's URL in a web browser to complete the osTicket installation. Replace example.com with your domain name or server's public IP address.

http://www.example.com

You should see an output like the screenshot below.

osTicket Setup Final Page

Respond to the on-screen wizard to complete the following:

  • System Settings
  • Admin User account
  • Database Settings. Here, you should enter the database details that you created earlier in this guide.

Your osTicket installation should be finalized, and you'll see the following output.

osTicket Default Setup Page

Complete the osTicket installation by deleting the setup directory.

$ sudo rm -rf /var/www/os_ticket/upload/setup

Remove write access to the main osTicket configuration file.

$ sudo chmod 0644 /var/www/os_ticket/upload/include/ost-config.php

Conclusion

In this tutorial, you've installed an osTicket with LAMP stack on Fedora 34. You can now proceed and use the intuitive web-based ticketing dashboard to manage your customer queries.

Want to contribute?

You could earn up to $300 by adding new articles