웹사이트 검색

Ubuntu 22.04에 Focalboard를 설치하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • Ubuntu 22.04(Jammy Jellyfish)
  • Ubuntu 20.04(Focal Fossa)

이 페이지에서

  1. 전제 조건
  2. PostgreSQL 설치 및 구성
  3. Focalboard 설치 및 구성
  4. Focalboard용 Systemd 서비스 파일 만들기
  5. Nginx를 역방향 프록시로 구성\n
  6. Focalboard 웹 인터페이스 액세스
  7. Focalboard에서 SSL 사용
  8. 결론

Focalboard는 오픈 소스 및 자체 호스팅 프로젝트 관리 도구입니다. 다국어이며 Asana, Trello 및 Notion의 대안으로 개발자가 팀 전체에서 작업을 추적하고 관리하는 데 사용할 수 있습니다. Kanban을 기반으로 하며 데스크톱 및 서버에서 사용할 수 있습니다. 테스트 및 개발을 위한 독립 실행형 개인 서버로 사용할 수 있습니다. Focalboard는 개발자가 작업을 완료하고, 이정표에 도달하고, 목표를 달성할 수 있도록 도와줍니다.

이 게시물에서는 Ubuntu 22.04에서 Nginx를 리버스 프록시로 사용하여 Focalboard를 설치하는 방법을 보여줍니다.

전제 조건

  • Ubuntu 22.04를 실행하는 서버.\n
  • 서버 IP를 가리키는 유효한 도메인 이름입니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

PostgreSQL 설치 및 구성

Focalboard는 PostgreSQL을 사용하여 데이터를 저장합니다. 따라서 PostgreSQL 데이터베이스 서버가 시스템에 설치되어 있어야 합니다.

설치되지 않은 경우 다음 명령을 사용하여 다른 패키지와 함께 설치할 수 있습니다.

apt-get install curl wget gnupg2 -y
apt-get install postgresql postgresql-contrib -y

PostgreSQL을 설치한 후 다음 명령을 사용하여 PostgreSQL에 연결합니다.

su - postgres
psql

다음으로 다음 명령을 사용하여 PostgreSQL용 데이터베이스 및 사용자를 생성합니다.

CREATE DATABASE focaldb;
CREATE USER focaluser WITH PASSWORD 'password';

그런 다음 다음 명령을 사용하여 PostgreSQL 셸을 종료합니다.

\q
exit

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

Focalboard 설치 및 구성

먼저 Focalboard Git Hub 다운로드 페이지를 방문하고 다음 명령을 사용하여 최신 버전의 Focalboard를 다운로드합니다.

VER=$(curl -s https://api.github.com/repos/mattermost/focalboard/releases/latest|grep tag_name | cut -d '"' -f 4)
wget https://github.com/mattermost/focalboard/releases/download/${VER}/focalboard-server-linux-amd64.tar.gz

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

tar -xvzf focalboard-server-linux-amd64.tar.gz

다음으로, 다음 명령을 사용하여 초점판을 /opt 디렉토리로 이동하십시오.

mv focalboard /opt

다음으로 Focalboard 구성 파일을 편집합니다.

nano /opt/focalboard/config.json

아래와 같이 데이터베이스와 일치하는 다음 행을 변경하십시오.

"dbtype": "postgres",
"dbconfig": "postgres://focaluser:/focaldb?sslmode=disable&connect_timeout=10",

완료되면 파일을 저장하고 닫습니다.

Focalboard용 Systemd 서비스 파일 생성

systemd로 Focalboard를 시작하고 관리하는 것이 좋습니다. 이렇게 하려면 Focalboard용 시스템 서비스 파일을 만들어야 합니다.

nano /lib/systemd/system/focalboard.service

다음 줄을 추가합니다.

[Unit]
Description=Focalboard server

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/opt/focalboard/bin/focalboard-server
WorkingDirectory=/opt/focalboard

[Install]
WantedBy=multi-user.target

파일을 저장하고 닫은 다음 systemd 데몬을 다시 로드하여 변경 사항을 적용합니다.

systemctl daemon-reload

다음으로 다음 명령을 사용하여 Focalboard 서비스를 시작하고 활성화합니다.

systemctl start focalboard
systemctl enable focalboard

이제 다음 명령을 사용하여 Focalboard의 상태를 확인할 수 있습니다.

systemctl status focalboard

다음과 같은 결과가 표시됩니다.

? focalboard.service - Focalboard server
     Loaded: loaded (/lib/systemd/system/focalboard.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-21 11:22:22 UTC; 8s ago
   Main PID: 4347 (focalboard-serv)
      Tasks: 4 (limit: 2242)
     Memory: 18.1M
        CPU: 1.977s
     CGroup: /system.slice/focalboard.service
             ??4347 /opt/focalboard/bin/focalboard-server

Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.507 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.507 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for workspaceID              caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:24.928 Z] import archive - done                    caller="app/im>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.937 Z] initialized workspace                    caller="app/wo>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.941 Z] Server.Start                             caller="server>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.941 Z] http server started                      caller="web/we>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.947 Z] Starting unix socket server              caller="server>

