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

前端 未结 1 1698
囚心锁ツ
囚心锁ツ 2021-01-01 06:35

I\'ve got Apache2 running with mod_wsgi installed. I\'ve confirmed that mod_wsgi actually works by following this.

The problem comes when I try to get Pyramid runnin

相关标签:
1条回答
  • 2021-01-01 06:55

    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
    
    0 讨论(0)
提交回复
热议问题