Kanboard Project Management Software installeren op CentOS 8
Kanboard is een open-source project management software die je helpt je projecten te beheren en je werkstroom te visualiseren. Het gebruikt Kanban methodologie en is speciaal ontworpen voor kleine teams die gericht zijn op minimalisme en eenvoud. Kanban biedt een eenvoudige en gebruiksvriendelijke webinterface waarmee je je project via een webbrowser kunt beheren. Je kunt Kanban ook integreren met externe diensten met behulp van de plugins.
In deze handleiding laten we je zien hoe je Kanban met Nginx en Let’s Encrypt SSL op CentOS 8 kunt installeren.
Vereisten
- Een server die CentOS 8 draait.
- Een geldige domeinnaam gericht met je server IP.
- Een root wachtwoord is op je server ingesteld.
Installeer de LEMP server
Eerst moet je Nginx, MariaDB, PHP en andere PHP uitbreidingen op je server installeren. Je kunt ze allemaal installeren met het volgende commando:
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
Als alle pakketten geïnstalleerd zijn, start je de Nginx, PHP-FPM en MariaDB dienst en schakel je ze in om te starten bij het herstarten van het systeem met het volgende commando:
systemctl start mariadb
systemctl enable mariadb
systemctl start nginx
systemctl start php-fpm
systemctl enable nginx
systemctl enable php-fpm
Bewerk vervolgens het PHP-FPM configuratiebestand en verander de gebruiker en groep van apache in nginx.
nano /etc/php-fpm.d/www.conf
Verander de volgende regels:
user = nginx group = nginx
Bewaar en sluit het bestand en herstart dan de PHP-FPM dienst om de veranderingen toe te passen:
systemctl restart php-fpm
Als je klaar bent, kun je verder gaan met de volgende stap.
Maak een databank voor Kanban
Kanban gebruikt SQLite en MariaDB als database backend. Je zult dus een databank en gebruiker voor Kanban moeten maken.
Maak eerst verbinding met de MariaDB met het volgende commando:
mysql
Eenmaal verbonden maak je een databank en gebruiker aan met het volgende commando:
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';
Spoel vervolgens de privileges en verlaat de MariaDB met het volgende commando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Als de database en gebruiker zijn aangemaakt, kun je verder gaan met de volgende stap.
Kanban downloaden
Eerst moet je de nieuwste versie van Kanban downloaden uit de Git Hub repository. Je kunt het downloaden met het volgende commando:
wget https://github.com/kanboard/kanboard/archive/v1.2.18.tar.gz
Als de download voltooid is, pak je het gedownloade bestand uit met het volgende commando:
tar -xvzf v1.2.18.tar.gz
Verplaats de uitgepakte map vervolgens naar de Nginx web root map met het volgende commando:
mv kanboard-1.2.18 /var/www/html/kanboard
Verander vervolgens de directory in Nginx web root en kopieer het voorbeeld config bestand:
cd /var/www/html/kanboard
cp config.default.php config.php
Bewerk vervolgens het configuratiebestand en bepaal je database instellingen:
nano config.php
Verander de volgende regels volgens je 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');
Sla het bestand op en sluit het als je klaar bent. Stel vervolgens het eigendom en de rechten in met het volgende commando:
chown -R nginx:nginx /var/www/html/kanboard
chmod -R 775 /var/www/html/kanboard
Als je klaar bent, kun je verder gaan met de volgende stap.
Configureer Nginx voor Kanban
Vervolgens moet je een Nginx virtual host configuratiebestand maken om Kanban te hosten. Je kunt het maken met het volgende commando:
nano /etc/nginx/conf.d/kanboard.conf
Voeg de volgende regels toe:
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; }
Sla het bestand op en sluit het als je klaar bent. Controleer dan de Nginx op syntaxfouten met het volgende commando:
nginx -t
Je zou de volgende uitvoer moeten zien:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Herstart tenslotte de Nginx dienst om de veranderingen toe te passen:
systemctl restart nginx
Op dit punt is Nginx geconfigureerd om kanban te serveren. Je kunt nu verder gaan om het kanban dashboard te openen.
Configureer SELinux en Firewall
Standaard is SELinux ingeschakeld in CentOS 8. Je zult dus SELinux context moeten instellen voor Kanban. Je kunt het instellen met het volgende commando:
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
Sta vervolgens poort 80 en 443 toe via de firewalld met het volgende commando:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Als je klaar bent, kun je verder gaan met de volgende stap.
Toegang tot Kanban Dashboard
Open nu je webbrowser en ga naar het kanban dashboard met de URL http://kanban.example.com. Je wordt
doorverwezen naar de Kanban admin login pagina:
Geef, standaard gebruikersnaam en wachtwoord op als admin / beheerder en klik op de knopSign in. Je zou het Kanban dashboard op de volgende pagina moeten zien:
Kanban beveiligen met Let’s Encrypt SSL
Vervolgens moet je het Certbot programma in je systeem installeren om Let’s Encrypt SSL voor het Let’s Chat domein te downloaden en te installeren.
Je kunt de Certbot client installeren met het volgende commando:
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
Verkrijg en installeer vervolgens een SSL certificaat voor je lets domein met het volgende commando:
certbot-auto --nginx -d kanban.example.com
Het bovenstaande commando installeert eerst alle vereiste afhankelijkheden op je server. Eenmaal geïnstalleerd wordt je gevraagd een e-mailadres op te geven en de servicevoorwaarden te accepteren, zoals hieronder:
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): [email protected] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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
Kies vervolgens of je HTTP verkeer al dan niet naar HTTPS wilt omleiden, zoals hieronder:
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
Typ 2 en druk op Enter om verder te gaan. Als de installatie voltooid is, zou je de volgende uitvoer moeten zien:
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
Je kunt nu je Kanban veilig benaderen met de URL https://kanban.example.com.
Conclusie
Gefeliciteerd! Je hebt met succes Kanban geïnstalleerd met Nginx en Let’s Encrypt SSL op CentOS 8. Je kunt nu Kanban in de ontwikkelomgeving implementeren en beginnen samen te werken. Voel je vrij me te vragen als je vragen hebt.