sudo apt update sudo apt install nginx sudo systemctl enable nginx sudo systemctl status nginx sudo chown www-data:www-data /usr/share/nginx/html -R sudo apt install mariadb-server mariadb-client systemctl status mariadb sudo systemctl enable mariadb sudo mysql_secure_installation sudo mariadb -u root exit; sudo apt install ca-certificates apt-transport-https software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt install php8.1 php8.1-fpm php8.1-mysql php-common php8.1-cli php8.1-common php8.1-opcache php8.1-readline php8.1-mbstring php8.1-xml php8.1-gd php8.1-curl php8.1-imap php8.1-apcu php8.1-intl php8.1-zip sudo systemctl enable php8.1-fpm systemctl status php8.1-fpm sudo rm /etc/nginx/sites-enabled/default sudo nano /etc/nginx/conf.d/default.conf server { listen 80; listen [::]:80; server_name _; root /usr/share/nginx/html/; index index.php index.html index.htm index.nginx-debian.html; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { fastcgi_pass unix:/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; include snippets/fastcgi-php.conf; } # A long browser cache lifetime can speed up repeat visits to your page location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ { access_log off; log_not_found off; expires 360d; } # disable access to hidden files location ~ /\.ht { access_log off; log_not_found off; deny all; } } sudo nginx -t sudo systemctl reload nginx sudo nano /usr/share/nginx/html/info.php test php info page (srv IP/info.php sudo rm /usr/share/nginx/html/info.php nginx auto restart if service stops working sudo mkdir -p /etc/systemd/system/nginx.service.d/ sudo nano /etc/systemd/system/nginx.service.d/restart.conf [Service] Restart=always RestartSec=5s sudo systemctl daemon-reload Osticket config create osticket database sudo mysql -u root -p create database osticket; grant priileges grant all privileges on osticket.* to user identified by 'password'; flush privileges; exit; download Osticket sudo apt-get install wget unzip wget https://github.com/osTicket/osTicket/releases/download/v1.17/osTicket-v1.17.zip unzip osTicket-v1.17.zip create Osticket folder under /var/www/ sudo mkdir -p /var/www/osticket/ copy osticket contents from upload to /var/www/osticket cd upload cp -r * /var/www/osticket configure Nginx Server Block and Symbolic Link sudo nano /etc/nginx/sites-available server { listen 80; root /var/www/osticket; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; index index.php index.html index.htm; add_header X-XSS-Protection "1; mode=block"; index index.php; client_max_body_size 2000M; client_body_buffer_size 100M; client_header_buffer_size 10M; large_client_header_buffers 2 10M; client_body_timeout 12; client_header_timeout 12; keepalive_timeout 15; send_timeout 10; gzip on; gzip_comp_level 2; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/x-javascript text/xml text/css application/xml; set $path_info ""; # Deny access to all files in the include directory location ~ ^/include { deny all; return 403; } # Deny access to apache .ht* files (nginx doesn't use these) location ~ /\.ht { deny all; } # Requests to /api/* need their PATH_INFO set, this does that if ($request_uri ~ "^/api(/[^\?]+)") { set $path_info $1; } # /api/*.* should be handled by /api/http.php if the requested file does not exist location ~ ^/api/(tickets|tasks)(.*)$ { try_files $uri $uri/ /api/http.php; } # /scp/ajax.php needs PATH_INFO too, possibly more files need it hence the .*\.php if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") { set $path_info $1; } # Make sure requests to /scp/ajax.php/some/path get handled by ajax.php location ~ ^/scp/ajax.php/(.*)$ { try_files $uri $uri/ /scp/ajax.php; } if ($request_uri ~ "^/ajax.php(/[^\?]+)") { set $path_info $1; } location ~ ^/ajax.php/.*$ { try_files $uri $uri/ /ajax.php; } location / { index index.php; # try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { try_files $uri =404; # fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php8.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $path_info; } listen 443 ssl http2; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; ssl_certificate /etc/nginx/ssl/cert.crt; ssl_certificate_key /etc/nginx/ssl/cert.key; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:HIGH:!aNULL:!MD5; } server { if ($host = support.FQDN) { return 301 https://$host$request_uri; } listen 80; server_name support.FQDN; return 404; } create symbolic link ln -s /etc/nginx/sites-available/osticket.conf /etc/nginx/sites-enabled/ check for syntax errors sudo systemctl reload nginx test osticket by opening browser type in http://srvIP or https://srvIP or http://support.fqdn rename ost-sampleconfig.php to ost-config.php cd /var/www/osticket/include mv ost-sampleconfig.php ost-config.php change permissions of /var/www/osticket/ sudo chown -R www-data:www-data /var/www/osticket/ remove setup directory sudo rm -r setup