【发布时间】:2020-01-16 01:30:02
【问题描述】:
我正在使用 Apache 在本地托管一个基于 Django 的网页。但是,我收到以下错误:
从守护进程“office”读取响应标头时超时:var/www/office/office/wsgi.py。
我尝试将 WSGIApplicationGroup %{GLOBAL} 行添加到 conf 文件中,但仍然收到相同的错误。
这是我的 .conf 文件。
WSGIPythonPath /var/www/office
ServerName office.org
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIApplicationGroup %{GLOBAL}
<VirtualHost 0.0.0.0:80>
ServerAlias www.office.org
DocumentRoot /var/www/example.com/public_html
<Directory /var/www/example.com>
Require all granted
</Directory>
<Directory /var/www/office/office>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess office python-home=/var/www/venv python-path=/var/www/office
WSGIProcessGroup office
WSGIScriptAlias /verify /var/www/office/office/wsgi.py process-group=office
ErrorLog /var/www/logs/error.log
CustomLog /var/www/logs/custom.log combined
</VirtualHost>
这是 wsgi.py 文件:
"""
WSGI config for office project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "office.settings")
application = get_wsgi_application()
【问题讨论】: