title: dJango mod_wsgi config issue in Apache
body: <p>I am trying to run a dJango(1.5) application with Apache (2.4) and mod_wsgi. I have followed the standard tutorial. I have also run apache user and group as the file owner(myself) and the group. After I hit an url, it waits for long and then gives Gateway Timeout. Apache hits wsgi.py and upto settings.py as I am seeing all the print statements in settings.py in /var/log/apache2/error.log, but after that no output. Is it not getting the urls.py? Can anybody help please? I am giving my httpd.conf here.</p>
  
  <pre><code>WSGIDaemonProcess imse_wsgi python-path=/ldata/Imse user=www-data
  
  &lt;VirtualHost *:80&gt;
  
      ServerName wonders.pc.hiit.fi
      ServerAlias imse.hiit.fi
  
      Alias /static/ /ldata/Imse/static/
  
      &lt;Directory /ldata/Imse/static&gt;
              Require all granted
      &lt;/Directory&gt;
  
      WSGIScriptAlias /imse /ldata/Imse/Imse/wsgi.py
      &lt;Directory /ldata/Imse/Imse&gt;
              Require all granted
              WSGIProcessGroup imse_wsgi
              &lt;Files wsgi.py&gt;
                      Require all granted
              &lt;/Files&gt;
      &lt;/Directory&gt;
      &lt;IfModule mod_headers.c&gt;
              Header set Access-Control-Allow-Origin "*"
      &lt;/IfModule&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>here is wsgi.py</p>
  
  <pre><code>import os
  import sys
  import django.core.handlers.wsgi
  
  sys.path.append('/ldata/Imse')
  sys.path.append('/ldata/Imse/Imse')
  
  os.environ["DJANGO_SETTINGS_MODULE"] = "Imse.settings"
  application = django.core.handlers.wsgi.WSGIHandler()
  </code></pre>
  
  <p>error log when apache2 is restarted</p>
  
  <pre><code>[Tue Oct 28 00:03:28.525134 2014] [mpm_event:notice] [pid 26381:tid 139811474503552] AH00491: caught SIGTERM, shutting down
  [Tue Oct 28 00:03:29.592849 2014] [mpm_event:notice] [pid 4084:tid 139694197917568] AH00489: Apache/2.4.10 (Debian) mod_wsgi/4.3.0 Python/2.7.8 configured -- resuming normal operations
  [Tue Oct 28 00:03:29.592960 2014] [core:notice] [pid 4084:tid 139694197917568] AH00094: Command line: '/usr/sbin/apache2'
  </code></pre>
  
  <p>When I hit the url</p>
  
  <pre><code>[Tue Oct 28 00:05:49.754939 2014] [wsgi:error] [pid 4087:tid 139693984982784] Env loaded
  [Tue Oct 28 00:05:49.755014 2014] [wsgi:error] [pid 4087:tid 139693984982784] Application loaded
  [Tue Oct 28 00:05:49.755776 2014] [wsgi:error] [pid 4087:tid 139693984982784] /ldata/Imse
  [Tue Oct 28 00:05:49.755863 2014] [wsgi:error] [pid 4087:tid 139693984982784] No local settings configured, using defaults
  [Tue Oct 28 00:05:49.879412 2014] [wsgi:error] [pid 4087:tid 139693984982784] URL imported
  [Tue Oct 28 00:05:49.879445 2014] [wsgi:error] [pid 4087:tid 139693984982784] Loading URLs
  </code></pre>
  
  <p>These are the prints from wsgi.py (those are removed here) and from settings.py, the programme gets stucked in urls.py, after nearly 5 minutes of page loading, the page shows Gateway Timeout and one line added to the error.log as below</p>
  
  <pre><code>[Tue Oct 28 00:10:49.654957 2014] [wsgi:error] [pid 4089:tid 139693995841280] [client 2001:708:140:200:8a51:fbff:fe64:db53:51393] Timeout when reading response headers from daemon process 'imse_wsgi': /ldata/Imse/Imse/wsgi.py
  </code></pre>