> So if you are still loading the system mod_wsgi package, which is going to be
> compiled for system Python and not Anaconda Python, then none of this will
> work.
>
> The mod_wsgi you load must be the one that was compiled for Anaconda Python.
> You cannot force mod_wsgi compiled for one Python installation/version, to
> use a different Python installation/version.
>
> This refers to the "LoadModule" directives in the httpd.conf, right?
> I updated that to point to the mod_wsgi compiled for my venv as:
> LoadModule wsgi_module
> /home/neildillon/public_html/rrfexpire/venv/lib/python2.7/site-packages/mod_wsgi/server/mod_wsgi-py27.so
>
> And now everything seems to be working appropriately for my Flask App, with
> no module import errors as was typical before. This makes me believe that
> everything is linked correctly and I can continue to work on my app.
>
>
> If you can't stop using the system mod_wsgi package, you should use
> mod_wsgi-express (start-server) to run a separate instance of Apache/mod_wsgi
> for Python version you need. Then setup the main Apache to proxy requests
> through to that separate instance.
>
> However, updating the "LoadModule wsgi_module" as mentioned above breaks the
> previous apps that ran wsgi_mod. I'm afraid that I will need them to still
> work, so can't permanently update the wsgi_module to the version that works
> for me. Is it correct that only one version of wsgi_module can run at a time?
Yes. The mod_wsgi module embeds Python inside of the Apache processes. It isn't
simply running a distinct Python instance. In other words, the 'python' command
is never run, the Python library is linked directly into Apache. Thus you can
only have one in use at a time.
> I thought that was the point of running the virtualenv's - so that multiple
> instances of python interpreters with corresponding mod_wsgi compilations can
> run in parallel?
That only applies when running 'python' command line and not an embedded system.
> Or is that when I need to move on to mod_wsgi-express, and proxy with Apache?
>
Yes, you need to start looking at running mod_wsgi-express command separately
and proxy to those.
> Finally, I see in the documentation many examples of running mod_wsgi-express
> through the shell, but can't yet tell how to implement that through
> myapp.wsgi in the Flask context.
Have you tried:
mod_wsgi-express start-server rrfexpire.wsgi
> I'm sure I need to master the Apache proxy documentation and will start with
> that, but any other recommended resources would be appreciated.
Ignore that it is using docker to run the backend WSGI applications, assume
using mod_wsgi-express on same machine and look at description of using proxies
in:
* 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>
>
> Can you confirm that you are still loading the system mod_wsgi and not one
> you compiled for Anaconda Python?
>
> Yes, at the time of the original message, I was still loading the system
> mod_wsgi, and not the one compiled for Anaconda Python. I understand now
> that this is a directive that is entered in the Apache config file.
Graham
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.