Can't Get Pyramid to Work with mod_wsgi
I have a Pyramid app and apache with mod_wsgi and I'm trying to make them work together. Here is my httpd.conf:
ServerRoot "/home/user/webapps/myapp/apache2"
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule authz_host_module modules/mod_authz_host.so
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedCustomLog /home/user/logs/user/access_myapp.log combined
ErrorLog /home/user/logs/user/error_myapp.log
KeepAlive Off
Listen 41121
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess myapp processes=1 display-name=%{GROUP} python-path=/home/user/webapps/myapp/htdocs/lib/python2.4/site-packages/ threads=4
WSGIScriptAlias / /home/user/webapps/myapp/htdocs/pyramid.wsgi
<Directory /home/user/webapps/myapp/htdocs>
WSGIProcessGroup myapp
Order allow,deny
Allow from all
</Directory>
Unfortunately, I get a server error: AssertionError: The EvalException midd开发者_运维知识库leware is not usable in a multi-process environment
I followed this tutorial and looked at this post, but couldn't really make anything of it.
Thanks!
Remove the 'processes=1' option from WSGIDaemonProcess. Ie., let it default to a single process and don't set it explicitly. Any use of 'processes' option will cause 'wsgi.multiprocess' to be set to True which isn't what you want. See documentation for 'processes' option in:
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess
You must disable debug mode in yours deployment settings
精彩评论