在Ubuntu 20.04上安装Taiga Project Management Platform

您可以通过以下链接以PDF格式下载本文来支持我们。以PDF格式下载指南关闭关闭关闭

今天的文章描述了设置在Ubuntu 20.04上运行的Taiga项目管理平台所需采取的所有步骤。 Taiga是一个开源项目管理Web应用程序,具有为小型和大型团队设计的Scrum。

Taiga.io基于Python,Django,AngularJS和CoffeeScript构建。使用此项目管理工具,您可以管理项目并更轻松,更有效地管理协作,时间跟踪,错误跟踪,看板,Wiki,报告,积压。

Taiga平台由三个主要模块组成,每个模块在编译时和运行时都具有自己的依赖性。

  • 大雅回 –这是一个后端/ API模块
  • taiga-front-dist –一个为用户提供门户的前端模块。
  • 大雅活动 – WebSocket网关。这是可选的,可以安装或跳过。

本教程假定您正在使用新安装的Ubuntu 20.04服务器。确保所有软件包都已更新为最新版本。

sudo apt update
sudo apt upgrade -y

在继续下一个安装过程之前,请重新启动系统。

sudo reboot

步骤1:设置服务器主机名和DNS

让我们从设置正确的服务器主机名开始:

sudo hostnamectl set-hostname taiga.hirebestengineers.com --static

检查主机名设置。

$ hostnamectl
   Static hostname: taiga.hirebestengineers.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: be43a41780154ad0b9148af9afe95a4e
           Boot ID: 94c4e0892cf54c6baea75be6ff7387ba
    Virtualization: kvm
  Operating System: Ubuntu 20.04.1 LTS
            Kernel: Linux 5.4.0-48-generic
      Architecture: x86-64

将正确的IP地址和FQDN添加到 主办 / etc目录中的文件。

135.181.102.168 taiga.hirebestengineers.com

验证:

$ host taiga.hirebestengineers.com
taiga.hirebestengineers.com has address 135.181.102.168

还将A记录添加到DNS服务器。

检查是否可以从本地计算机查询记录。

$ dig A  taiga.hirebestengineers.com +short
135.181.102.168

步骤2:安装依赖项程序包

下一步是安装运行Taiga项目管理平台所需的所有依赖包。

安装git,Python3和其他软件包。

sudo apt update
sudo apt -y install git pwgen automake wget curl gettext build-essential libgdbm-dev  binutils-doc autoconf flex gunicorn bison libjpeg-dev libzmq3-dev libfreetype6-dev zlib1g-dev libncurses5-dev libtool libxslt-dev libxml2-dev libffi-dev python3 virtualenvwrapper python3-dev python3-pip python3-dev libssl-dev tmux

安装Nginx Web服务器。

sudo apt -y install nginx

安装Redis和Rabbit MQ。

sudo apt -y install rabbitmq-server redis-server

安装RabbitMQ服务器后,创建Taiga用户和虚拟主机。

$ sudo rabbitmqctl add_user taiga StrongPassword
Adding user "taiga" ...

$ sudo rabbitmqctl add_vhost taiga
Adding vhost "taiga" ...

$ sudo rabbitmqctl set_permissions -p taiga taiga ".*" ".*" ".*"
Setting permissions for user "taiga" in vhost "taiga" ...

安装Node.js

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt -y install nodejs

步骤3:安装和配置PostgreSQL

Taiga.io需要PostgreSQL数据库服务器。安装和配置如下:

导入存储库签名密钥。

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

添加一个PostgreSQL apt仓库。

echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list

更新并安装软件包列表 postgresql

sudo apt update
sudo apt install postgresql -y

使用以下命令设置PostgreSQL管理员用户的密码:

$ sudo passwd postgres
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

创建一个Taiga.io数据库和用户

$ sudo su - postgres
[email protected]:~$ createuser taiga 
[email protected]:~$ psql 
psql (12.4 (Ubuntu 12.4-1.pgdg20.04+1))
Type "help" for help.

postgres=# ALTER USER taiga WITH ENCRYPTED password 'StrongPassword';
postgres=# CREATE DATABASE taiga OWNER taiga;
postgres=# q
[email protected]:~$ exit

