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.

I'm trying to setup Python3 and Python2 via mod_wsgi on Ubuntu, so I've installed the mod_wsgi_py3 package but also wish to run the py2 version and have it switched depending on a flag within the virtualhosts config. Is there any way to do this withing Apache 2.2?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

No, it is not possible. you would need to run two Apache instances, each with different mod_wsgi binary compiled for the Python version you want to use.

share|improve this answer
    
That is disappointing. I was considering modifying the mod_wsgi binary for py2 to prefix all directives with PY2_ in order to have them both loaded side-by-side. I assume that will work but that's also not really road I'm ready to embark on. –  Marco Ceppi Feb 13 '12 at 2:35
    
It is much deeper than just changing directive names. For a start you can't load the two different Python shared libraries for different Python versions into memory at the same time. –  Graham Dumpleton Feb 13 '12 at 3:59
    
Thanks! I appreciate the information –  Marco Ceppi Feb 13 '12 at 13:04

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.