-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample configuration files for production (issue #3)
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Sample nginx config file | ||
# file: /etc/nginx/conf.d/default.conf | ||
|
||
server { | ||
listen 80; | ||
server_name _; | ||
|
||
#charset koi8-r; | ||
|
||
#access_log logs/host.access.log main; | ||
|
||
location / { | ||
uwsgi_pass unix:///tmp/uwsgi.sock; | ||
include /etc/nginx/uwsgi_params; | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
location /media { | ||
internal; | ||
alias /www/UPEProgComp/media/; | ||
} | ||
|
||
location /static { | ||
alias /www/UPEProgComp/static/; | ||
} | ||
|
||
error_page 404 /404.html; | ||
location = /404.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
# redirect server error pages to the static page /50x.html | ||
# | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Sample uWSGI config file | ||
# file: /etc/init/uwsgi.conf | ||
description "uWSGI starter" | ||
|
||
start on (local-filesystems and runlevel [2345]) | ||
stop on runlevel [016] | ||
|
||
respawn | ||
|
||
# home - is the path to our virtualenv directory | ||
# pythonpath - the path to our django application | ||
# module - the wsgi handler python script | ||
|
||
exec /usr/bin/uwsgi \ | ||
--uid uwsgi \ | ||
--gid deployment \ | ||
--home /www/UPEProgComp \ | ||
--chdir /www/UPEProgComp/progcomp \ | ||
--pythonpath /www/UPEProgComp \ | ||
--env DJANGO_SETTINGS_MODULE=progcomp.settings \ | ||
--socket /tmp/uwsgi.sock \ | ||
--chmod-socket \ | ||
--module progcomp.wsgi \ | ||
--logdate \ | ||
--processes 2 \ | ||
--master \ | ||
--umask 002 \ | ||
--logto /var/log/uwsgi/uwsgi.log \ | ||
--log-reopen \ | ||
--log-truncate |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
import sys | ||
import site | ||
|
||
site.addsitedir('/usr/lib/python2.7/site-packages') | ||
|
||
sys.path.append('/www/UPEProgComp') | ||
|
||
os.environ['DJANGO_SETTINGS_MODULE'] = 'progcomp.settings' | ||
|
||
import django.core.handlers.wsgi | ||
application = django.core.handlers.wsgi.WSGIHandler() |