交换:

  • 大河 使用Taiga.io数据库用户名
  • 强密码 为taiga用户使用强健的数据库密码。

步骤4:安装和配置Taiga后端

创建一个taiga用户。

$ sudo adduser taiga
Adding user `taiga' ...
Adding new group `taiga' (1000) ...
Adding new user `taiga' (1000) with group `taiga' ...
Creating home directory `/home/taiga' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for taiga
Enter the new value, or press ENTER for the default
	Full Name []:
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n] y

$ sudo adduser taiga sudo
Adding user `taiga' to group `sudo' ...
Adding user taiga to group sudo
Done.

切换到Taiga用户帐户并创建日志文件夹

$ su - taiga
$ mkdir -p ~/logs
$ ls
logs

Github Clone Taiga后端项目

git clone https://github.com/taigaio/taiga-back.git
cd taiga-back
git checkout stable

创建一个Virtualenv

然后为Taiga.io后端创建Virtualenv并安装所需的依赖项

mkvirtualenv -p /usr/bin/python3 taiga_venv
pip3 install -r requirements.txt

如果显示错误消息“mkvirtualenv:找不到命令请参考以下指南进行修复。

修复了在Ubuntu上找不到的mkvirtualenv命令

在数据库中输入初始基本数据

python3 manage.py migrate --noinput
python3 manage.py loaddata initial_user
python3 manage.py loaddata initial_project_templates
python3 manage.py compilemessages
python3 manage.py collectstatic --noinput

运行以上命令会将数据导入PostgreSQL数据库。这还将创建一个具有以下登录凭据的管理员帐户: admin 带密码 123123

如果您需要样本数据 python3 manage.py sample_data..这是为了 仅用于演示目的,以后可能很难清理数据。

创建配置

将以下设置复制到 ~/taiga-back/settings/local.py

$ vim ~/taiga-back/settings/local.py

复制并更新以下内容。

from .common import *

MEDIA_URL = "http://taiga.hirebestengineers.com/media/"
STATIC_URL = "http://taiga.hirebestengineers.com/static/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "taiga.hirebestengineers.com"

SECRET_KEY = "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND"

DEBUG = False
PUBLIC_REGISTER_ENABLED = True

DEFAULT_FROM_EMAIL = "[email protected]"
SERVER_EMAIL = DEFAULT_FROM_EMAIL

#CELERY_ENABLED = True

EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:[email protected]:5672/taiga"}

# Uncomment and populate with proper connection parameters
# for enable email sending. EMAIL_HOST_USER should end by @domain.tld
#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
#EMAIL_USE_TLS = False
#EMAIL_HOST = "localhost"
#EMAIL_HOST_USER = ""
#EMAIL_HOST_PASSWORD = ""
#EMAIL_PORT = 25

# Uncomment and populate with proper connection parameters
# for enable github login/singin.
#GITHUB_API_CLIENT_ID = "yourgithubclientid"
#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"

根据您的环境更改设置,并进行如下设置。

  • Rabbit MQ连接用户名和密码
  • Taiga域名
  • 带私钥
  • 可选的邮件设置。

配置验证

为确保一切正常,请发出以下命令以开发模式运行后端进行测试。

workon taiga_venv
python manage.py runserver

成功的输出样本:

Trying import local.py settings...
Trying import local.py settings...
Performing system checks...

System check identified no issues (0 silenced).
September 30, 2020 - 20:29:24
Django version 2.2.16, using settings 'settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

打开另一个外壳,然后尝试卷曲。

curl http://127.0.0.1:8000/api/v1/

禁用Virtualenv并开始前端安装。

$ deactivate

步骤5:安装和配置Taiga前端

taiga-front主要是用angularjs和CoffeeScript编写的,并且取决于后端。在配置这些部分之前,您需要配置Taiga后端。

切换到 taiga用户帐号

su - taiga

从Github克隆项目源代码

git clone https://github.com/taigaio/taiga-front-dist.git
cd taiga-front-dist
git checkout stable

