Apache / Wsgi - 脚本在返回标题之前超时

时间:2015-07-22 08:27:22

标签: python django apache mod-wsgi

我在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

这是我的虚拟主机

<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

有人能告诉我我哪里错了吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

谢谢Graham Dumpleton !!

我将此添加到Vhost:

WSGIDaemonProcess home=/home/repos

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