Search code examples
pythondjangoapache.htaccessaccess-denied

Access denied in Apache using Django


I am trying to setup a Django project like explained on AlwaysData, but on my own computer.

I'm using ArchLinux.

I got an access denied in my error_log when I went to the directory containing the FastCGI script (the same django.fcgi as in the link above) :

client denied by server configuration: /var/www/home

However, I can access the project if I go to directory/django.fcgi instead of only directory/.

My .htaccess is :

AddHandler fastcgi-script .fcgi
Options +ExecCGI
DirectoryIndex django.fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ django.fcgi/$1 [QSA,L]

If I comment the last line, I does not get the acces denied error and I can access my django project by both methods (directory/ and directory/django.fcgi).

Nevertheless, I need the last line of this .htaccess to get clean URLs.

Do you know what is the problem in my configuration?


Solution

  • I finally used mod_wsgi to solve my problem.