Install mod_wsgi on Ubuntu Gutsy

Since mod_wsgi isn’t available as an official pre-compiled package for Ubuntu Gutsy (but see below), we have to compile it from source manually and install it ourselves. Although I used mod_wsgi 2.0c4 in the example below, you can follow the same directions and install the stable version, 1.3. This tutorial uses Apache 2 and Python 2.5.

If you have any problems, read the Installation Issues page on the mod_wsgi Wiki.

1. Prerequisites

Before we can begin, we need to have some packages installed:

sudo aptitude install build-essential apache2-dev python2.5-dev

2. Download and Install mod_wsgi

As a regular user, run these commands:

1. mkdir ~/src && cd ~/src
2. wget http://modwsgi.googlecode.com/files/mod_wsgi-2.0c4.tar.gz
3. tar zxvf mod_wsgi-2.0c4.tar.gz && cd mod_wsgi-2.0c4
4. ./configure && make && sudo make install

3. Configure Apache for mod_wsgi

Now that the mod_wsgi module is installed on our system, we have to create a .load file for it:

sudo echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so" > /etc/apache2/mods-available/wsgi.load

We must now tell Apache to load the mod_wsgi module. First, type:

sudo a2enmod

At the prompt, type “wsgi” and hit enter.

Finally, we just need to restart Apache and everything should be good to go:

sudo /etc/init.d/apache2 restart

Binary packages

A binary package for Gutsy on amd64 is available at http://sw.fairviewcomputing.com/ubuntu/. I’m using it on my Slice, but if you have trouble with it, or need a version other than 2.0, this tutorial shows how easy mod_wsgi is to build.

 
/var/www/dokuwiki/data/pages/install_mod_wsgi_on_ubuntu_gutsy.txt · Last modified: 2008/03/24 16:21 by fairviewcomputing
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
© Slicehost 2006-2007