Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have trouble with configuring a Django server in mode wsgi with Ubuntu 11.10. Here is the problem: the latest ubuntu 11.10 has python2.7 as default. Installing apache2 and libapache2-mod-wsgi expect to work with python2.6. My configuration is tested before and works, but not in these circumstances. Now I have 403 Forbidden message. What would you recommend me. Keep python2.7 and compile apache wsgi for python2.7 or make python2.6 default to the system (wich is bad, as 2.7 is better for my django requirements)

share|improve this question

migrated from Nov 21 '11 at 3:37

This question came from our site for professional and enthusiast programmers.

Instead of troubleshooting the Python version (which is not an issue at all, it requires both 2.6 and 2.7, see here), how about providing your Apache config and the contents of Apache's error log? – Shane Madden Nov 21 '11 at 5:29
up vote 0 down vote accepted

How about to use a virtual environment through mkvirtualenv command? You can choose your own version of Python for your virtual environment. Actually, Ubuntu allows you to install Python 2.6 and 2.7 from the binaries packages.

$ mkvirtualenv name --python=python2.7 --no-site-packages
share|improve this answer
As you said, libapache2-mod-wsgi works fine with both python 2.6 and 2.7. My fault linked with the folder permissions. Anyway, virtualenv is a must! Meanwhile I'll check uWSGI. Thank you for your answer! – Method Nov 21 '11 at 11:45

If Python 2.7 is better for your requirements I suggest you to compile mod_wsgi for that version of Python.

In theory, libapache2-mod-wsgi should work properly with Python 2.6:

Depends: apache2, apache2.2-common, libc6 (>= 2.4), libpython2.6 (>= 2.6),   
libpython2.7 (>= 2.7), python (>= 2.6), python (<< 2.8)

Another option is to use uWSGI (libapache2-mod-uwsgi) for Apache.

share|improve this answer
I made it work, thanks for your answer! – Method Nov 21 '11 at 11:31

I was just trying to find out how to setup mod_wsgi with Python 2.7 on my Ubuntu 11.10 server when I discovered that libapache2-mod-wsgi comes with binaries for both Python 2.6 and 2.7.

You can select between 2.6 and 2.7 by changing a symbolic link.

root@webserver-01:/etc/apache2/mods-available# ls /usr/lib/apache2/modules/mod_wsgi* -la
lrwxrwxrwx 1 root root     15 2011-06-03 15:01 /usr/lib/apache2/modules/ ->
-rw-r--r-- 1 root root 152064 2011-06-03 15:01 /usr/lib/apache2/modules/
-rw-r--r-- 1 root root 152064 2011-06-03 15:01 /usr/lib/apache2/modules/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.