Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

how can I change the default version mod_wsgi uses?

I am using Debian 5 with Apache 2.

share|improve this question

3 Answers 3

Look for /usr/lib/apache2/modules/mod_wsgi.so*, at least on ubuntu I have:

/usr/lib/apache2/modules/mod_wsgi.so -> mod_wsgi.so-2.6
/usr/lib/apache2/modules/mod_wsgi.so-2.5
/usr/lib/apache2/modules/mod_wsgi.so-2.6

If you change the symlink, you change the default mod_wsgi.

An alternative is to look in /etc/apache2/mods-enabled/wsgi.load, for me that's just one line:

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

If you point that at one of those mod_wsgi.so-2.x files, you've changed the default version.

share|improve this answer

When you say different version you mean Python 2.5 vs 2.6, then you must install mod_wsgi package binary compiled against Python 2.5, or compile mod_wsgi from source code yourself against the Python 2.5 version. See notes about --with-python option in:

http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Configuring_The_Source_Code

share|improve this answer

you should look into using virtualenv. I think that is what you are looking for

http://code.google.com/p/modwsgi/wiki/VirtualEnvironments

share|improve this answer
    
Is it possible to create virtualenv with higher Python version than system has? –  Etam Jul 6 '10 at 23:39
    
yes.. i do it for hosting Django apps on redhat el 5 that only has 2.4.. I run 2.6 in virtualenv. You just have to install it on the system as an option –  Mike Jul 7 '10 at 12:38
2  
Virtual environments can only be used for the same version of Python as mod_wsgi was compiled for. You cannot have mod_wsgi compiled against Python 2.4 and then create a virtual environment for Python 2.6 and point mod_wsgi at it. Python 2.4 will still be what actually runs. In the mean time you are potentially mixing Python code/extension modules from a different version of Python, which can cause all manner of problems or crashes. –  Graham Dumpleton Aug 29 '10 at 23:28

Your Answer

 
discard

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.