复制样本配置文件。

cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
vim ~/taiga-front-dist/dist/conf.json

根据以下模式编辑样本配置(替换为您自己的详细信息)。

{
    "api": "http://taiga.hirebestengineers.com/api/v1/",
    "eventsUrl": "ws://taiga.hirebestengineers.com/events",
    "eventsMaxMissedHeartbeats": 5,
    "eventsHeartbeatIntervalTime": 60000,
    "eventsReconnectTryInterval": 10000,
    "debug": true,
    "debugInfo": false,
    "defaultLanguage": "en",
    "themes": ["taiga"],
    "defaultTheme": "taiga",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "supportUrl": "https://tree.taiga.io/support",
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "GDPRUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": [],
    "tribeHost": null,
    "importers": [],
    "gravatar": true,
    "rtlLanguages": ["fa"]
}

必须替换 taiga.hirebestengineers.com 使用DNS名称。

步骤6:安装Taiga活动

Taiga-events是Taiga WebSocket服务器,它允许taiga-front在积压,任务板,宴会和问题列表中显示实时更改。 Taiga-events使用Rabbitmq作为其消息代理。

cd ~
git clone https://github.com/taigaio/taiga-events.git taiga-events
cd taiga-events

安装所需的JavaScript依赖项。

npm install

为Taiga事件创建配置文件。

cp config.example.json config.json

编辑配置文件,并设置rabbitmq URL和私钥。

$ vim config.json

{
    "url": "amqp://taiga:[email protected]:5672/taiga",
    "secret": "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND",
    "webSocketServer": {
        "port": 8888
    }
}

的秘密价值 config.json 必须与中的SECRET_KEY相同 〜/后退/设置/ local.py!!

将taiga事件添加到systemd配置。

sudo tee /etc/systemd/system/taiga_events.service<<EOF
[Unit]
Description=taiga_events
After=network.target

[Service]
User=taiga
WorkingDirectory=/home/taiga/taiga-events
ExecStart=/bin/bash -c "node_modules/coffeescript/bin/coffee index.coffee"
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
EOF

重新加载Systemd并启动服务。

sudo systemctl daemon-reload
sudo systemctl start taiga_events
sudo systemctl enable taiga_events

检查服务是否正在运行。

$ systemctl status taiga_events.service
● taiga_events.service - taiga_events
     Loaded: loaded (/etc/systemd/system/taiga_events.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-09-30 22:51:07 CEST; 3min 17s ago
   Main PID: 18269 (node)
      Tasks: 7 (limit: 4567)
     Memory: 18.8M
     CGroup: /system.slice/taiga_events.service
             └─18269 node node_modules/coffeescript/bin/coffee index.coffee

步骤7:启动taiga服务

创建一个新的taigasystemd文件。

sudo tee /etc/systemd/system/taiga.service<<EOF
[Unit]
Description=taiga_back
After=network.target

[Service]
User=taiga
Environment=PYTHONUNBUFFERED=true
WorkingDirectory=/home/taiga/taiga-back
ExecStart=/home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
EOF

重新加载systemd守护程序并启动taiga服务。

sudo systemctl daemon-reload
sudo systemctl start taiga
sudo systemctl enable taiga

通过运行以下命令检查服务是否正在运行:

$ sudo systemctl status taiga
● taiga.service - taiga_back
     Loaded: loaded (/etc/systemd/system/taiga.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-09-30 22:58:28 CEST; 7s ago
   Main PID: 19087 (gunicorn)
      Tasks: 5 (limit: 4567)
     Memory: 266.1M
     CGroup: /system.slice/taiga.service
             ├─19087 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 t>
             ├─19109 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 t>
             ├─19110 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 t>
             ├─19111 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 t>
             └─19112 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 t>

Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19087]: /usr/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binar>
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19087]:   return io.open(fd, *args, **kwargs)
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19109]: [2020-09-30 22:58:28 +0200] [19109] [INFO] Booting worker with pid: 19109
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19110]: [2020-09-30 22:58:28 +0200] [19110] [INFO] Booting worker with pid: 19110
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19109]: Trying import local.py settings...
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19110]: Trying import local.py settings...
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19111]: [2020-09-30 22:58:28 +0200] [19111] [INFO] Booting worker with pid: 19111
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19112]: [2020-09-30 22:58:28 +0200] [19112] [INFO] Booting worker with pid: 19112
Sep 30 22:58:28 taiga.hirebestengineers.com gunicorn[19111]: Trying import local.py settings...
Sep 30 22:58:29 taiga.hirebestengineers.com gunicorn[19112]: Trying import local.py settings...

