How to Install osTicket with Nginx on Debian 11



How to Install osTicket with Nginx on Debian 11

How to Install osTicket with Nginx on Debian 11

osTicket is a free and open-source support ticket system used to scale and streamline your customer service and improve your customer experience. It offers a web-based interface to manage, organize, and track all support tickets. It is written in PHP and supports various databases such as MySQL and PostgreSQL.

This video will show you how to install osTicket on Debian 11.

Useful Links
VPS/VDS – https://www.mivocloud.com/
OSticket – https://osticket.com/

Commands Used
apt install ca-certificates apt-transport-https software-properties-common wget curl
apt install nginx -y
curl -sSL https://packages.sury.org/php/README.txt | bash -x
apt install php8.1 php8.1-mysql php8.1-cgi php8.1-fpm php8.1-cli php8.1-curl php8.1-gd php8.1-imap php8.1-mbstring php8.1-intl php8.1-apcu php8.1-common php8.1-gettext php8.1-bcmath php8.1-xml php8.1-dom -y
nano /etc/php/8.1/fpm/php.ini
systemctl restart php8.1-fpm
apt install mariadb-server -y
mysql_secure_installation
mysql -u root -p
create database osticketdb;
grant all privileges on osticketdb.* to osticketuser identified by ‘secure-password’;
flush privileges;
exit;
wget https://github.com/osTicket/osTicket/releases/download/v1.17.2/osTicket-v1.17.2.zip
mkdir /var/www/html/osticket
unzip osTicket-v1.17.2.zip -d /var/www/html/osticket
chown -R www-data:www-data /var/www/html/osticket
chmod -R 755 /var/www/html/osticket
mv /var/www/html/osticket/upload/include/ost-sampleconfig.php /var/www/html/osticket/upload/include/ost-config.php
nano /etc/nginx/conf.d/osticket.conf

server {
listen 80;
server_name osticket.example.com;
root /var/www/html/osticket/upload;
index index.php index.html index.htm;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

# 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/php8.1-fpm.sock;
}
}

nginx -t
systemctl restart nginx