웹사이트 검색

CentOS 8에 Mantis 버그 추적기를 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. LAMP 서버 설치
  3. Mantis용 데이터베이스 만들기
  4. Mantis 설치
  5. Mantis용 Apache 구성
  6. Lets Encrypt SSL로 Mantis 보호\n
  7. SELinux 및 방화벽 구성\n
  8. Mantis 웹 UI 액세스
  9. 결론

MantisBT는 PHP로 작성된 무료 오픈 소스 웹 기반 버그 추적 소프트웨어입니다. 간단하고 사용하기 쉬우며 사용자 친화적이며 팀과 협력하여 버그와 문제를 신속하게 해결하는 데 도움이 되는 많은 도구가 함께 제공됩니다. 이메일을 통한 알림, 역할 기반 액세스 제어, 프로젝트, 하위 프로젝트 및 범주 지원, 문제 관계 그래프, 사용자 정의 가능한 대시보드 등을 포함한 다양한 기능을 제공합니다.

이 튜토리얼에서는 CentOS 8에 Mantis 버그 추적 시스템을 설치하는 방법을 보여줍니다.

전제 조건

  • CentOS 8을 실행하는 서버.\n
  • 서버 IP를 가리키는 유효한 도메인 이름입니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

램프 서버 설치

먼저 Apache 웹 서버, MariaDB 서버, PHP 및 기타 필수 패키지를 시스템에 설치해야 합니다. 다음 명령으로 모두 설치할 수 있습니다.

dnf install httpd mariadb-server php php-mysqli php-mbstring php-curl unzip -y

모든 패키지가 설치되면 Apache 및 MariaDB 서비스를 시작하고 다음 명령을 사용하여 시스템 재부팅 시 시작할 수 있도록 합니다.

systemctl start httpd
systemctl start mariadb
systemctl enable httpd
systemctl enable mariadb

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

Mantis용 데이터베이스 생성

Mantis는 MariaDB 또는 MySQL을 데이터베이스 백엔드로 사용합니다. 따라서 Mantis용 데이터베이스와 사용자를 생성해야 합니다.

먼저 다음 명령을 사용하여 MariaDB 셸에 로그인합니다.

mysql

로그인 후 다음 명령을 사용하여 데이터베이스와 사용자를 생성합니다.

MariaDB [(none)]> CREATE DATABASE mantisdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantis'@'localhost' IDENTIFIED BY 'mantispassword';

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

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

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

맨티스 설치

먼저 다음 명령을 사용하여 Sourceforge 웹 사이트에서 최신 버전의 Mantis를 다운로드합니다.

wget https://excellmedia.dl.sourceforge.net/project/mantisbt/mantis-stable/2.24.2/mantisbt-2.24.2.zip

다운로드가 완료되면 다음 명령을 사용하여 다운로드한 파일의 압축을 풉니다.

unzip mantisbt-2.24.2.zip

그런 다음 다음 명령을 사용하여 압축을 푼 디렉터리를 Apache 루트 디렉터리에 복사합니다.

cp -r mantisbt-2.24.2 /var/www/html/mantis

다음으로 mantis 디렉토리의 소유권을 apache로 변경합니다.

chown -R apache:apache /var/www/html/mantis

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

Mantis용 Apache 구성

다음으로 Mantis용 Apache 가상 호스트 구성 파일을 만들어야 합니다. 다음 명령으로 만들 수 있습니다.

nano /etc/httpd/conf.d/mantis.conf

다음 줄을 추가합니다.

<VirtualHost *:80>
ServerAdmin 
DocumentRoot "/var/www/html/mantis"
ServerName mantis.linuxbuz.com
<Directory "/var/www/html/mantis/">
Options MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

TransferLog /var/log/httpd/mantis_access.log
ErrorLog /var/log/httpd/mantis_error.log

</VirtualHost>

완료되면 파일을 저장하고 닫은 다음 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart httpd

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

systemctl status httpd

다음 출력이 표시되어야 합니다.

? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           ??php-fpm.conf
   Active: active (running) since Sat 2020-09-19 11:06:51 EDT; 37s ago
     Docs: man:httpd.service(8)
 Main PID: 41737 (httpd)
   Status: "Running, listening on: port 80"
    Tasks: 213 (limit: 25014)
   Memory: 25.0M
   CGroup: /system.slice/httpd.service
           ??41737 /usr/sbin/httpd -DFOREGROUND
           ??41738 /usr/sbin/httpd -DFOREGROUND
           ??41739 /usr/sbin/httpd -DFOREGROUND
           ??41740 /usr/sbin/httpd -DFOREGROUND
           ??41741 /usr/sbin/httpd -DFOREGROUND

Sep 19 11:06:51 centos8 systemd[1]: Starting The Apache HTTP Server...

Lets Encrypt SSL로 Mantis 보호

다음으로 시스템에 Certbot 유틸리티를 설치하여 Mantis 웹사이트용 Lets Encrypt SSL을 다운로드하고 설치해야 합니다.

다음 명령을 사용하여 Certbot 클라이언트를 설치할 수 있습니다.

wget https://dl.eff.org/certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto

다음으로 다음 명령을 사용하여 Mantis 웹 사이트에 대한 SSL 인증서를 가져와 설치합니다.

certbot-auto --apache -d mantis.linuxbuz.com

위의 명령은 먼저 서버에 필요한 모든 종속성을 설치합니다. 설치가 완료되면 아래와 같이 이메일 주소를 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing 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 


Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mantis.linuxbuz.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/apache/conf.d/mantis.conf

다음으로 아래와 같이 HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택해야 합니다.

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

2를 입력하고 Enter를 눌러 계속하십시오. 설치가 완료되면 다음 출력이 표시됩니다.

Redirecting all traffic on port 80 to ssl in /etc/apache/conf.d/mantis.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://mantis.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=mantis.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/mantis.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/mantis.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-03-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again with the "certonly" option. To non-interactively renew *all*
   of your certificates, run "certbot-auto renew"
 - 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

SELinux 및 방화벽 구성

기본적으로 SELinux는 CentOS 8에서 활성화되어 있습니다. 따라서 Mantis 웹사이트에 맞게 구성해야 합니다.

다음 명령을 사용하여 SELinux를 구성할 수 있습니다.

setsebool httpd_can_network_connect on -P
chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/mantis

그런 다음 다음 명령을 사용하여 방화벽을 통해 포트 80 및 443을 허용합니다.

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

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

Mantis 웹 UI에 액세스

이제 웹 브라우저를 열고 URL https://mantis.linuxbuz.com을 사용하여 Mantis 웹 인터페이스에 액세스하십시오. 다음 화면이 표시됩니다.

데이터베이스 이름, 사용자 이름, 관리자 사용자 이름, 암호, 이메일을 제공하고 데이터베이스 설치/업그레이드 버튼을 클릭합니다. 설치가 완료되면 다음 화면이 표시됩니다.

그런 다음 "계속" 버튼을 클릭하면 다음 화면에 Mantis BT 로그인 페이지가 표시됩니다.

기본 Mantis 사용자 이름 관리자를 제공하고 로그인 버튼을 클릭합니다. 다음 화면과 같이 비밀번호를 입력하라는 메시지가 표시됩니다.

Mantis 기본 암호 "root"를 제공하고 로그인 버튼을 클릭합니다. 다음 화면으로 리디렉션됩니다.

기본 관리자 암호를 변경하는 것이 좋습니다. 현재 비밀번호, 새 비밀번호, 이메일, 실명, 액세스 수준, 프로젝트 액세스 수준을 제공하고 사용자 업데이트 버튼을 클릭합니다. 다음 화면에 Mantis 대시보드가 표시되어야 합니다.

결론

축하합니다! CentOS 8에서 Lets Encrypt SSL로 Mantis를 성공적으로 설치했습니다. 이제 개발 환경에서 Mantis를 구현하고 팀과 협업할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.