Home / How To / How to install osTicket with Nginx on Ubuntu 18.04 LTS

How to install osTicket with Nginx on Ubuntu 18.04 LTS



osTicket is an open source card system on the Linux platform written in PHP. It supports various types of databases such as MySQL, PostgreSQL and can be integrated with the LDAP / Active directory for central authentication.

It is a simple and easy web based application. OsTicket lets you manage, organize and archive your support request. It seamlessly leads inquiries created via email, web forms and phone calls into a simple, easy-to-use, multi-user, web-based customer support platform.

In this tutorial I will show you how to install osTicket on Ubuntu 18.04, with Nginx as web server, MySQL / MariaDB as database server and PHP.

Prerequisites

  • Ubuntu 1
    8.04
  • A sudo user with root privileges.

Step 1: Getting Started [19659008] First, log on to your server with sudo privileges and update the system with the latest stable version with the following command:

  sudo apt update && sudo apt upgrade -y 

Step 2 : Installing LEMP Server

OsTicket requires web server, PHP and database server to be installed on your server.

Installing Nginx Web Server

You can install Nginx Web Server with the following command:

  sudo apt install nginx-y 

Now let's check the Nginx service and Run the following commands to start the service manually: [19659009] sudo systemctl status nginx
sudo systemctl start nginx

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

  sudo systemctl enable nginx 

Install PHP and PHP-FPM

Then you need to install PHP, PHP-FPM and some additional PHP modules required for OsTicket to work 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 

The above command installs php-7.2

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

  sudo vim /etc/php/7.2/fpm/php.inivud19659015??Uncomment cgi.fix_pathinfo variable and change its value to 0 

  cgi.fix_pathinfo = 0 

Save and close the file now.

Then restart the php7.2-fpm service and enable it at startup with the following command:

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

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 start time and 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: [19659009] sudo mysql_secure_installation

Answer all questions as below:

  
Set root password? [Y/n] Y
New password:
Enter new password:
Remove anonymous users? [Y/n] Y
Remove root login remotely? [Y/n] Y
Delete the test database and access it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Log in to the MySQL console as below:

sudo mysql -u root -p

Enter your root password here.

Now you need to create the database for osTicket [19659009] run by command

  mysql> create database osticket_db; 

mysql> grant all privileges on osticket_db. * To osticket_user identified by & # 39; [email protected] & # 39 ;;

mysql> flush privileges;

A database for osTicket has been created.

Step 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 the latest osTicket installation with wget and extract it with 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 tu 191919988 sudo unzip osTicket-v1.14.1.zip

You get scripts and upload the directory after extraction.

Then create an osTicket configuration file from ost-sampleconfig.php file with the following command:

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

Then you must change the ownership of the osTicket web directory to & # 39; www data & # 39; users and group.

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

Step 4 – Create OsTicket Virtual Host

Now create a new virtual host configuration for OsTicket by running the following command: [19659008] sudo vim /etc/nginx/sites-available/osticket.conf [19659015] Paste the configuration as below:

  server {
listen 80;
server name 13.52.217.10; ## Change the server name according to your domain name.
root / var / www / osticket / upload;

access_log /var/log/nginx/access.log;ebrit19459018??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 | details). * $ {
try_files $ uri $ uri / /api/http.php?$query_string;vud19459018??????1919909045anumif ($ request_uri ~ "^ / scp /.* . Php (/ [^?] + } ") {
set $ path_info $ 1;
}

location ~ ^ / scp / ajax.php /.*$ {
try_files $ uri $ uri / /scp/ajax.php?$query_string;ebrit19459018vodecall19659045] location / {
try_files $ uri $ uri / index.php;
} [19659045] location ~ .php $ {
fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
includes fastcgi_params;
includes snippets / fastcgi-php.conf;
fastcgi_pass phix: / 2-fpm.sock;
}
}

Here you need to change server name 13.52.217.10 according to your domain name.

Save the Nginx configuration file and exit.

Now enable the virtual host and test the configuration.

  ln-s /etc/nginx/sites-available/osticket.conf / etc / nginx / sites-enabled / 
  nginx -t [19659015] This shows the output as below 

 Test nginx Configuration

Restart nginx service

  sudo systemctl restart nginx 

Step 5: Install and configure osTicket

Now let's enter your domain name to get osTicket UI in any web browser, you will see a page like this:

 osTicket install

Next Click & # 39; Conti nue & # 39; and you will be redirected to the osTicket configuration section.

Fill in all necessary information and click on " Install Now" button.

 system settings [19659002] In the database settings, enter information such as dbname, username and password that you created during the mysql setting.

 Database settings

Last click on the Install Now button, once the installation is complete, it will be displayed as below:

 osTicket installation succeeded

Next, change the state from 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 enter your IP / domain name in the browser:

 osTicket Login

For admin login / agent panel / admin panel configuration type as follows.

Finally, you have installed edited osTicket on Ubuntu 18.04 server.


Source link