웹사이트 검색

CentOS 8에 Kanboard 프로젝트 관리 소프트웨어를 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. LEMP 서버 설치
  3. Kanban용 데이터베이스 생성
  4. 칸반 다운로드
  5. Kanban용 Nginx 구성
  6. SELinux 및 방화벽 구성\n
  7. 칸반 대시보드 액세스
  8. Lets Encrypt SSL로 Kanban 보안 유지
  9. 결론

Kanboard는 프로젝트를 관리하고 작업 흐름을 시각화하는 데 도움이 되는 오픈 소스 프로젝트 관리 소프트웨어입니다. Kanban 방법론을 사용하며 미니멀리즘과 단순성에 중점을 둔 소규모 팀을 위해 특별히 설계되었습니다. Kanban은 웹 브라우저를 통해 프로젝트를 관리할 수 있는 간단하고 사용하기 쉬운 웹 인터페이스를 제공합니다. 플러그인을 사용하여 Kanban을 외부 서비스에 통합할 수도 있습니다.

이 튜토리얼에서는 Nginx와 함께 Kanban을 설치하고 CentOS 8에서 Lets Encrypt SSL을 설치하는 방법을 보여줍니다.

전제 조건

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

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

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

Kanban용 데이터베이스 생성

Kanban은 SQLite와 MariaDB를 데이터베이스 백엔드로 사용합니다. 따라서 Kanban용 데이터베이스와 사용자를 생성해야 합니다.

먼저 다음 명령을 사용하여 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;

데이터베이스와 사용자가 생성되면 다음 단계로 진행할 수 있습니다.

칸반 다운로드

먼저 Git Hub 리포지토리에서 최신 버전의 Kanban을 다운로드해야 합니다. 다음 명령으로 다운로드할 수 있습니다.

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

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

tar -xvzf v1.2.18.tar.gz

다음으로 다음 명령을 사용하여 압축을 푼 디렉토리를 Nginx 웹 루트 디렉토리로 이동합니다.

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

다음으로 디렉터리를 Nginx 웹 루트로 변경하고 샘플 구성 파일을 복사합니다.

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

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

Kanban용 Nginx 구성

다음으로 Kanban을 호스팅하기 위해 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에서 활성화되어 있습니다. 따라서 Kanban에 대한 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을 허용합니다.

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

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

칸반 대시보드에 액세스

이제 웹 브라우저를 열고 URL http://kanban.example.com을 사용하여 칸반 대시보드에 액세스하십시오. 당신은 될 것입니다

Kanban 관리자 로그인 페이지로 리디렉션됨:

기본 사용자 이름과 비밀번호를 admin/admin으로 입력하고 로그인 버튼을 클릭합니다. 다음 페이지에 Kanban 대시보드가 표시되어야 합니다.

Lets Encrypt SSL로 Kanban 보호

다음으로 Lets Chat 도메인용 Lets Encrypt SSL을 다운로드하고 설치하려면 시스템에 Certbot 유틸리티를 설치해야 합니다.

다음 명령을 사용하여 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): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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을 사용하여 Kanban에 안전하게 액세스할 수 있습니다.

결론

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