Sistema Operativo: Red Hat Enterprise Linux 8
Web Server: nginx
Versione osTicket: 1.14.3

Step 1: Prerequisiti

sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config  
setenforce 0  
dnf update

Step 2: Installazione pacchetti

dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm  
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm  

dnf -y module reset php  
dnf -y module install php:remi-7.2  

yum install -y nginx mariadb-server php php-mysqlnd php-gd php-imap php-intl php-pecl-apcu php-opcache

Step 3: Set up del database

systemctl enable --now mariadb.service
mysql_secure_installation

mysql -u root -p
CREATE DATABASE osticket_db;
GRANT ALL ON osticket_db.* TO 'osticket_user' IDENTIFIED BY 'OsticketUser!';
FLUSH PRIVILEGES;
EXIT;

Step 4: Configurazione di nginx

cat > /etc/nginx/nginx.conf << "EOF"
user  nginx;
worker_processes auto;

events {
  worker_connections  1024;
}

http {

  include mime.types;
  default_type application/octet-stream;
  sendfile on;
  charset utf-8;
  gzip on;
  gzip_types text/plain application/xml text/javascript;
  gzip_min_length 1000;

  index index.php;

  server {

    listen 80;
    server_name osticket.local;

    keepalive_timeout 70;

    root /var/www/osticket/upload;

    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;
    }

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

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

    location ~ ^/ajax.php/.*$ {
      try_files $uri $uri/ /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;
      fastcgi_param  PATH_INFO $path_info;
      fastcgi_pass   unix:/run/php-fpm/www.sock;
    }

  }
}
EOF

Step 5: Installazione e configurazione di osTicket

VER=1.14.3

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

wget https://github.com/osTicket/osTicket/releases/download/v${VER}/osTicket-v${VER}.zip
unzip osTicket-v${VER}.zip
rm osTicket-v${VER}.zip

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

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

sed -i -e "s/^user =.*/user = nginx/" \
       -e "s/^group =.*/group = nginx/" \
       -e "s/^listen =.*/listen = \/run\/php-fpm\/www.sock/" /etc/php-fpm.d/www.conf

mkdir -p /var/lib/php/opcache /var/lib/php/session /var/lib/php/wsdlcache
chown -R nginx:nginx /var/lib/php/opcache /var/lib/php/session /var/lib/php/wsdlcache

systemctl enable --now php-fpm.service nginx.service

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --reload

Step 6: Pulizia sistema (da fare dopo il setup via web)

rm -rf upload/setup
chmod 0644 upload/include/ost-config.php