Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run django on lighttpd but I'm not able to do it. In logs I see this:

2014-05-30 13:45:32: (log.c.166) server started 
2014-05-30 13:45:32: (mod_fastcgi.c.1103) the fastcgi-backend /var/www/mysite/mysite.fcgi failed to start: 
2014-05-30 13:45:32: (mod_fastcgi.c.1107) child exited with status 8 /var/www/mysite/mysite.fcgi 
2014-05-30 13:45:32: (mod_fastcgi.c.1110) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags. 
2014-05-30 13:45:32: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed. 
2014-05-30 13:45:32: (server.c.1021) Configuration of plugins failed. Going down. 

Here's my mysite.fcgi config file:

import sys, os
sys.path.insert(0, '/var/www')

ROOT_PATH = os.getcwd()

os.environ["DJANGO_SETTINGS_MODULE"] = "mysite.settings"
from django.core.servers.fastcgi import runfastcgi

    pidfile=ROOT_PATH + "/run/mysite.pid"

Here's lighttpd config file:

var.mysite-root = "/var/www/mysite/"

$HTTP["host"] == "mysite" {

        url.rewrite-once = (
                "^(/.*)$" => "/mysite$1"
    fastcgi.server = (
        "/mysite" => (
            "main" => (
                "socket" => var.mysite-root + "run/mysite.sock",
                "bin-path" => var.mysite-root + "mysite.fcgi",
                "max-procs" => 3,
                "check-local" => "disable",
                "fix-root-scriptname" => "enable",

I have mod_fastcgi enabled in lighttpd.conf:

server.modules = (

I also have this line in my settings.py file:

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.