Skip to content

Instantly share code, notes, and snippets.

@cpdean
Created June 27, 2013 23:38
Show Gist options
  • Save cpdean/5881331 to your computer and use it in GitHub Desktop.
Save cpdean/5881331 to your computer and use it in GitHub Desktop.
wsgi apache setup with error logging and virtualenv
import sys
sys.stdout = sys.stderr
sys.path.insert(0,'/home/user/public/appname.example.com/public/appname')
activate_this = '/home/user/public/appname.example.com/public/appname/appvirtualenv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
from app import app as application
# domain: appname.example.com
# public: /home/user/public/appname.example.com/
<VirtualHost *:8080>
ServerAdmin [email protected]
ServerName appname.example.com
ServerAlias appname.example.com
WSGIDaemonProcess appname
WSGIScriptAlias / /home/user/public/appname.example.com/public/appname/apache.wsgi
LogLevel warn
ErrorLog /home/user/public/appname.example.com/log/error.log
CustomLog /home/user/public/appname.example.com/log/access.log combined
<Directory /home/user/public/appname.example.com/public/appname >
WSGIProcessGroup appname
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment