How to Install and Configure Taiga Project Management Tool on Ubuntu 16.04

Prerequisites

  • A fresh Alibaba Cloud ECS instance with Ubuntu 16.04 server installed.
  • A static IP address 192.168.0.103 is configured on the instance
  • A Root password is setup on the instance.

Launch Alibaba Cloud ECS Instance

First, log in to your https://ecs.console.aliyun.com">Alibaba Cloud ECS Console. Create a new ECS instance, choosing Ubuntu 16.04 as the operating system with at least 2GB RAM. Connect to your ECS instance and log in as the root user.

apt-get update -y

Install Required Dependencies

Before starting, you will need to install some dependencies required to compile python modules. You can install all of them using the following command:

apt-get install build-essential binutils-doc autoconf flex bison libjpeg-dev libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev automake libtool libffi-dev curl git tmux gettext -y
apt-get install nginx -y
systemctl start nginx
systemctl enable nginx
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install nodejs pwgen npm -y
apt-get install python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper libxml2-dev libxslt-dev -y
apt-get install circus -y
systemctl start circusd
systemctl enable circusd

Install and Configure PostgreSQL Database

Taiga uses PostgreSQL to store its database. By default, PostgreSQL is not available in Ubuntu 16.04 default repository. So you will need to add the PostgreSQL repository into the system. You can do this using the following command:

echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update -y
apt-get install postgresql -y
systemctl start postgresql
systemctl enable postgresql
su - postgres
createuser taiga
psql
ALTER USER taiga WITH ENCRYPTED password 'password';
CREATE DATABASE taiga OWNER taiga;
q

Install RabbitMQ

Taiga uses RabbitMQ to process the message queue. So you will need to install RabbitMQ to your server.

apt-get install erlang -y
echo 'deb http://www.rabbitmq.com/debian/ stable main' | tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add -
apt-get update -y
apt-get install rabbitmq-server -y
systemctl start rabbitmq-server
systemctl enable rabbitmq-server
rabbitmqctl add_user taiga password
rabbitmqctl add_vhost taiga
rabbitmqctl set_permissions -p taiga taiga "." "." ".*"

Configure Taiga Backend

Taiga-back is a backend of Taiga written in Python and Django Web Framework that provides an API.

adduser taiga
su - taiga
mkdir -p ~/logs
git clone https://github.com/taigaio/taiga-back.git taiga-back
Cloning into 'taiga-back'...
remote: Counting objects: 32790, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 32790 (delta 3), reused 13 (delta 3), pack-reused 32772
Receiving objects: 100% (32790/32790), 15.99 MiB | 393.00 KiB/s, done.
Resolving deltas: 100% (22346/22346), done.
Checking connectivity... done.
cd taiga-back
checkout stable
Branch stable set up to track remote branch stable from origin.
Switched to a new branch 'stable'
workon taiga
pip3 install --upgrade setuptools
pip3 install -r requirements.txt
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
pwgen -s -1 64
DYnT63VmANLGw8YN0IJcRXjz7DPWoXTArpaPDojFeSDcWTooVaD4Bmx9Ej8bvicz
nano ~/taiga-back/settings/local.py
from .common import *MEDIA_URL = "https://example.com/media/"
STATIC_URL = "https://example.com/static/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "example.com"
SECRET_KEY = "DYnT63VmANLGw8YN0IJcRXjz7DPWoXTArpaPDojFeSDcWTooVaD4Bmx9Ej8bvicz"
DEBUG = False
PUBLIC_REGISTER_ENABLED = True
DEFAULT_FROM_EMAIL = "mail@example.com"
SERVER_EMAIL = DEFAULT_FROM_EMAIL
EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:password@localhost:5672/taiga"}
workon taiga
python manage.py runserver
Trying import local.py settings...
Trying import local.py settings...
Performing system checks...
System check identified no issues (0 silenced).
May 17, 2018 - 14:37:22
Django version 1.11.2, using settings 'settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Configure Taiga Frontend

