Don’t use mod_wsgi-standalone package on PyPi. That is a special case variant of the mod_wsgi package that also installs its own Apache, you don’t need that. Use ‘pip install mod_wsgi’ instead and they will all use the existing Apache installation. None of them modify the original Apache installation as a separate configuration is generated each time you run mod_wsgi-express. So just run ‘pip install mod_wsgi’ into the virtual environments for the different Python versions you want.
As to integrating with the main Apache on a system, you run each mod_wsgi-express instance you want, and then set up the main Apache installation to proxy to each. Thus the main Apache accepts the requests first for everything. For details on setting up proxy (ignore that mentions docker), see: http://blog.dscpl.com.au/2015/06/proxying-to-python-web-application.html <http://blog.dscpl.com.au/2015/06/proxying-to-python-web-application.html> http://blog.dscpl.com.au/2015/07/redirection-problems-when-proxying-to.html <http://blog.dscpl.com.au/2015/07/redirection-problems-when-proxying-to.html> As to having the separate mod_wsgi-express instances run as daemons, see section 'Running mod_wsgi-express as root’ in: https://pypi.org/project/mod-wsgi/ <https://pypi.org/project/mod-wsgi/> This explains how you can generate a script for running as managed daemon. You then need to integrate execution of that into whatever startup system your operating system uses. Eg., systemd, init.d etc. Graham > On 9 Jan 2020, at 8:43 am, Lou King <[email protected]> wrote: > > I have several python2 flask wsgi based web applications running happily on a > server under apache. I am converting them one at a time to python3. > > I see from https://github.com/GrahamDumpleton/mod_wsgi/issues/21 that > mod_wsgi doesn't like running under two different versions of python, but > there are hints that possibly mod_wsgi-express can be used somehow under a > virtual environment. > > https://pypi.org/project/mod-wsgi/ - Installation into Python suggests pip > install mod_wsgi-standalone will make mod_wsgi-express available as well as a > separate apache installation "installed into my Python distribution", which I > assume means the virtual environment. > > https://pypi.org/project/mod-wsgi/ <https://pypi.org/project/mod-wsgi/> > refers to the "main mod_wsgi documentation" for more details on > mod_wsgi-express, which I assume means > https://modwsgi.readthedocs.io/en/develop/index.html > <https://modwsgi.readthedocs.io/en/develop/index.html>. But > https://modwsgi.readthedocs.io/en/develop/getting-started.html > <https://modwsgi.readthedocs.io/en/develop/getting-started.html> refers back > to https://pypi.python.org/pypi/mod_wsgi for details on mod_wsgi-express. > > Maybe this is linux 101, but is there any way to run the virtual > environment's mod_wsgi-express as a daemon, so it's available for my python3 > wsgi application? > And if so how do I set up the apache vhost file to find it? > Or if this just can't be done, can someone another way I can run my python3 > flask applications under apache in parallel with the python2 mod_wsgi > applications? > > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/modwsgi/c653171b-c793-4628-8769-72c7af889419%40googlegroups.com > > <https://groups.google.com/d/msgid/modwsgi/c653171b-c793-4628-8769-72c7af889419%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/E287745D-FB53-46AC-8FF4-AEAC2B78DBFB%40gmail.com.
