1

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?

2

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.

  • 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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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