Skip to content

Instantly share code, notes, and snippets.

@varikin
Created February 20, 2012 23:52
Show Gist options
  • Select an option

  • Save varikin/1872379 to your computer and use it in GitHub Desktop.

Select an option

Save varikin/1872379 to your computer and use it in GitHub Desktop.
Example Apache virtual host file for mod_wsgi
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
LogLevel warn
ErrorLog /path/to/logs/project_error.log
CustomLog /path/to/logs/project_access.log combined
# Ensures Apache servers static files
# These should match STATIC_ROOT and STATIC_URL
Alias /static/ /path/to/static_root/
<Directory /path/to/static_root>
Order allow,deny
Allow from all
</Directory>
# Ensures Apache servers uploaded files
# These should match MEDIA_ROOT and MEDIA_URL
Alias /media/ /path/to/media_root/
<Directory /path/to/media_root>
Order allow,deny
Allow from all
</Directory>
# Configures mod_wsgi to run in daemon mode under the user/group with set max proccesses and threads
WSGIDaemonProcess project-name user=varikin group=staff processes=2 threads=10 maximum-requests=1000
WSGIProcessGroup project-name
# Proxies requests from apache to the app running under mod_wsgi
WSGIScriptAlias / /path/to/django.wsgi
</Virtualhost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment