Skip to content

Instantly share code, notes, and snippets.

@bwells
Created September 7, 2011 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwells/1202034 to your computer and use it in GitHub Desktop.
Save bwells/1202034 to your computer and use it in GitHub Desktop.
webserver config
=== upstart config file ===
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
env BINPATH=/usr/bin/uwsgi
exec $BINPATH --emperor "/var/www/*/Application/emperor.ini" --binary-path $BINPATH
===========================
=== nginx config section ===
location /ERP/ {
uwsgi_pass unix:///tmp/uwsgi-erp.sock;
include uwsgi_params;
uwsgi_read_timeout 600;
}
============================
=== emperor.ini ============
[uwsgi]
master = true
lazy = true
processes = 1
buffer-size = 3200
pythonpath = /var/www/ERP/Application
virtualenv = /var/www/ERP/Environment/
daemonize = /var/log/uwsgi.log
pidfile2 = /var/run/uwsgi/erp.pid
socket = /tmp/uwsgi-erp.sock
chmod-socket = 660
vacuum = true
uid = web
gid = web
wsgi-file = /var/www/ERP/Application/app.wsgi
============================
=== wsgi-file: app.wsgi ====
import os
from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig
BASEDIR = os.path.dirname(os.path.abspath(__file__))
INIFILE = os.path.join(BASEDIR, 'wsgi.ini')
fileConfig(INIFILE)
application = loadapp("config:%s" % INIFILE)
============================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment