Ricerca nel sito web

Come installare Mantis Bug Tracker su CentOS 8


Su questa pagina

  1. Prerequisiti
  2. Installa il server LAMP
  3. Crea un database per Mantis
  4. Installa Mantis
  5. Configura Apache per Mantis
  6. Proteggi Mantis con Lets Encrypt SSL
  7. Configura SELinux e Firewall
  8. Accedi all'interfaccia web di Mantis
  9. Conclusione

MantisBT è un software di tracciamento dei bug gratuito, open source e basato sul Web scritto in PHP. È semplice, facile da usare, intuitivo e include molti strumenti che ti aiutano a collaborare con i team per risolvere rapidamente bug e problemi. Offre un ricco set di funzionalità tra cui, notifica via e-mail, controllo degli accessi basato sui ruoli, supporto per progetti, sottoprogetti e categorie, grafico delle relazioni tra problemi, dashboard personalizzabile e molto altro.

In questo tutorial, ti mostreremo come installare il sistema Mantis Bug Tracking su CentOS 8.

Prerequisiti

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

Installa LAMP Server

Innanzitutto, dovrai installare il server Web Apache, il server MariaDB, PHP e altri pacchetti richiesti sul tuo sistema. Puoi installarli tutti con il seguente comando:

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

Una volta installati tutti i pacchetti, avvia il servizio Apache e MariaDB e abilitali all'avvio al riavvio del sistema con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Crea un database per Mantis

Mantis utilizza MariaDB o MySQL come backend del database. Quindi dovrai creare un database e un utente per Mantis.

Innanzitutto, accedi alla shell MariaDB con il seguente comando:

mysql

Una volta effettuato l'accesso, creare un database e un utente con il seguente comando:

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

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

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

Una volta terminato, puoi procedere al passaggio successivo.

Installa Mantide

Innanzitutto, scarica l'ultima versione di Mantis dal sito Web di Sourceforge con il seguente comando:

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

Una volta completato il download, decomprimere il file scaricato con il seguente comando:

unzip mantisbt-2.24.2.zip

Quindi, copia la directory estratta nella directory principale di Apache con il seguente comando:

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

Successivamente, cambia la proprietà della directory mantis in apache:

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

Una volta terminato, puoi procedere al passaggio successivo.

Configura Apache per Mantis

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

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

Aggiungi le seguenti righe:

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

Salva e chiudi il file quando hai finito, quindi riavvia il servizio Apache per applicare le modifiche:

systemctl restart httpd

Puoi anche verificare lo stato dell'Apache con il seguente comando:

systemctl status httpd

Dovresti ottenere il seguente output:

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

Proteggi Mantis con Lets Encrypt SSL

Successivamente, dovrai installare l'utilità Certbot nel tuo sistema per scaricare e installare Lets Encrypt SSL per il tuo sito Web Mantis.

Puoi installare il client Certbot con il seguente comando:

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

Successivamente, ottieni e installa un certificato SSL per il tuo sito Web Mantis con il seguente comando:

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

Il comando precedente installerà prima tutte le dipendenze richieste sul tuo server. Una volta installato, ti verrà chiesto di fornire un indirizzo e-mail e di accettare i termini di servizio come mostrato di seguito:

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

Successivamente, dovrai scegliere se reindirizzare o meno il traffico HTTP su HTTPS come mostrato di seguito:

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

Digita 2 e premi Invio per continuare. Al termine dell'installazione, dovresti vedere il seguente output:

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

Configura SELinux e Firewall

Per impostazione predefinita, SELinux è abilitato in CentOS 8. Quindi dovrai configurarlo per il tuo sito Web Mantis.

Puoi configurare SELinux con il seguente comando:

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

Successivamente, consentire la porta 80 e 443 attraverso il firewall con il seguente comando:

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

Al termine, puoi procedere al passaggio successivo.

Accedi all'interfaccia utente web di Mantis

Ora, apri il tuo browser web e accedi all'interfaccia web di Mantis utilizzando l'URL https://mantis.linuxbuz.com. Dovresti vedere la seguente schermata:

Fornire il nome del database, nome utente, nome utente amministratore, password, e-mail e fare clic sul pulsante Installa/Aggiorna database. Una volta completata l'installazione, dovresti vedere la seguente schermata:

Successivamente, fai clic sul pulsante \Continua\, dovresti vedere la pagina di accesso di Mantis BT nella seguente schermata:

Fornisci un amministratore nome utente Mantis predefinito e fai clic sul pulsante Accedi. Verrà richiesto di fornire la password come mostrato nella seguente schermata:

Fornisci la password predefinita di Mantis \root\ e fai clic sul pulsante Accedi. Verrai reindirizzato alla seguente schermata:

Si consiglia di modificare la password amministratore predefinita. Fornisci la tua password attuale, la nuova password, l'e-mail, il nome reale, il livello di accesso, il livello di accesso al progetto e fai clic sul pulsante Aggiorna utente. Dovresti vedere la dashboard di Mantis nella seguente schermata:

Conclusione

Congratulazioni! hai installato con successo Mantis con Lets Encrypt SSL su CentOS 8. Ora puoi implementare Mantis nel tuo ambiente di sviluppo e collaborare con i team. Non esitate a chiedermi se avete domande.