2

我有一个带有 mod_wsgi 的 Pyramid 应用程序和 apache,我正试图让它们一起工作。这是我的 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>

不幸的是,我收到一个服务器错误:AssertionError: The EvalException middleware is not used in a multi-process environment

我按照教程查看了这篇文章,但无法真正理解它。

谢谢!

4

2 回答 2

4

从 WSGIDaemonProcess 中删除 'processes=1' 选项。即,让它默认为单个进程并且不要显式设置它。任何使用 'processes' 选项都会导致 'wsgi.multiprocess' 设置为 True 这不是你想要的。请参阅以下文档中的“流程”选项:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess

于 2011-07-15T10:19:12.517 回答
1

您必须在部署设置中禁用调试模式

于 2011-07-15T08:23:06.820 回答