I have a solution to run a Django (1.3.1 on Python 2.7) site which is working on an old server. I'm trying to migrate this to a new server but I'm encountering the following error when I try to access the page (which says it's forbidden in the browser):

[Mon Sep 18 06:48:32.394835 2017] [authz_core:error] [pid 24239:tid 140298255943424] [client] AH01630: client denied by server configuration: /var/django/sarahcage/fastcgihook.fcgi

My apache config includes this line:

FastCGIExternalServer /var/django/sarahcage/fastcgihook.fcgi -socket /var/django/sarahcage.sock

My apache site config looks like this:

<Directory "/var/www/sarahcage">
    AllowOverride All
    Require all granted
ServerName newserver.sarahcage.co.uk
DocumentRoot /var/www/sarahcage
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?$ /var/django/sarahcage/fastcgihook.fcgi/$1 [QSA,L]

# Set the whole site to use DJango
<LocationMatch "^/?$">
        SetHandler fastcgi-script


I run up the django deamon like this:

 /var/django/sarahcage/manage.py runfcgi socket=/var/django/sarahcage.sock pidfile=/var/run/sarahcage_fcgi.pid

There's one notable difference between the two servers; The new one is running on Apache/2.4.18 (Ubuntu) whereas the old one is running Apache/2.2.22 (Ubuntu). I've tried to follow the guidelines on upgrading but they don't seem to have helped.

I've checked and double checked permissions between the two machines but I just can't see what I've missed. What might I be doing wrong?

  • try this: stackoverflow.com/questions/18392741/… – Dennis Nolte Sep 18 '17 at 7:47
  • @DennisNolte I already have Require all granted set in there? – Jon Cage Sep 18 '17 at 8:23
  • did you test with a static page, to rule out any other issues? in the link there are at least 15 or so suggestions where that error might come from, not just the obvious one you already checked. obvious other issues: restarted/reload apache? – Dennis Nolte Sep 18 '17 at 11:08
  • I've tried a static page and that loads just fine. I've tried reloading and restarting apache. – Jon Cage Sep 18 '17 at 14:21

Turns out I had to set the 'Require' statement for the directory that the fastcgi hook was using as well:

<Directory "/var/django">
    AllowOverride all
    Require all granted

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.