0

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 86.133.221.44:58348] 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:

<VirtualHost 46.101.39.249:80>
<Directory "/var/www/sarahcage">
    AllowOverride All
    Require all granted
</Directory>
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
</LocationMatch>

</VirtualHost>

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?

Jon Cage
  • 329
  • 1
  • 3
  • 12
  • try this: https://stackoverflow.com/questions/18392741/apache2-ah01630-client-denied-by-server-configuration – Dennis Nolte Sep 18 '17 at 07:47
  • @DennisNolte I already have `Require all granted` set in there? – Jon Cage Sep 18 '17 at 08: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

1 Answers1

0

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
</Directory>
Jon Cage
  • 329
  • 1
  • 3
  • 12