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

I am trying to configure mod_wsgi to use Python 2.7.

I downloaded and unpacked the source and ran

./configure --with-python=/usr/local/bin/python2.7

After this mod_wsgi.so-2.4 and mod_wsgi.so-2.5 appeared in /usr/lib/apache2/modules.

I restarted the server but this reports "internal server error". Error logs show that on start-up the server is reporting usage of Python 2.5.2 -- the same version as previously.

How do I get Apache to run Python 2.7? How do I get mod_wsgi configured properly to run with Python 2.7?

share|improve this question

1 Answer 1

You have a system package for mod_wsgi installed which is conflicting. If you don't need them, uninstall the system package for mod_wsgi.

Also make sure you read:

as you may need to set LD_RUN_PATH to /usr/local/lib when building mod_wsgi so that it knows where to find the Python library at runtime, if /usr/local/lib is not listed in system ld.cache.

You also may need to set:

WSGIPythonHome /usr/local

in Apache configuration so mod_wsgi knows where Python 2.7 is since not in system location.

Also make sure Python 2.7 was installed with a shared library.

share|improve this answer
Thx. I did a workaround for the immediate problem but I need to get this under control and will circle back to it soon –  chernevik Dec 3 '12 at 22:51

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.