我正在尝试使用 Apache 2.22 和 WSGI 3.3 部署 pinax0.9a2。我正在使用 pinax 提供的 wsgi.py。但我在 apache 错误日志中收到 500 错误和以下错误:
[Sun Aug 19 03:31:55.895469 2012] [core:error] [pid 9045:tid 140546171721472] [client 107.192.29.14:62182] End of script output before headers: wsgi.py
[Sun Aug 19 03:31:56.424077 2012] [core:notice] [pid 7789:tid 140546404792064] AH00052: child pid 9225 exit signal Aborted (6)
[Sun Aug 19 03:31:56.742536 2012] [core:error] [pid 9044:tid 140546196899584] [client 107.192.29.14:62183] Invalid status line from script 'wsgi.py': Status
ng.co: Objects/stringobject.c:115: PyString_FromString: Assertion `str != ((void *)0)' failed.
[Sun Aug 19 03:31:56.966168 2012] [core:error] [pid 9044:tid 140546196899584] [client 107.192.29.14:62183] End of script output before headers: wsgi.py
[Sun Aug 19 03:31:57.426321 2012] [core:notice] [pid 7789:tid 140546404792064] AH00052: child pid 9243 exit signal Aborted (6)
Apache httpd.conf:
<VirtualHost *:80>
DocumentRoot /usr/local/apache2/mysite
WSGIDaemonProcess mysite.com python-path=/usr/local/apache2/mysite-env/lib/python2.6/site-packages processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup mysite.com
WSGIScriptAlias / /usr/local/apache2/mysite/wsgi.py
<Directory "/usr/local/apache2/mysite">
Require all granted
</Directory>
</VirtualHost>
wsgi.py:
from django.core.handlers.wsgi import WSGIHandler
import pinax.env
# setup the environment for Django and Pinax
pinax.env.setup_environ(__file__)
# set application for WSGI processing
application = WSGIHandler()