- python2, libpq-dev, python-dev, python-pip
- requirements.txt
- Run setup_env.sh to set up virtualenv
- pip install -U pip setuptools
The web applications are organised into blueprints:
- init.py - In the web folder, used to create the app from main.py
The main entry point (which creates the Flask app) is in main.py (subject to change).
source pyenv/bin/activate
sudo gunicorn --bind 0.0.0.0:8081 main:app
- Copy webui.super.conf to /etc/supervisord.conf
- Copy webui.nginx.conf to /etc/nginx/sites-available/webui
- sudo ln -s /etc/nginx/sites-available/webui /etc/nginx/sites-enabled
- sudo nginx -t # to check for errors
- sudo service nginx restart
sudo cp website/server_config/webui.super.conf /etc/supervisord.conf
sudo cp website/server_config/webui.nginx.conf /etc/nginx/sites-available/webui
sudo ln -s /etc/nginx/sites-available/webui /etc/nginx/sites-enabled
sudo nginx -t
sudo service nginx restarthttp://supervisord.org/introduction.html
- Ensure supervisor is installed
- Ensure supervisord.conf file is present at /etc/supervisord.conf
- Make logs directories
mkdir logs
touch logs/stdout.log
touch logs/stderr.log
Run as root: (su - root)
/home/website/pyenv/bin/supervisord
supervisorctl reload supervisorctl status all supervisorctl stop all supervisorctl start all