Created
June 24, 2015 17:01
-
-
Save soncco/c1acf43eaa26b2971e5e to your computer and use it in GitHub Desktop.
uwsgi and django
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
sudo apt-get install uwsgi uwsgi-plugin-python | |
cd /etc/uwsgi/apps-available | |
sudo vim site.ini | |
# View site.ini | |
cd .. | |
cd apps-enabled | |
ln -s ../apps-available/site.ini | |
sudo service uwsgi restart | |
cd /etc/nginx/sites-available | |
sudo vim site.conf | |
# View site.conf | |
cd .. | |
cd sites-enabled | |
sudo ln -s ../sites-available/site.conf | |
sudo service nginx restart |
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
server { | |
listen 80; | |
server_name site.com; | |
root /home/user/public/site/app/; | |
access_log /home/user/public/site/logs/nginx-access.log; | |
error_log /home/user/public/site/logs/nginx-error.log; | |
location /static/ { | |
alias /home/user/public/site/static/; | |
} | |
location / { | |
uwsgi_pass unix:///var/run/uwsgi/app/site/socket; | |
include uwsgi_params; | |
} | |
} |
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
[uwsgi] | |
uid=user | |
gid=www-data | |
virtualenv=/home/user/public/site/ | |
chdir=/home/user/public/site/app/ | |
module=site.wsgi:application | |
autoload=true | |
vhost=true | |
master=true | |
workers=2 ; Number of processors | |
max-request=5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment