웹사이트 검색

Debian 11에서 Nginx로 osTicket을 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. Nginx 및 PHP 설치
  4. MariaDB 설치 및 구성
  5. osTicket 설치
  6. osTicket용 Nginx 구성
  7. osTicket 웹 인터페이스 액세스
  8. osTicket에서 SSL 활성화\n
  9. 결론

osTicket은 고객 서비스를 확장 및 간소화하고 고객 경험을 개선하는 데 사용되는 무료 오픈 소스 지원 티켓 시스템입니다. 모든 지원 티켓을 관리, 구성 및 추적할 수 있는 웹 기반 인터페이스를 제공합니다. PHP로 작성되었으며 MySQL 및 PostgreSQL과 같은 다양한 데이터베이스를 지원합니다.

특징

  • 대시보드 보고서
  • 구성 가능한 도움말 항목\n
  • 서비스 수준 계약
  • 티켓 필터\n
  • 고객 지원 포털
  • 자동 응답기

이 튜토리얼은 데비안 11에 osTicket을 설치하는 방법을 보여줍니다.

전제 조건

  • Debian 11을 실행하는 서버.\n
  • 유효한 도메인 이름은 서버 IP로 지정됩니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

시작하기

먼저 다음 명령을 사용하여 모든 시스템 패키지를 최신 버전으로 업데이트하고 업그레이드합니다.

apt update -y
apt upgrade -y

모든 패키지가 업데이트되면 다음 명령을 사용하여 다른 필수 패키지를 설치할 수 있습니다.

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

필요한 모든 패키지가 설치되면 다음 단계로 진행할 수 있습니다.

Nginx 및 PHP 설치

먼저 다음 명령을 사용하여 Nginx 웹 서버 패키지를 설치합니다.

apt install nginx -y

다음으로 다음 명령을 사용하여 PHP 리포지토리를 추가합니다.

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

그런 다음 다음 명령을 사용하여 최신 버전의 PHP 및 기타 필요한 PHP 종속성을 설치합니다.

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

설치 후 PHP 구성 파일을 편집합니다.

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

다음 줄을 변경합니다.

cgi.fix_pathinfo=0

파일을 저장하고 닫은 다음 PHP-FPM 서비스를 다시 시작하여 변경 사항을 적용하십시오.

systemctl restart php8.1-fpm

MariaDB 설치 및 구성

먼저 다음 명령을 사용하여 MariaDB 데이터베이스 서버를 설치합니다.

apt install mariadb-server -y

다음으로 다음 명령을 사용하여 MariaDB 설치를 보호합니다.

mysql_secure_installation

아래의 모든 질문에 답하십시오.

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

그런 다음 루트 사용자로 MariaDB 셸에 로그인합니다.

mysql -u root -p

다음으로 osTicket에 대한 데이터베이스와 사용자를 만듭니다.

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

그런 다음 권한을 플러시하고 다음 명령을 사용하여 MariaDB 셸을 종료합니다.

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

osTicket 설치

먼저 GitHub 다운로드 페이지에서 최신 버전의 osTicket을 다운로드합니다.

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

다운로드가 완료되면 osTicket용 디렉터리를 만들고 해당 디렉터리 안에 다운로드한 파일을 추출합니다.

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

다음으로 osticket 디렉터리에 대한 소유권과 권한을 설정합니다.

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

다음으로 osTicket 샘플 구성 파일의 이름을 바꿉니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

osTicket용 Nginx 구성

다음으로 osTicket용 Nginx 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

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 구성을 확인합니다.

nginx -t

다음과 같은 결과가 표시됩니다.

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

그런 다음 Nginx 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart nginx

다음 명령을 사용하여 Nginx 상태를 확인할 수도 있습니다.

systemctl status nginx

다음 출력에 Nginx 상태가 표시되어야 합니다.

? 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.

이 시점에서 Nginx가 설치되고 osTicket에 대해 구성됩니다. 이제 osTicket에 액세스할 수 있습니다.

osTicket 웹 인터페이스에 액세스

웹 브라우저를 열고 URL http://osticket.example.com을 사용하여 osTicket 설치 페이지에 액세스하십시오. 전제 조건 페이지가 표시되어야 합니다.

계속을 클릭합니다. 기본 설치 페이지가 표시되어야 합니다.

헬프데스크 URL, 이름, 이메일, 데이터베이스 이름, 사용자 이름, 암호를 정의한 다음 지금 설치 버튼을 클릭하여 설치를 시작합니다. osTicket이 설치되면 다음 페이지가 표시됩니다.

osTicket 제어판에 액세스하려면 웹 브라우저에 URL http://osticket.example.com/scp를 입력하십시오. osTicket 로그인 페이지가 표시되어야 합니다.

관리자 사용자 이름, 암호를 제공하고 로그인 버튼을 클릭합니다. 다음 화면에 osTicket 대시보드가 표시되어야 합니다.

URL https://forum.osticket.com을 사용하여 osTicket 포럼 페이지에 액세스할 수도 있습니다.

osTicket에서 SSL 활성화

osTicket 웹사이트에 Lets Encrypt SSL을 설치하려면 서버에 certbot 패키지를 설치해야 합니다.

먼저 다음 명령을 사용하여 Snap 패키지 관리자를 설치합니다.

apt install snapd

다음으로 Snap 패키지를 최신 버전으로 업데이트합니다.

snap install core
snap refresh core

다음으로 다음 명령을 사용하여 certbot 패키지를 설치합니다.

snap install --classic certbot

다음으로 시스템 위치에 대한 Certbot 바이너리에 대한 심볼릭 링크를 만듭니다.

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

그런 다음 다음 명령을 실행하여 Lets Encrypt SSL 인증서를 다운로드하고 설치합니다.

certbot --nginx -d osticket.example.com

이메일 주소를 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

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

Y를 입력하고 Enter 키를 눌러 도메인에 대한 SSL 인증서를 다운로드하고 설치합니다.

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

결론

축하합니다! Debian 11에서 Nginx와 함께 osTicket을 성공적으로 설치했습니다. 이제 회사에서 osTicket을 구현하고 헬프데스크 관리 시스템으로 사용할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.