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

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

In this tutorial, we will be learning how to install Taiga project management system on an Alibaba Cloud ECS with Ubuntu 16.04.

By Hitesh Jethva, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Taiga is a free and open-source project management system for agile developers & designers and project managers who want a beautiful tool that makes work truly enjoyable. Taiga is a very powerful, easy to use and entirely customizable application that can handle both simple and complex projects for startups, software developers. Taiga backend is written in Python and Django that provides an API. The frontend is written in JavaScript using CoffeeScript and AngularJS frameworks.

In this tutorial, we will learn how to install Taiga project management system on an Alibaba Cloud Elastic Compute Service (ECS) instance with 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.

Once you are logged into your Ubuntu 16.04 instance, run the following command to update your base system with the latest available packages.

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

Taiga runs on the web server. So you will need to install Nginx web server to your system. You can install it using the following command:

apt-get install nginx -y

Once Nginx is installed, start Nginx service and enable it to start on boot using the following command:

systemctl start nginx
systemctl enable nginx

Nodejs is also required by Taiga-events. You can install the Nodejs using the following command:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install nodejs pwgen npm -y

Taiga backend is written in Python and Django Framework that uses Python 3.5. So you will need to install Python 3.5 to your system. You can install it using the following command:

apt-get install python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper libxml2-dev libxslt-dev -y

Next, you will need to install circus for managing the Taiga-events process created with CoffeeScript. You can install it using the following command:

apt-get install circus -y

Once circus is installed, start circusd service and enable it to start on boot using the following command:

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 -

Next, update the repository and install PostgreSQL using the following command:

apt-get update -y
apt-get install postgresql -y

Next, start PostgreSQL service and enable it to start on boot using the following command:

systemctl start postgresql
systemctl enable postgresql

Next, log in to PostgreSQL user and create a database and user for Taiga:

su - postgres
createuser taiga
psql
ALTER USER taiga WITH ENCRYPTED password 'password';
CREATE DATABASE taiga OWNER taiga;

Exit from the PostgreSQL shell:

q

Install RabbitMQ

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

First, install Erlang libraries with the following command:

apt-get install erlang -y

Next, add the RabbitMQ repository and Import the RabbitMQ GPG signing key using the following command:

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 -

Next, update the repository and install RabbitMQ using the following command:

apt-get update -y
apt-get install rabbitmq-server -y

Next, start RabbitMQ service and enable it to start on boot using the following command:

systemctl start rabbitmq-server
systemctl enable rabbitmq-server

Next, you will need to create a new user and virtual host named "taiga" for RabbitMQ:

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.

First, create a new Taiga user and set the password with the following command:

adduser taiga

Next, log in to taiga user and create a new directory to store the log files.

su - taiga
mkdir -p ~/logs

Next, clone the Taiga backend repository from GitHub and check out the latest stable branch.

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

You should see the following output:

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

Output:

Branch stable set up to track remote branch stable from origin.
Switched to a new branch 'stable'

Next, create new python environment taiga using the virtualenv.

mkvirtualenv -p /usr/bin/python3 taiga

Next, log in to the new taiga virtual environment and install all python modules using the following command:

workon taiga
pip3 install --upgrade setuptools
pip3 install -r requirements.txt

Once all the required modules are installed, populate the database with necessary initial data using the following command:

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

The above command will create an administrator account 'admin' with password '123123'.

Next, you will need to create the configuration file for the Taiga backend. First, generate a random string of 64 characters with the following command:

pwgen -s -1 64

You should see the following output:

DYnT63VmANLGw8YN0IJcRXjz7DPWoXTArpaPDojFeSDcWTooVaD4Bmx9Ej8bvicz

Next, create a new configuration file for the Taiga Backend:

nano ~/taiga-back/settings/local.py

Add the following lines:

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

Save and close the file, then test 'taiga-back' with the following command:

workon taiga
python manage.py runserver

You should see the following output:

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.

Now, Open your web browser and type the URL http://192.168.0.103:8000/api/v1/

You should see the 'taiga-back' API with JSON format in the following image:

2

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

Next, create a new configuration file for the Taiga frontend using the following command:

nano ~/taiga-front-dist/dist/conf.json

Add the following lines:

{
    "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
}

Save and close the file when you are finished.

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.

First, log in to Taiga user and clone the Taiga events repository from Github:

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

Next, install all the dependencies needed by 'taiga-events' using npm and then install the 'coffee-script' package to the server:

npm install
npm install -g coffee-script

Next, create a new configuration file for Taiga events using the following command:

nano ~/taiga-events/config.json

Add the following lines:

{
    "url": "amqp://taiga:password@localhost:5672/taiga",
    "secret": "DYnT63VmANLGw8YN0IJcRXjz7DPWoXTArpaPDojFeSDcWTooVaD4Bmx9Ej8bvicz",
    "webSocketServer": {
        "port": 8888
    }
}

Save and close the file when you are finished.

Configure Circus

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

First, create a new Circus configuration file for running the Taiga backend.

nano /etc/circus/conf.d/taiga.ini

Add the following lines:

[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

Save and close the file, then create a new file for taiga events:

nano /etc/circus/conf.d/taiga-events.ini

Add the following lines:

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

Save the file, when you are finished.

Next, create a new logs directory for both 'taiga-events' and 'taiga-back' processes, then restart circusd service using the following command:

su - taiga
mkdir -p ~/logs
exit
systemctl restart circusd

You can now check the status of circusd using the following command:

circusctl status

You should see the following output:

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

Add the following lines:

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

Save and close the file, then enable virtual host using the following command:

ln -s /etc/nginx/sites-available/taiga /etc/nginx/sites-enabled/

Finally, restart Nginx service with the following command:

systemctl restart nginx

Thats it! Now you can access the Taiga installation by visiting the URL http://example.com.

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.

ApsaraDB for Memcache is compatible with open-source Memcached binary (SASL) protocol. In addition, it supports fully encrypted SSL connections and ensures restricted access to the server to prevent various network attacks.

0 1 0
Share on

Alibaba Clouder

2,605 posts | 747 followers

You may also like

Comments