×


Blog


Set up Nginx as Reverse Proxy on Ubuntu 20.04 - Step by step guide ?

This article covers how you can easily configure the Nginx Web server as a reverse proxy by adding a configuration file. In fact, By doing this, you can protect your main server against different cyberattacks or you can utilize it to balance the load of incoming heavy traffic.


Install Discord on Rocky Linux 8 - Step by step guide ?

This article covers how to install Discord on Rocky Linux 8. Infact, Discord is available on Windows, macOS, and Linux Distros. It allows Users to communicate with voice calls, video calls, text messaging, media, and files in private chats or as part of communities called "servers". 


Install and Run Vagrant on Ubuntu 20.04

This article covers how to install the Vagrant virtual development environment on your Ubuntu 20.04 LTS Focal Fossa system. In fact, Vagrant is a command-line tool for building and managing virtual machines. To use Vagrant, you must have a virtualization engine like VirtualBox, Hyper-V, or Docker installed on your system. The Vagrant plugin system also provides support for KVM and VMware. 


The Best 6 Free and Open-Source Risk Management Software

This article covers the best, free and open-source risk management software that assists companies to build their brand reputation,assess risks before their detrimental impacts, and guide companies to take timely actions to minimize the impact and secure all the data, resources, and assets. it includes SearchInform Risk Monitor, Essential ERM, GOAT Risk, Camms.Risk, Sofvie and Open Source Risk Engine respectively. 


Install the Erlang Programming Language on Ubuntu 20.04 - Step by step guide ?

This article covers how to install the Erlang programming language on your Ubuntu 20.04 LTS Focal Fossa system. In fact, Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance.


Install Open Source osTicket on Ubuntu 20.04 - Step by Step guide ?

This article covers how to install the osTicket open source ticket system on Ubuntu 20.04 LTS Focal Fossa system. In fact, OsTicket allows you to manage, organize and archive your support request. It seamlessly routes inquiries created via email, web-forms, and phone calls into a simple, easy-to-use, multi-user, web-based customer support platform.


How to install osTicket with Nginx on Ubuntu ?

1. Update the system

First, log in to your server with sudo privileges and update the system with the latest stable version using the following command:

$ sudo apt update &&  sudo apt upgrade -y


2. Install LEMP Server

OsTicket requires Web server, PHP and Database Server to be installed on your server.

i. Install Nginx Web Server

You can install Nginx web server by the following command:

$ sudo apt install nginx -y

Now let's check Nginx service and To start the service manually, run the following commands:

$ sudo systemctl status nginx
$ sudo systemctl start nginx

Now enable nginx service to start at boot time by running the following command:

$ sudo systemctl enable nginx

ii. Install PHP and PHP-FPM

Next, you need to install PHP, PHP-FPM and some additional PHP modules which are required for OsTicket to run properly:

$ sudo apt install php php-mysql php-cgi php-fpm php-cli php-curl php-gd php-imap php-mbstring php-xml-util php-intl php-apcu php-common php-gettext php-bcmath

Above command will install php-7.2

Now edit php.ini file by running following command in terminal.

$ sudo vim /etc/php/7.2/fpm/php.ini

Uncomment cgi.fix_pathinfo variable and change its value to 0

cgi.fix_pathinfo=0

Now save and close the file.

Next, restart php7.2-fpm service and enable it at startup using the following command:

$ sudo systemctl restart php7.2-fpm
$ sudo systemctl enable php7.2-fpm

iii. Install and Configure MySQL Database server for OsTicket

From your terminal window, issue the following command to install the MySQL database server:

$ sudo apt install mysql-server

Now start MySQL service and enable it to start at boot time then check MySQL service status with the following command:-

$ sudo systemctl start mysql
$ sudo systemctl enable mysql
$ sudo systemctl status mysql

Next, secure MySQL installation with the following command:

$ sudo mysql_secure_installation

Answer all the questions as below:

Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Next, log in to MySQL console as shown below:

$ sudo mysql -u root -p

Enter your Root password here.

Now you need to create the database for osTicket

run following command:

$ mysql> create database osticket_db;
$ mysql> grant all privileges on osticket_db.* to osticket_user identified by 'OsTicketPassw0rd@19';
$ mysql> flush privileges;


3. Download and Configure osTicket

Create a new directory for osTicket and then go to that directory:

$ sudo mkdir -p /var/www/osticket/
$ cd /var/www/osticket/

Next download latest osTicket setup using wget and Extract it using the following command:-

$ sudo apt-get install wget unzip
$ sudo wget https://github.com/osTicket/osTicket/releases/download/v1.14.1/osTicket-v1.14.1.zip
$ sudo unzip osTicket-v1.14.1.zip

You will get scripts and upload directory after extracting.

Next create an osTicket configuration file from ost-sampleconfig.php file using the following command:

$ sudo su -
$ cd upload/
$ cp ost-sampleconfig.php ost-config.php

Next, you need to change ownership of the osTicket web directory to the 'www-data' user and group.

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


4. Create OsTicket Virtual Host

Now create new virtual host configuration for OsTicket by running following command:

$ sudo vim /etc/nginx/sites-available/osticket.conf

Paste the configuration as below:

server {
listen 80;
server_name 13.52.217.10;   ## change server_name as per your domain name.
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;

# Enable gzip
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.2-fpm.sock;
}
}

Here, You need to change server_name 13.52.217.10 as per your domain name.

Save the Nginx configuration file and exit.

Now activate the virtual host and test the configuration:

$ ln -s /etc/nginx/sites-available/osticket.conf /etc/nginx/sites-enabled/
$ nginx -t

Now restart nginx service:

$ sudo systemctl restart nginx


5. Install and configure osTicket

Now let's enter your domain name to get osTicket UI in any web browser.

Next Click on 'Continue' and you will be redirected to the osTicket configuration section.

Fill all required information and click “Install Now” button.

In the database settings, enter details as dbname, username, and password you have created during mysql setup.

Finally, Click on Install Now button

Next, change the permission of ost-config.php to remove write access by running the following command:

$ cd /var/www/osticket/upload/
$ chmod 0644 include/ost-config.php

For osTicket admin type your IP/domain name in the web browser.

For admin login/agent panel/Admin panel configuration type as following:

  • osTicket admin login - http://yourdomainname/scp/
  • osTicket agent panel - http://yourdomainname/scp/index.php
  • osTicket Admin panel configuration - http://yourdomainname/scp/settings.php