我以前使用以下设置运行Debian 8
并托管我的Django
应用:
现在我已更新到Debian 9
并使用mariaDB
,我在apache2.conf
文件中使用以下设置时出现问题:
LoadModule wsgi_module "/root/.virtualenvs/user/local/lib/python2.7/site-packages/mod_wsgi/server/mod_wsgi-py27.so"
WSGIScriptAlias / /home/user/web/user.com/project/project/wsgi.py
WSGIDaemonProcess user.com socket-user=user group=user processes=2 threads=25
WSGIProcessGroup user.com
WSGIPythonHome "/root/.virtualenvs/user" <-- outside of virtual host
我拿出每一行来查看导致问题的因素,LoadModule wsgi_module "/root/.virtualenvs/user/local/lib/python2.7/site-packages/mod_wsgi/server/mod_wsgi-py27.so"
是唯一一个允许在那里但不会导致网站挂起的行。
通过取出所有这些行,我的网站工作(尽管没有静态文件)并且没有以守护进程模式运行...我的错误日志除了以下内容外什么都没有显示:
2017/12/05 08:59:15 [error] 446#446: *80 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: X.X.X.X, server: website.com, request: "GET / HTTP/1.1", upstream: "http://X.X.X.X:8080/", host: "website.com"
2017/12/05 09:00:00 [error] 446#446: *80 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: X.X.X.X, server: website.com, request: "GET / HTTP/1.1", upstream: "http://X.X.X.X:8080/", host: "website.com"
我该如何解决这个问题?