Ricerca nel sito web

Come installare il software di gestione dei progetti Kanboard su CentOS 8


Su questa pagina

  1. Prerequisiti
  2. Installa il server LEMP
  3. Crea un database per Kanban
  4. Scarica Kanban
  5. Configura Nginx per Kanban
  6. Configura SELinux e Firewall
  7. Accedi alla dashboard Kanban
  8. Proteggi Kanban con Lets Encrypt SSL
  9. Conclusione

Kanboard è un software di gestione dei progetti open source che ti aiuta a gestire i tuoi progetti e visualizzare il tuo flusso di lavoro. Utilizza la metodologia Kanban ed è appositamente progettato per piccoli team che si concentrano sul minimalismo e sulla semplicità. Kanban fornisce un'interfaccia web semplice e facile da usare che ti consente di gestire il tuo progetto tramite un browser web. Puoi anche integrare Kanban a servizi esterni utilizzando i plugin.

In questo tutorial, ti mostreremo come installare Kanban con Nginx e Lets Encrypt SSL su CentOS 8.

Prerequisiti

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

Installa il server LEMP

Innanzitutto, dovrai installare Nginx, MariaDB, PHP e altre estensioni PHP sul tuo server. Puoi installarli tutti con il seguente comando:

dnf install nginx mariadb-server php php-fpm php-mbstring php-cli php-json php-opcache php-zip php-xml php-gd php-ldap php-mysqli php-sqlite3 php-json php-dom -y

Una volta installati tutti i pacchetti, avviare il servizio Nginx, PHP-FPM e MariaDB e abilitarli all'avvio al riavvio del sistema con il seguente comando:

systemctl start mariadb
systemctl enable mariadb
systemctl start nginx
systemctl start php-fpm
systemctl enable nginx
systemctl enable php-fpm

Successivamente, modifica il file di configurazione PHP-FPM e modifica l'utente e il gruppo da apache a nginx.

nano /etc/php-fpm.d/www.conf

Modifica le seguenti righe:

user = nginx
group = nginx

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

systemctl restart php-fpm

Una volta terminato, puoi procedere al passaggio successivo.

Crea un database per Kanban

Kanban utilizza SQLite e MariaDB come backend del database. Quindi dovrai creare un database e un utente per Kanban.

Innanzitutto, connettiti a MariaDB con il seguente comando:

mysql

Una volta connesso, crea un database e un utente con il seguente comando:

MariaDB [(none)]> CREATE DATABASE kanboard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON kanboard.* TO 'kanboard'@'localhost' IDENTIFIED BY 'password';

Successivamente, scarica i privilegi ed esci da MariaDB con il seguente comando:

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

Dopo aver creato il database e l'utente, puoi procedere al passaggio successivo.

Scarica Kanban

Innanzitutto, dovrai scaricare l'ultima versione di Kanban dal repository Git Hub. Puoi scaricarlo con il seguente comando:

wget https://github.com/kanboard/kanboard/archive/v1.2.18.tar.gz

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

tar -xvzf v1.2.18.tar.gz

Successivamente, sposta la directory estratta nella directory root web di Nginx con il seguente comando:

mv kanboard-1.2.18 /var/www/html/kanboard

Quindi, cambia la directory in root web Nginx e copia il file di configurazione di esempio:

cd /var/www/html/kanboard
cp config.default.php config.php

Successivamente, modifica il file di configurazione e definisci le impostazioni del database:

nano config.php

Modifica le seguenti righe in base al tuo database:

define('DB_DRIVER', 'mysql');

// Mysql/Postgres username
define('DB_USERNAME', 'kanboard');

// Mysql/Postgres password
define('DB_PASSWORD', 'password');

// Mysql/Postgres hostname
define('DB_HOSTNAME', 'localhost');

// Mysql/Postgres database name
define('DB_NAME', 'kanboard');

Salva e chiudi il file quando hai finito. Quindi, imposta la proprietà e le autorizzazioni con il seguente comando:

chown -R nginx:nginx /var/www/html/kanboard
chmod -R 775 /var/www/html/kanboard

Una volta terminato, puoi procedere al passaggio successivo.

Configura Nginx per Kanban

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

nano /etc/nginx/conf.d/kanboard.conf

Aggiungi le seguenti righe:

server {
        listen       80;
        server_name  kanboard.example.com;
        index        index.php;
        root         /var/www/html/kanboard;
        client_max_body_size 32M;

        location / {
            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-fpm/www.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
        }

        location ~* ^.+\.(log|sqlite)$ {
            return 404;
        }

        location ~ /\.ht {
            return 404;
        }

        location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
            log_not_found off;
            expires 7d;
            etag on;
        }

        gzip on;
        gzip_comp_level 3;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_types
            text/javascript
            application/javascript
            application/json
            text/xml
            application/xml
            application/rss+xml
            text/css
            text/plain;
    }

Salva e chiudi il file quando hai finito. Quindi, verifica Nginx per l'errore di sintassi con il seguente comando:

nginx -t

Dovresti vedere il seguente output:

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

Infine, riavvia il servizio Nginx per applicare le modifiche:

systemctl restart nginx

A questo punto, Nginx è configurato per servire kanban. Ora puoi procedere per accedere alla dashboard kanban.

Configura SELinux e Firewall

Per impostazione predefinita, SELinux è abilitato in CentOS 8. Quindi dovrai configurare il contesto SELinux per Kanban. Puoi configurarlo 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/kanban

Successivamente, consenti la porta 80 e 443 attraverso il firewalld con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Accedi alla dashboard Kanban

Ora apri il tuo browser web e accedi alla dashboard kanban utilizzando l'URL http://kanban.example.com. Sarai

reindirizzato alla pagina di accesso dell'amministratore di Kanban:

Fornisci nome utente e password predefiniti come admin/admin e fai clic sul pulsante Accedi. Dovresti vedere la dashboard Kanban nella pagina seguente:

Proteggi Kanban con Lets Encrypt SSL

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

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 dominio let con il seguente comando:

certbot-auto --nginx -d kanban.example.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 nginx, Installer nginx
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 kanban.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/kanban.conf

Successivamente, seleziona 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/nginx/conf.d/kanban.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://kanban.example.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/kanban.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/kanban.example.com/privkey.pem
   Your cert will expire on 2021-04-2. 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

Ora puoi accedere al tuo Kanban in modo sicuro utilizzando l'URL https://kanban.example.com.

Conclusione

Congratulazioni! hai installato con successo Kanban con Nginx e Lets Encrypt SSL su CentOS 8. Ora puoi implementare Kanban nell'ambiente di sviluppo e iniziare a lavorare insieme. Non esitate a chiedermi se avete domande.