Install Taiga Ubuntu 16.04 Xenial Xerus Linux

First, spin up a new VM running Ubuntu 16.04 Xenial Xerus Linux: https://www.datasec.io/headless-virtualbox/

#Prerequisites:

sudo apt-get update
sudo apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-dev
sudo apt-get install -y libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev
sudo apt-get install -y automake libtool libffi-dev curl git tmux gettext
sudo apt-get install -y nginx
sudo apt-get install -y rabbitmq-server redis-server
sudo apt-get install -y circus
sudo apt-get install -y postgresql-9.5 postgresql-contrib-9.5
sudo apt-get install -y postgresql-doc-9.5 postgresql-server-dev-9.5
sudo apt-get install -y python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper
sudo apt-get install -y libxml2-dev libxslt-dev

*restart bash for virtualenv to work

sudo adduser taiga
sudo adduser taiga sudo
sudo su taiga
cd ~

sudo -u postgres createuser taiga
sudo -u postgres createdb taiga -O taiga

sudo rabbitmqctl add_user taiga PASSWORD_FOR_EVENTS
sudo rabbitmqctl add_vhost taiga
sudo rabbitmqctl set_permissions -p taiga taiga “.*” “.*” “.*”

mkdir -p ~/logs

#Backend:

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

mkvirtualenv -p /usr/bin/python3.5 taiga

pip install -r requirements.txt

python manage.py migrate –noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py compilemessages
python manage.py collectstatic –noinput

#if you want demo data…:
#python manage.py sample_data

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

#######################

from .common import *

MEDIA_URL = “http://taiga1.datasec.io/media/”
STATIC_URL = “http://taiga1.datasec.io/static/”
SITES[“front”][“scheme”] = “http”
SITES[“front”][“domain”] = “taiga1.datasec.io”

SECRET_KEY = “theveryultratopsecretkey123”

DEBUG = False
PUBLIC_REGISTER_ENABLED = False

DEFAULT_FROM_EMAIL = “colin@datasec.io”
SERVER_EMAIL = DEFAULT_FROM_EMAIL

#CELERY_ENABLED = True

EVENTS_PUSH_BACKEND = “taiga.events.backends.rabbitmq.EventsPushBackend”
EVENTS_PUSH_BACKEND_OPTIONS = {“url”: “amqp://taiga:PASSWORD_FOR_EVENTS@localhost: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”

#######################

workon taiga
python manage.py runserver

#to test (should return some json):
#curl http://localhost:8000/api/v1/

#ctrl+c to kill it… we run it with circus below…

#Frontend:

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

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

{
“api”: “http://taiga1.datasec.io/api/v1/”,
“eventsUrl”: “ws://taiga.datasec.io/events”,
“debug”: “true”,
“publicRegisterEnabled”: true,
“feedbackEnabled”: true,
“privacyPolicyUrl”: null,
“termsOfServiceUrl”: null,
“maxUploadFileSize”: null,
“contribPlugins”: []
}

#Events

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

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

npm install
sudo npm install -g coffee-script

cp config.example.json config.json

#######################

{
“url”: “amqp://taiga:PASSWORD_FOR_EVENTS@localhost:5672/taiga”,
“secret”: “theveryultratopsecretkey123”,
“webSocketServer”: {
“port”: 8888
}
}

#######################

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

#######################

[watcher:taiga-events]
working_dir = /home/taiga/taiga-events
cmd = /usr/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

#######################

sudo service circusd restart
sudo service circusd status

## The rest.. Running it, etc…

#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

#######################

sudo service circusd restart
circusctl status

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

#sudo nano /etc/nginx/conf.d/taiga.conf

#######################

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

sudo nginx -t
sudo service nginx restart

#####################################################################

At this point, you should be able to login with admin // 123123 — I wasn’t.

A little troubleshooting showed me gunicorn wasn’t listening (circusd didn’t start it…):

you can trouble shoot basic listening issues with telnet and netstat and ps:

\># netstat -an | grep 8001
\># telnet 127.0.0.1 8001
\># ps aux | grep gunicorn

… I had a typo in /etc/circus/conf.d/taiga.conf …

fixed it and was able to login as admin // 123123

#Full guide here: http://taigaio.github.io/taiga-doc/dist/setup-production.html

Leave a Reply

Your email address will not be published. Required fields are marked *