First, log in to taiga user and clone the Taiga frontend repository from Github and checkout the latest stable branch.

su - taiga
git clone https://github.com/taigaio/taiga-front-dist.git taiga-front-dist
cd taiga-front-dist
git checkout stable
nano ~/taiga-front-dist/dist/conf.json
{
"api": "https://example.com/api/v1/",
"eventsUrl": "wss://example.com/events",
"eventsMaxMissedHeartbeats": 5,
"eventsHeartbeatIntervalTime": 60000,
"eventsReconnectTryInterval": 10000,
"debug": true,
"debugInfo": false,
"defaultLanguage": "en",
"themes": ["taiga"],
"defaultTheme": "taiga",
"publicRegisterEnabled": true,
"feedbackEnabled": true,
"privacyPolicyUrl": null,
"termsOfServiceUrl": null,
"maxUploadFileSize": null,
"contribPlugins": [],
"tribeHost": null,
"importers": [],
"gravatar": true
}

Configure Taiga Events

You will also need to configure Taiga Events to your server. Taiga events is a web socket server that enables the Taiga frontend to show real-time changes in modules.

su - taiga
git clone https://github.com/taigaio/taiga-events.git taiga-events
cd taiga-events
npm install
npm install -g coffee-script
nano ~/taiga-events/config.json
{
"url": "amqp://taiga:password@localhost:5672/taiga",
"secret": "DYnT63VmANLGw8YN0IJcRXjz7DPWoXTArpaPDojFeSDcWTooVaD4Bmx9Ej8bvicz",
"webSocketServer": {
"port": 8888
}
}

Configure Circus

Circus is a process manager for Python applications that can be used for controlling and managing ‘taiga-back’ and ‘taiga-events’ process.

nano /etc/circus/conf.d/taiga.ini
[watcher:taiga]
working_dir = /home/taiga/taiga-back
cmd = gunicorn
args = -w 3 -t 60 --pythonpath=. -b 127.0.0.1:8001 taiga.wsgi
uid = taiga
numprocesses = 1
autostart = true
send_hup = true
stdout_stream.class = FileStream
stdout_stream.filename = /home/taiga/logs/gunicorn.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 4
stderr_stream.class = FileStream
stderr_stream.filename = /home/taiga/logs/gunicorn.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 4
[env:taiga]
PATH = /home/taiga/.virtualenvs/taiga/bin:$PATH
TERM=rxvt-256color
SHELL=/bin/bash
USER=taiga
LANG=en_US.UTF-8
HOME=/home/taiga
PYTHONPATH=/home/taiga/.virtualenvs/taiga/lib/python3.5/site-packages
nano /etc/circus/conf.d/taiga-events.ini
working_dir = /home/taiga/taiga-events
cmd = /usr/local/bin/coffee
args = index.coffee
uid = taiga
numprocesses = 1
autostart = true
send_hup = true
stdout_stream.class = FileStream
stdout_stream.filename = /home/taiga/logs/taigaevents.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 12
stderr_stream.class = FileStream
stderr_stream.filename = /home/taiga/logs/taigaevents.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 12
su - taiga
mkdir -p ~/logs
exit
systemctl restart circusd
circusctl status
circusd-stats: active
plugin:flapping: active
taiga: active
taiga-events: active

Configure Nginx for Taiga

Next, create a new Nginx virtual host directive for Taiga.

nano /etc/nginx/sites-available/taiga
server {
listen 80 default_server;
server_name _;

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

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

# Taiga-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;
}
}
ln -s /etc/nginx/sites-available/taiga /etc/nginx/sites-enabled/
systemctl restart nginx

Related Alibaba Cloud Products

ApsaraDB for Memcache is a managed memory based caching service, which supports high-speed access to queries and data. ApsaraDB for Memcache improves the response of dynamic websites or applications by relieving the load on the backend database as cache data is stored in-memory. By giving your applications quick access to data and significantly reducing latency, ApsaraDB for Memcache allows you to easily get your applications up and running. This in turn frees you up from managing server lists, nodes, clusters, updates and patches.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com