이 시점에서 Focalboard가 시작되고 포트 8000에서 수신 대기합니다. 다음 명령을 사용하여 수신 포트를 확인할 수 있습니다.

ss -antpl | grep focalboard

다음과 같은 결과가 표시됩니다.

LISTEN 0      4096               *:8000            *:*    users:(("focalboard-serv",pid=4347,fd=9))
LISTEN 0      4096               *:9092            *:*    users:(("focalboard-serv",pid=4347,fd=8))

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

Nginx를 역방향 프록시로 구성

다음으로 Nginx를 역방향 프록시로 설치 및 구성하여 포트 80을 통해 Focalboard에 액세스하는 것이 좋습니다. 먼저 다음 명령을 사용하여 Nginx 서버를 설치합니다.

apt-get install nginx -y

Nginx 서버가 설치되면 Nginx 가상 호스트 구성 파일을 만듭니다.

nano /etc/nginx/conf.d/focalboard.conf

다음 줄을 추가합니다.

upstream focalboard {
   server localhost:8000;
   keepalive 32;
}

server {
   listen 80;

   server_name focalboard.example.com;

   location ~ /ws/* {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 1d;
       proxy_send_timeout 1d;
       proxy_read_timeout 1d;
       proxy_pass http://focalboard;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header Connection "";
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://focalboard;
   }
}

완료되면 파일을 저장하고 닫은 후 다음 명령을 사용하여 구문 구성 오류가 있는지 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 상태를 확인할 수도 있습니다.

systemctl status nginx

다음 출력이 표시되어야 합니다.

? nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-21 11:24:08 UTC; 7s ago
       Docs: man:nginx(8)
    Process: 5017 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 5018 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 5019 (nginx)
      Tasks: 2 (limit: 2242)
     Memory: 2.6M
        CPU: 35ms
     CGroup: /system.slice/nginx.service
             ??5019 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             ??5020 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

Aug 21 11:24:08 ubuntu2204 systemd[1]: Starting A high performance web server and a reverse proxy server...
Aug 21 11:24:08 ubuntu2204 systemd[1]: Started A high performance web server and a reverse proxy server.

Focalboard 웹 인터페이스에 액세스

이제 웹 브라우저를 열고 URL http://focalboard.example.com/login을 입력하여 Focalboard에 액세스하십시오. Focalboard 로그인 페이지로 리디렉션됩니다.

계정 만들기 버튼을 클릭합니다. Focalboard 계정 생성 페이지가 표시됩니다.

이메일 주소, 관리자 사용자 이름, 비밀번호를 제공하고 등록 버튼을 클릭합니다. 다음 페이지에 Focalboard 대시보드가 표시되어야 합니다.

Focalboard에서 SSL 활성화

보안상의 이유로 Lets Encrypt SSL로 Focalboard를 보호하는 것이 좋습니다. 다음으로 Lets Encrypt SSL을 설치하고 관리하려면 Certbot 클라이언트 패키지를 설치해야 합니다.

먼저 다음 명령을 사용하여 Certbot을 설치합니다.

apt-get install python3-certbot-nginx -y

설치가 완료되면 다음 명령을 실행하여 웹사이트에 Lets Encrypt SSL을 설치합니다.

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

다음으로 아래와 같이 HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택합니다.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/focalboard.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/focalboard.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/focalboard.example.com/privkey.pem
   Your cert will expire on 2022-11-21. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

결론

축하합니다! Ubuntu 22.04에서 Nginx와 함께 Focalboard를 리버스 프록시로 성공적으로 설치했습니다. 이제 조직에 Focalboard를 배포하고 웹 브라우저에서 쉽게 프로젝트를 관리하고 추적할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.