Last active
November 3, 2019 06:22
-
-
Save hiendnguyen/cea79000156ada8c7e8cf9825433a9ff to your computer and use it in GitHub Desktop.
Configure uWSGI as service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/example/djangodemo/djangodemo_uwsgi.ini | |
### Put below content in djangodemo_uwsgi.ini | |
[uwsgi] | |
# Django-related settings | |
# the base directory (full path) | |
chdir = /var/www/example/djangodemo/ | |
# Django's wsgi file | |
module =djangodemo.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/django.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