Ricerca nel sito web

Come installare osTicket con Nginx su Debian 11


Su questa pagina

  1. Prerequisiti
  2. Per iniziare
  3. Installa Nginx e PHP
  4. Installa e configura MariaDB
  5. Installa osTicket
  6. Configura Nginx per osTicket
  7. Accedi all'interfaccia web di osTicket
  8. Abilita SSL su osTicket
  9. Conclusione

osTicket è un sistema di ticket di supporto gratuito e open source utilizzato per ridimensionare e semplificare il servizio clienti e migliorare l'esperienza del cliente. Offre un'interfaccia basata sul Web per gestire, organizzare e tenere traccia di tutti i ticket di supporto. È scritto in PHP e supporta vari database come MySQL e PostgreSQL.

Caratteristiche

  • Rapporti della dashboard
  • Argomento della guida configurabile
  • Accordi sul livello di servizio
  • Filtri ticket
  • Portale di assistenza clienti
  • Risposta automatica

Questo tutorial ti mostrerà come installare osTicket su Debian 11.

Prerequisiti

  • Un server che esegue Debian 11.
  • Un nome di dominio valido viene indicato con l'IP del tuo server.
  • Sul server è configurata una password di root.

Iniziare

Innanzitutto, aggiorna e aggiorna tutti i pacchetti di sistema alla versione più recente utilizzando il seguente comando.

apt update -y
apt upgrade -y

Una volta aggiornati tutti i pacchetti, puoi installare altri pacchetti richiesti con il seguente comando:

apt install ca-certificates apt-transport-https software-properties-common wget curl

Una volta installati tutti i pacchetti richiesti, puoi procedere al passaggio successivo.

Installa Nginx e PHP

Innanzitutto, installa il pacchetto del server Web Nginx utilizzando il seguente comando.

apt install nginx -y

Quindi, aggiungi il repository PHP usando il seguente comando.

curl -sSL https://packages.sury.org/php/README.txt | bash -x

Successivamente, installa l'ultima versione di PHP e altre dipendenze PHP richieste utilizzando il seguente comando.

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

Dopo l'installazione, modifica il file di configurazione PHP.

nano /etc/php/8.1/fpm/php.ini

Modifica la riga seguente.

cgi.fix_pathinfo=0

Salva e chiudi il file, quindi riavvia il servizio PHP-FPM per applicare le modifiche.

systemctl restart php8.1-fpm

Installa e configura MariaDB

Innanzitutto, installa il server del database MariaDB utilizzando il seguente comando.

apt install mariadb-server -y

Successivamente, proteggi l'installazione di MariaDB con il seguente comando.

mysql_secure_installation

Rispondi a tutte le domande di seguito:

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

Successivamente, accedi alla shell MariaDB come utente root.

mysql -u root -p

Successivamente, crea un database e un utente per osTicket.

MariaDB [(none)]> create database osticketdb;
MariaDB [(none)]> grant all privileges on osticketdb.* to osticketuser identified by 'secure-password';

Successivamente, svuota i privilegi ed esci dalla shell MariaDB con il seguente comando.

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Installa osTicket

Innanzitutto, scarica l'ultima versione di osTicket dalla pagina di download di GitHub.

wget https://github.com/osTicket/osTicket/releases/download/v1.17.2/osTicket-v1.17.2.zip

Una volta completato il download, crea una directory per osTicket ed estrai il file scaricato all'interno di tale directory.

mkdir /var/www/html/osticket
unzip osTicket-v1.17.2.zip -d /var/www/html/osticket

Successivamente, imposta la proprietà e l'autorizzazione sulla directory osticket.

chown -R www-data:www-data /var/www/html/osticket
chmod -R 755 /var/www/html/osticket

Successivamente, rinomina il file di configurazione di esempio osTicket.

mv /var/www/html/osticket/upload/include/ost-sampleconfig.php /var/www/html/osticket/upload/include/ost-config.php

Una volta terminato, puoi procedere al passaggio successivo.

Configura Nginx per osTicket

Successivamente, dovrai creare un file di configurazione dell'host virtuale Nginx per osTicket. Puoi crearlo con il seguente comando.

nano /etc/nginx/conf.d/osticket.conf

Aggiungere la seguente configurazione.

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

Salva e chiudi il file, quindi verifica la configurazione di Nginx con il seguente comando.

nginx -t

Otterrai il seguente output.

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Successivamente, riavvia il servizio Nginx per applicare le modifiche.

systemctl restart nginx

Puoi anche controllare lo stato di Nginx usando il seguente comando.

systemctl status nginx

Dovresti vedere lo stato di Nginx nel seguente output.

? nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-12-21 08:15:10 UTC; 4s ago
       Docs: man:nginx(8)
    Process: 24700 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 24701 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 24702 (nginx)
      Tasks: 2 (limit: 2339)
     Memory: 3.1M
        CPU: 25ms
     CGroup: /system.slice/nginx.service
             ??24702 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ??24703 nginx: worker process

Dec 21 08:15:10 debian11 systemd[1]: nginx.service: Succeeded.
Dec 21 08:15:10 debian11 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Dec 21 08:15:10 debian11 systemd[1]: Starting A high performance web server and a reverse proxy server...
Dec 21 08:15:10 debian11 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Dec 21 08:15:10 debian11 systemd[1]: Started A high performance web server and a reverse proxy server.

A questo punto, Nginx è installato e configurato per osTicket. Ora puoi procedere per accedere a osTicket.

Accedi all'interfaccia Web di osTicket

Apri il tuo browser web e accedi alla pagina di installazione di osTicket utilizzando l'URL http://osticket.example.com. Dovresti vedere la pagina dei prerequisiti.

Fare clic su Continua. Dovresti vedere la pagina di installazione di base.

Definisci l'URL, il nome, l'e-mail, il nome del database, il nome utente e la password del tuo helpdesk, quindi fai clic sul pulsante Installa ora per avviare l'installazione. Una volta installato osTicket, dovresti vedere la seguente pagina.

Per accedere al pannello di controllo di osTicket, digita l'URL http://osticket.example.com/scp nel tuo browser web. Dovresti vedere la pagina di login di osTicket.

Fornisci il nome utente e la password dell'amministratore e fai clic sul pulsante Accedi. Dovresti vedere la dashboard di osTicket nella schermata seguente.

Puoi anche accedere alla pagina del forum osTicket utilizzando l'URL https://forum.osticket.com.

Abilita SSL su osTicket

Per installare Lets Encrypt SSL sul sito Web osTicket, dovrai installare il pacchetto certbot sul tuo server.

Innanzitutto, installa il gestore di pacchetti Snap con il seguente comando:

apt install snapd

Successivamente, aggiorna il pacchetto Snap all'ultima versione:

snap install core
snap refresh core

Successivamente, installa il pacchetto certbot usando il seguente comando:

snap install --classic certbot

Successivamente, crea un collegamento simbolico per il binario Certbot alla posizione di sistema:

ln -s /snap/bin/certbot /usr/bin/certbot

Successivamente, esegui il comando seguente per scaricare e installare i certificati SSL di Lets Encrypt:

certbot --nginx -d osticket.example.com

Ti verrà chiesto di fornire il tuo indirizzo email e di accettare i termini di servizio:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

Digita Y e premi il tasto Invio per scaricare e installare i certificati SSL per il tuo dominio:

Account registered.
Requesting a certificate for osticket.example.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/osticket.example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/osticket.example.com/privkey.pem
This certificate expires on 2023-03-22.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for osticket.example.com to /etc/nginx/conf.d/osticket.conf
Congratulations! You have successfully enabled HTTPS on https://osticket.example.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Conclusione

Congratulazioni! hai installato con successo osTicket con Nginx su Debian 11. Ora puoi implementare osTicket nella tua azienda e usarlo come sistema di gestione dell'helpdesk. Non esitate a chiedermi se avete domande.