步骤8:配置Nginx

taiga-front-dist和taiga-back都必须使用代理/静态文件Web服务器公开给外界。 Taiga为此使用了NGINX。

NGINX用作静态文件Web服务器,用于服务taiga-front-dist并将代理请求发送到taiga-back。首先删除默认的Nginx配置文件。

sudo rm /etc/nginx/sites-enabled/default

为Taiga创建NGINX虚拟主机。

sudo vim /etc/nginx/conf.d/taiga.conf

相应地修改配置文件。

server {
    listen 80 default_server;
    server_name _;  #  See http://nginx.org/en/docs/http/server_names.html

    large_client_header_buffers 4 32k;
    client_max_body_size 50M;
    charset utf-8;

    access_log /home/taiga/logs/nginx.access.log;
    error_log /home/taiga/logs/nginx.error.log;

    # Frontend
    location / {
        root /home/taiga/taiga-front-dist/dist/;
        try_files $uri $uri/ /index.html;
    }

    # Backend
    location /api {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001/api;
        proxy_redirect off;
    }

    # Admin access (/admin/)
    location /admin {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001$request_uri;
        proxy_redirect off;
    }

    # Static files
    location /static {
        alias /home/taiga/taiga-back/static;
    }

    # Media files
    location /media {
        alias /home/taiga/taiga-back/media;
    }

    # Events
    location /events {
        proxy_pass http://127.0.0.1:8888/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}

检查Nginx配置。

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

如果一切正常,请重新启动Nginx服务。

sudo systemctl restart 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 Wed 2020-09-30 23:21:51 CEST; 27s ago
       Docs: man:nginx(8)
    Process: 20262 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 20276 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 20277 (nginx)
      Tasks: 3 (limit: 4567)
     Memory: 3.5M
     CGroup: /system.slice/nginx.service
             ├─20277 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ├─20278 nginx: worker process
             └─20279 nginx: worker process

Sep 30 23:21:51 taiga.hirebestengineers.com systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 30 23:21:51 taiga.hirebestengineers.com systemd[1]: Started A high performance web server and a reverse proxy server.

步骤9:访问Taiga Web登录信息中心

打开您喜欢的Web浏览器,然后执行以下操作:

http://your_taiga_domain.com

显示登录屏幕。

在Ubuntu 20.04上安装Taiga Project Management Platform

使用以下默认凭据登录。

Username: admin
Password: 123123

然后将管理员密码更改为on 管理员>更改密码

在Ubuntu 20.04上安装Taiga Project Management Platform

如何禁用自注册

为了防止用户注册,请编辑〜/ taiga-back / settings / local.py文件,并将PUBLIC_REGISTER_ENABLED的值设置为false。

$ su - taiga
$ vim ~/taiga-back/settings/local.py
PUBLIC_REGISTER_ENABLED = False

更改Taiga前端设置。

$ vim ~/taiga-front-dist/dist/conf.json
"publicRegisterEnabled": false

更新配置后,重新启动所有Taiga服务。

sudo systemctl restart 'taiga*'

重新加载nginx:

sudo systemctl reload nginx

之前:

在Ubuntu 20.04上安装Taiga Project Management Platform

后:

在Ubuntu 20.04上安装Taiga Project Management Platform

享受Taiga项目管理平台随附的出色功能。

相关指南:

在CentOS 8上安装OpenProject Community Edition

如何在CentOS 8 / RHEL 8 Linux上安装Jira

在Ubuntu上安装Open Project

您可以通过以下链接以PDF格式下载本文来支持我们。以PDF格式下载指南关闭关闭关闭

Sidebar