关于python:Apache / Wsgi – 脚本在返回标题之前超时

Apache/Wsgi - Script timed out before returning headers

我在Ubuntu上遇到Apache / wsgi的问题。我正在尝试为django网站提供服务。
我已经在SO和其他网站上阅读了所有相同的问题,但我真的无法解决它。

我和其他成员有同样的问题。 2到3分钟后,请求以500错误结束,日志告诉我:在返回标题之前脚本超时 - wsgi.py.

权利还可以,Apache 2.4.7,libapache2-mod-wsgi 4ubuntu2.1.14.04.2。

启用的mod列表:

  • access_compat.load
  • alias.conf
  • alias.load
  • auth_basic.load
  • authn_core.load
  • authn_file.load
  • authz_core.load
  • authz_groupfile.load
  • authz_host.load
  • authz_user.load
  • autoindex.conf
  • autoindex.load
  • cgi.load
  • deflate.conf
  • deflate.load
  • dir.conf
  • dir.load
  • env.load
  • filter.load
  • mime.conf
  • mime.load
  • mpm_prefork.conf
  • mpm_prefork.load
  • negotiation.conf
  • negotiation.load
  • php5.conf
  • php5.load
  • reqtimeout.conf
  • reqtimeout.load
  • rewrite.load
  • setenvif.conf
  • setenvif.load
  • status.conf
  • status.load
  • wsgi.conf
  • wsgi.load

这是我的虚拟主机

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<VirtualHost *:80>
    ServerAdmin info@rescuecode.fr
    ServerName fiches.rescuecode.fr

    DocumentRoot /home/repos/git/rescuecode-fiches

    WSGIDaemonProcess rescuecode-fiches python-path=/home/repos/git/rescuecode-fiches:/home/virtualenvs/rescuecode-fiches/lib/python2.7/site-packages processes=4 threads=25
    WSGIProcessGroup rescuecode-fiches
    WSGIScriptAlias / /home/repos/git/rescuecode-fiches/project/wsgi.py
    WSGIApplicationGroup %{GLOBAL}

    Alias /static /home/repos/git/rescuecode-fiches/project/static/

    <Directory /home/repos/git/rescuecode-fiches/project/static>
            Require all granted
    </Directory>

    Alias /site_media /home/repos/git/rescuecode-fiches/project/site_media/

    <Directory /home/repos/git/rescuecode-fiches/project/site_media>
            Require all granted
    </Directory>

    <Directory /home/repos/git/rescuecode-fiches/project>
            <Files wsgi.py>
                    Require all granted
            </Files>
    </Directory>

    Loglevel warn
    ErrorLog /var/log/apache2/fiches.rescuecode.fr-error.log
    CustomLog /var/log/apache2/fiches.rescuecode.fr-access.log combined
    ServerSignature Off

谁能告诉我我哪里错了?

谢谢 !


谢谢Graham Dumpleton !!

我把它添加到Vhost:

1
WSGIDaemonProcess home=/home/repos

现在一切正常:)是一个目录问题!