So, similar to this question, I can't seem to get Pyramid and mod_wsgi agree enough to host my application.
Here's my virtualhost
LoadModule proxy_module modules/mod_proxy.so
WSGIPythonHome /usr/local/pythonenv/BASELINE
WSGIPythonPath /usr/local/pythonenv/BASELINE
<VirtualHost *:80>
ProxyPreserveHost On
ServerName domain.com
ServerAdmin me@domain.com
ErrorLog /home/me/log/error.log
CustomLog /home/me/log/access.log combined
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=www-data group=www-data \
processes=1 threads=4 \
python-path=/var/app/app/appenv/lib/python2.7/site-packages
WSGIScriptAlias / /var/app/app/dispatch.wsgi
<Directory /var/app/app/>
WSGIProcessGroup pyramid
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
My dispatch.wsgi looks like this:
activate_this = '/var/app/app/appenv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import os
os.environ['PYTHON_EGG_CACHE'] = '/var/app/app/dist'
# Load the Pylons application
from pyramid.paster import get_app, setup_logging
ini_path = '/var/app/app/development.ini'
setup_logging(ini_path)
application = get_app(ini_path, 'main')
I even get the same error:
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] mod_wsgi (pid=8156): Target WSGI script '/var/app/app/dispatch.wsgi' cannot be loaded as Python module.
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] mod_wsgi (pid=8156): Exception occurred processing WSGI script '/var/app/app/dispatch.wsgi'.
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] Traceback (most recent call last):
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] File "/var/app/app/dispatch.wsgi", line 9, in <module>
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] from pyramid.paster import get_app, setup_logging
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] File "/usr/local/lib/python2.7/dist-packages/pyramid/paster.py", line 3, in <module>
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] from paste.deploy import (
[Tue May 06 11:45:54 2014] [error] [client xxx.xx.xx.xxx] ImportError: No module named paste.deploy
Permissions should be fine too:
-rwxr-xr-x 1 me me 458 May 5 14:42 dispatch.wsgi
From the fact that Pyramid's trying to use the paster in /usr/local/lib it seems to me that for some reason it's just not picking up on the virtualenv specific to my application. Any ideas?
It's worth noting that there's another mod_wsgi application running on the server not in daemon mode. Could that be interfering?