Trying to get Pyramid to work under Apache + mod_wsgi, but it doesn't work

I have Apache2 installed with mod_wsgi installed. I have confirmed that mod_wsgi works by following this .

The problem occurs when I try to start Pyramid. I get an internal server error, and my Apache error log contains an exception:

AssertionError: The EvalException middleware is not usable in a multi-process environment

Here is my VHost:

<VirtualHost *:80>
    ServerName  pyramidtest.dev
    DocumentRoot    /srv/pyramidtest.dev/www/
    AssignUserID    pyramidtest nogroup
    WSGIScriptAlias / /srv/pyramidtest.dev/pyramid/load.wsgi
</VirtualHost>

Here is my load.wsgi:

import site
site.addsitedir('/opt/pyramid/lib/python2.7/site-packages')

from pyramid.paster import get_app

application = get_app('/srv/pyramidtest.dev/pyramid/test/development.ini', 'main')

mod_wsgi is compiled for use /opt/python2.7as a Python interpreter, but I run Pyramid under virtualenv in /opt/pyramid- That's why I have it site.addsitedir()in my load.wsgi.

And, if necessary apache2 -V,:

Server version: Apache/2.2.9 (Debian)
Server built:   Dec 30 2010 11:50:24
Server Module Magic Number: 20051115:15
Server loaded:  APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture:   32-bit
Server MPM:     ITK
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/experimental/itk"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

What am I missing ...?

+3
source share
1 answer

EvalException ( ). wiki mod_wsgi.

, , ; mod_wsgi , .

wiki:

[...], , mod_wsgi, Apache , . , .

StartServers 1  
ServerLimit 1

( ) . Apache:

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

mod_wsgi Python . , :

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

, 'python-path' WSGIDaemonProcess.

WSGIDaemonProcess pyramidtest.dev display-name=%{GROUP} python-path=/opt/pyramid/lib/python2.7/site-packages
WSGIProcessGroup pyramidtest.dev
+6

All Articles