WSGI via Mod_WSGI

Mod_WSGI is the best choice if you want to run your app on Apache. This configuration also happens is a little easier to setup.

WSGI handler

Create myapp/wsgi.py, which will be loaded by Mod_WSGI

import os
import sys
from chula.www.adapters.wsgi import adapter

# Expose the myapp, as it's not "installed"
sys.path.insert(0, '/var/www/myapp')

from model import configuration

@adapter.wsgi
def application():
    return configuration.app

Apache config

Add this to your VirtualHost:

WSGIScriptAliasMatch ^([a-z/_])+$ /path/to/myapp/wsgi.py

Try it!

Restart Apache:

sudo /etc/init.d/apache restart

Now you should be able to hit: http://your-server/myapp/blog

Table Of Contents

Previous topic

Nginx via FastCGI

Next topic

Apache via Mod_python

This Page