How to install osTicket on Ubuntu 16.04

In this tutorial, we will show you how to install osTicket on Ubuntu 16.04 using a LEMP stack with Nginx as your web server, MySQL database server, and PHP 7.0. osTicket is a free and open source ticket support system written in PHP. It is a simple and lightweight tool that you can use to manage, organize, and archive ticket support requests. Installing osTicket on Ubuntu 16.04 is an easy task if you follow this article carefully below. Let’s start.

1. Login with SSH and update the system

Before we get started, you need to log into the server via SSH as a superuser:

ssh [email protected]_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with the actual server IP and SSH port number.

Also make sure your Ubuntu 16.04 server is up to date by running the following commands:

apt-get update
apt-get upgrade

2. Installing Nginx

To install the latest stable version of Nginx on your server, simply run the following command:

apt-get install nginx

3. Installing and configuring the MySQL database server

To install the MySQL database server, run the following command:

apt-get install mysql-client mysql-server

After installation, you can run the script mysql_secure_installation to set your root password and secure your MySQL installation.

mysql_secure_installation

4. Install PHP and PHP-FPM

Next, we will install PHP 7.0, PHP-FPM and some additional PHP modules that OsTicket needs to work properly:

apt-get install php7.0-mysql php7.0-cgi php7.0-fpm php7.0-cli php7.0-curl php7.0-mcrypt php7.0-gd php7.0-imap php7.0-mbstring php7.0-xml php7.0-intl php-apcu

5. Download a fresh copy of osTicket

Before downloading osTicket, we need to create a new directory. We can do this with the following command:

mkdir /var/www/osticket

We can change the current working directory:

cd /var/www/osticket

We can now download the latest version of OsTicket inside this directory:

wget http://osticket.com/sites/default/files/download/osTicket-v1.10.1.zip

6. Extracting and configuring osTicket

To extract an archive:

unzip osTicket-v1.10.1.zip

Next, you need to make a copy of the configuration file:

cp /var/www/osticket/upload/include/ost-sampleconfig.php /var/www/osticket/upload/include/ost-config.php

Finally, we need to change the ownerhsip of our osticket directory:

chown -R www-data:www-data /var/www/osticket

6. Create a new database for OsTicket

To install a new database for our osTicket installation, you first need to log into our MySQL server:

mysql -u root -p

And then run the following commands to create the database:

CREATE DATABASE osticket;
GRANT ALL PRIVILEGES ON osticket.* TO 'osticketuser'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
exit;

Remember to replace “PASSWORD” with your actual strong password.

7. Configuring the Nginx virtual host

To create a new Nginx server block, run the following command:

nano /etc/nginx/sites-available/osticket

And then enter the following (make sure you replace my-domain.ru with your real domain name):

server {
listen 80;
server_name my-domain.ru;
root /var/www/osticket/upload;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

index index.php index.html index.htm;

gzip on;
gzip_min_length 1000;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;

set $path_info "";

location ~ /include {
deny all;
return 403;
}

if ($request_uri ~ "^/api(/[^?]+)") {
set $path_info $1;
}

location ~ ^/api/(?:tickets|tasks).*$ {
try_files $uri $uri/ /api/http.php?$query_string;
}

if ($request_uri ~ "^/scp/.*.php(/[^?]+)") {
set $path_info $1;
}

location ~ ^/scp/ajax.php/.*$ {
try_files $uri $uri/ /scp/ajax.php?$query_string;
}

location / {
try_files $uri $uri/ index.php;
}

location ~ .php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}

Activate the server block by creating a symbolic link:

ln -s /etc/nginx/sites-available/osticket /etc/nginx/sites-enabled/osticket

You can test your Nginx configuration:

nginx -t

If there are no errors, you can restart Nginx:

service nginx restart

8. Install osTicket on Ubuntu 16.04 server

You can now open the page at http://my-domain.ru in your favorite web browser to complete the osTicket installation.

Just follow the instructions to complete the installation.

That’s all. If you followed all the instructions carefully, osTicket should be successfully installed on your Ubuntu 16.04 server.

Please disable your ad blocker or whitelist this site!

Sidebar