Anaconda Python causes a lot of grief when used embedded in Apache because Anaconda ships its own versions of various system libraries and builds Python and its packages against those, rather than system libraries. These libraries are in various cases incompatible with system libraries. If any of the conflicting system libraries are first imported by Apache because it or an Apache module uses them, the code will crash when the code using that library is execute by the Python application.
Two major types of system libraries where this is a problem are anything to do with SSL and crypto, and various image libraries. This means that if you use mod_ssl in Apache, things will likely crash. If you use PHP with Apache, because it uses various system libraries for image manipulation, again, things will likely crash. There is nothing you can do about it if you need SSL and PHP in Apache, except not use Anaconda Python distributions. That Anaconda Python does this is a huge pain. In short, Ananconda Python is next to useless for use in embedded systems like Apache and the way mod_wsgi is integrated with it. All I can suggest is, not use Anaconda Python and use system Python. Alternatively, use mod_wsgi-express to run a separate Apache instance, and set up the main Apache to proxy to that instance. Anyway, that is my educated guess seeing that you are using Miniconda. Beyond that, the usual reason for a crash, is using a third party Python package which isn't designed for Python sub interpreters. In that case, you want to ensure you are using daemon mode for each separate WSGI application you are hosting, and setup each of those to run in the main interpreter context of their respective daemon process groups. * https://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#python-simplified-gil-state-api <https://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#python-simplified-gil-state-api> Also recommended to disable embedded mode when using daemon mode by setting WSGIRestrictEmbedded directive. My money is on it being due to Anaconda/Miniconda incompatibilities with system libraries. Graham > On 7 Feb 2019, at 6:35 pm, Marius Roets <[email protected]> wrote: > > Hi all, > > Hope I can get some help as I've been banging my head against this for a week > now. > > I started a new Django project which is working well with the Django built-in > server, and I now want to roll out to Apache. On my development Apache server > everything is working just fine, but when I try on production, I get the > above mentioned problem (details to follow). I have checked and double > checked all version on development and production, and can't find any > differences. Unfortunately, it being a production environment, I'm limited to > the amount of experimentation/debugging that I can do. > > Error: > I have attached the apache logs(log.txt), the main and vhost log files, with > LogLevel set to 'info'. This shows the log entries after apachectl restart, > and when the home page is called up. > I have tried to get a gdb stack trace by creating a single thread and > attaching to it (stack.txt). I hope I did this correctly. > > Config: > I have attached the main and vhost config (config.txt) > I have attached the Django wsgi.py script that fails : wsgi-fail.py > I have attached a test wsgi script that works: wsgi-work.py > I have attached the browser output from the latter: wsgi-work-output.txt > > Any help would be greatly appreciated. > > Regards > Marius > > > > > > -- > 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 post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/modwsgi > <https://groups.google.com/group/modwsgi>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > <stack.txt><config.txt><log.txt><wsgi-fail.py><wsgi-work.py><wsgi-work-output.txt> -- 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.
