gpt4 book ai didi

python - Django : Timeout when reading response headers from daemon process 的 mod_wsgi 错误

转载 作者:行者123 更新时间:2023-11-28 18:13:47 35 4
gpt4 key购买 nike

我正在使用 mod_wsgi 4.5.20 运行 Django 2.0.4。

当我尝试将站点部署到位于 /parature 的开发环境时,我遇到了错误。奇怪的是,部署在 VirtualHost 根目录下的站点正常响应:

[Tue Apr 10 13:34:08.998704 2018] [wsgi:error] [pid 65245] [client xx.yy.zz:65390] Timeout when reading response headers from daemon process 'parature-develop-https': /var/django/html/parature-develop/config/wsgi.py

我可以通过激活 virtualenvrunserver 运行站点。它不应该超时,因为我只是想调出 Django 管理站点。

<VirtualHost *:443>
SSLEngine On

ServerName wrds-pub1-dev.example.com
ErrorLog "|/usr/sbin/cronolog /var/log/httpd/errorlog/%Y/%Y-%m-wrds-pub1-dev-error.log"
LogLevel info

WSGIApplicationGroup %{GLOBAL}

# The site I'm adding, which isn't working
WSGIDaemonProcess parature-develop-https python-home=/var/django/virtualenvs/parature-develop request-timeout=600
WSGIProcessGroup parature-develop-https
WSGIScriptAlias /parature /var/django/html/parature-develop/config/wsgi.py process-group=parature-develop-https
<Directory /var/django/html/parature-develop/config>
Require all granted
</Directory>
Alias /parature/static/ /var/django/html/parature-develop/static/
<Directory /var/django/html/parature-develop/static>
Require all granted
</Directory>

# The site which has been and continues to work
WSGIDaemonProcess django-wrds-dev-https python-home=/var/django/virtualenvs/django-wrds-dev request-timeout=600
WSGIScriptAlias / /var/django/html/django-wrds-dev/config/wsgi.py process-group=django-wrds-dev-https
<Directory /var/django/html/django-wrds-dev/config>
Require all granted
</Directory>
Alias /static/ /var/django/html/django-wrds-dev/static/
<Directory /var/django/html/django-wrds-dev/static>
Require all granted
</Directory>
Alias /media/ /var/media/wrds-www/
<Directory /var/media/wrds-www>
Require all granted
</Directory>
</VirtualHost>

我觉得我错过了一些明显的东西,但看不到它。我在另一个 VirtualHost 中有一个类似的配置,在同一域下有多个 Django 项目,只要根站点排在最后,它就可以正常工作。

wsgi.py 与正在运行的站点几乎完全相同:

import os, sys, logging
from socket import gethostname
from django.core.wsgi import get_wsgi_application

# Since this powers Apache, let's route Python errors to the Apache
# log rather than STDOUT, where they'll never be seen.
logging.basicConfig(stream=sys.stderr)

# Figure out where we're at, and add the parent to the path
sys.path.append(os.sep.join(os.path.abspath(__file__).split(os.sep)[:-2]))

# wrds-pub1-dev server
if 'wrds-pub1-dev' in gethostname():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
# wrds-pub* production servers.
elif 'wrds-pub' in gethostname():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
# else use dev settings.
else:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

application = get_wsgi_application()

有什么想法吗?

最佳答案

我想通了 - 我们的开发服务器(因为从来没有重建的好时机)是我们唯一的非 Ansiblized 服务器,并且仍在运行针对 Python 3.5 构建的 mod_wsgivirtualenv 是针对 Python 3.6 构建的。

我针对 Python 3.5 重建了 virtualenv,一切正常。希望这可以避免将来有人抓头发!

关于python - Django : Timeout when reading response headers from daemon process 的 mod_wsgi 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49760253/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com