mod_wsgi 标题前的脚本输出结束

mod_wsgi 标题前的脚本输出结束

我的 Web 应用程序有问题。有时当人们上传图像时(似乎只发生在大图像上),我的 mod_wsgi 会崩溃并显示以下消息:

End of script output before headers: wsgi.py, referer:http:::...
Process 'wsgi' has died, restarting.
Process 'wsgi' terminated by signal 9

因此引发了内部错误。

这是我的 wsgi 文件:

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

这是 wsgi 配置文件

LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/python/run/baselinenv
WSGISocketPrefix run/wsgi
WSGIRestrictEmbedded On

<VirtualHost *:80>

Alias /static/ /opt/python/current/app/static/
<Directory /opt/python/current/app/static/>
Order allow,deny
Allow from all
</Directory>


WSGIScriptAlias / /opt/python/current/app/wsgi.py


<Directory /opt/python/current/app/>
  Require all granted
</Directory>

WSGIDaemonProcess wsgi processes=1 threads=15 display-name=%{GROUP} \
  python-path=/opt/python/current/app:/opt/python/run/venv/lib/python2.7/site-packages user=wsgi group=wsgi \
  home=/opt/python/current/app
WSGIProcessGroup wsgi
</VirtualHost>

您知道问题是什么以及我该如何解决它吗?

请注意,我无法迁移到 nginx 和 gunicorn。

多谢

相关内容