Trying to get Pyramid running under Apache + mod_wsgi but it's failing

早过忘川 提交于 2019-11-30 10:22:18
Cameron

You're using the EvalException middleware (as can be seen from your error message). This solution to this error is actually covered in the Debugging Techniques wiki of mod_wsgi.

Basically, since the middleware allows browser-based interactive debugging of your application, all requests need to be sent to the same process; however, you are running mod_wsgi in embedded mode, which can create many processes by default.

From the wiki:

[...] if you want to be able to use this browser based interactive debugger, if running your application in embedded mode of mod_wsgi, you will need to configure Apache such that it only starts up one child process to handle requests and that it never creates any additional processes. The Apache configuration directives required to achieve this are as follows.

StartServers 1  
ServerLimit 1

Switching to daemon mode (with a single process, the default) will also fix this problem, and is recommended over running in embedded mode. Here are the Apache directives:

WSGIDaemonProcess pyramidtest.dev display-name=%{GROUP}
WSGIProcessGroup pyramidtest.dev

mod_wsgi can also add the path to the Python path for you. If using embedded mode you can use:

WSGIPythonPath /opt/pyramid/lib/python2.7/site-packages

If using daemon mode, instead use the 'python-path' option to the WSGIDaemonProcess directive.

WSGIDaemonProcess pyramidtest.dev display-name=%{GROUP} python-path=/opt/pyramid/lib/python2.7/site-packages
WSGIProcessGroup pyramidtest.dev
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!