Thomas Montagnoni
Thomas Montagnoni

Reputation: 468

Apache/Wsgi - Script timed out before returning headers

I have a problem with Apache/wsgi on Ubuntu. I'm trying to serve a django site. I have already read all same issues on SO and other websites but i really can't fix it.

I got the same problem as other member. After 2 - 3 minutes the request ends with a 500 error and the log tell me : Script timed out before returning headers - wsgi.py.

Rights are ok, Apache 2.4.7, libapache2-mod-wsgi 4ubuntu2.1.14.04.2.

List of mods enabled :

And This is my virtual host

<VirtualHost *:80>
    ServerAdmin [email protected]
    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

Can someone tell me where i'm wrong ?

Thank you !

Upvotes: 1

Views: 3120

Answers (1)

Thomas Montagnoni
Thomas Montagnoni

Reputation: 468

Thank you Graham Dumpleton !!

I added this to the Vhost :

WSGIDaemonProcess home=/home/repos

All work fine now :) Was a directory problem !

Upvotes: 1

Related Questions