I have several virtual hosts configured under the same apache instance on redhat:
- mod_wsgi-3.5 compiled with default system python-2.6
For every virtual host
WSGIScriptAlias setting is pointed to the python file where the virtual environment is activated:
activate_this = '/path_to_the_virtualenv/bin/activate_this.py' execfile(activate_this, dict(__file__=activate_this))
Now, I'm planning to upgrade one of the projects to python-2.7, another one to python-3.x. I know that I can have different virtual environments, separate python sandboxes. So, everything is good on the python side.
The question is: is it possible to use different python versions for different apache virtual hosts under the same apache+mod_wsgi instance?
If not, what would be the best option to proceed?
There is a relevant
WsgiPythonHome setting, but it is defined globally in the "server config" context, not per virtual host. Plus, mod_wsgi is compiled for the specific python version, so I'm not sure it can handle the case.