Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configure uWSGI as service
# Create 'uwsgi' user: unprivileged user
useradd -s /bin/false -r uwsgi
# Emperor mode
## create a directory for the vassals
- mkdir -p /etc/uwsgi/vassals
## Configuring uWSGI to run with a .ini file
vi /var/www/cioenglish/cioenglish_uwsgi.ini
### Put below content in cioenglish_uwsgi.ini
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /var/www/cioenglish
# Django's wsgi file
module =cioenglish.wsgi
# the virtualenv (full path)
home = /var/www/p3venv
# Logs
logdate = True
logto = /var/log/uwsgi/access.log
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 5
# the socket (use the full path to be safe)
socket = /run/uwsgi/cioenglish.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
# clear environment on exit
vacuum = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment