CentOS8にKanboardプロジェクト管理ソフトウェアをインストールする方法

Centos/RHEL

目次

Kanboardは、プロジェクトの管理とワークフローの視覚化を支援するオープンソースのプロジェクト管理ソフトウェアです。 かんばんの方法論を使用し、ミニマリズムとシンプルさに焦点を当てた小さなチーム向けに特別に設計されています。 かんばんは、Webブラウザを介してプロジェクトを管理できるシンプルで使いやすいWebインターフェイスを提供します。 プラグインを使用して、かんばんを外部サービスに統合することもできます。

このチュートリアルでは、CentOS8にNginxとLet’sEncryptSSLを使用してかんばんをインストールする方法を示します。

前提条件

  • CentOS8を実行しているサーバー。
  • サーバーIPを指す有効なドメイン名。
  • サーバーにrootパスワードが設定されています。

LEMPサーバーをインストールする

まず、Nginx、MariaDB、PHP、およびその他のPHP拡張機能をサーバーにインストールする必要があります。 次のコマンドを使用して、それらすべてをインストールできます。

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

すべてのパッケージがインストールされたら、Nginx、PHP-FPM、およびMariaDBサービスを開始し、次のコマンドを使用してシステムの再起動時にそれらを開始できるようにします。

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

次に、PHP-FPM構成ファイルを編集し、ユーザーとグループをapacheからnginxに変更します。

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

次の行を変更します。

user = nginx
group = nginx

ファイルを保存して閉じ、PHP-FPMサービスを再起動して変更を適用します。

systemctl restart php-fpm

終了したら、次のステップに進むことができます。

かんばんのデータベースを作成する

かんばんは、SQLiteとMariaDBをデータベースバックエンドとして使用します。 したがって、かんばんのデータベースとユーザーを作成する必要があります。

まず、次のコマンドを使用してMariaDBに接続します。

mysql

接続したら、次のコマンドを使用してデータベースとユーザーを作成します。

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

次に、特権をフラッシュし、次のコマンドでMariaDBを終了します。

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

データベースとユーザーが作成されたら、次のステップに進むことができます。

かんばんをダウンロード

まず、GitHubリポジトリから最新バージョンのかんばんをダウンロードする必要があります。 次のコマンドでダウンロードできます。

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

ダウンロードが完了したら、次のコマンドを使用してダウンロードしたファイルを抽出します。

tar -xvzf v1.2.18.tar.gz

次に、次のコマンドを使用して、抽出したディレクトリをNginxWebルートディレクトリに移動します。

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

次に、ディレクトリをNginx Webルートに変更し、サンプルの設定ファイルをコピーします。

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

次に、構成ファイルを編集して、データベース設定を定義します。

nano config.php

データベースに従って、次の行を変更します。

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');

終了したら、ファイルを保存して閉じます。 次に、次のコマンドを使用して所有権と権限を設定します。

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

終了したら、次のステップに進むことができます。

かんばん用にNginxを構成する

次に、かんばんをホストするNginx仮想ホスト構成ファイルを作成する必要があります。 次のコマンドで作成できます。

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

次の行を追加します。

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

終了したら、ファイルを保存して閉じます。 次に、次のコマンドを使用して、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はかんばんを提供するように構成されています。 これで、かんばんダッシュボードへのアクセスに進むことができます。

SELinuxとファイアウォールを構成する

デフォルトでは、SELinuxはCentOS 8で有効になっているため、かんばんの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/kanban

次に、次のコマンドを使用して、ポート80と443がfirewalldを通過できるようにします。

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

終了したら、次のステップに進むことができます。

かんばんダッシュボードにアクセスする

次に、Webブラウザーを開き、URLを使用してかんばんダッシュボードにアクセスします。 http://kanban.example.com。 あなたはなれます

かんばん管理者ログインページにリダイレクトされます:

カンボードログイン

admin / adminとしてデフォルトのユーザー名とパスワードを入力し、をクリックします。 ログイン ボタン。 次のページにかんばんダッシュボードが表示されます。

カンボードダッシュボード

SSLを暗号化して安全なかんばん

次に、システムにCertbotユーティリティをインストールして、Let’sChatドメインのLet’sEncryptSSLをダウンロードしてインストールする必要があります。

次のコマンドを使用して、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

次に、次のコマンドを使用して、letsドメインのSSL証明書を取得してインストールします。

certbot-auto --nginx -d kanban.example.com

上記のコマンドは、最初に必要なすべての依存関係をサーバーにインストールします。 インストールすると、以下に示すように、メールアドレスを入力して利用規約に同意するよう求められます。

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

次に、以下に示すように、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/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

URLを使用してかんばんに安全にアクセスできるようになりました https://kanban.example.com

結論

おめでとう! これで、CentOS8にNginxとLet’sEncrypt SSLを使用してかんばんが正常にインストールされました。これで、開発環境にかんばんを実装して、共同作業を開始できます。 ご不明な点がございましたら、お気軽にお問い合わせください。

Hope this helps!

Source link

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です