Нагугленная связка не работает. /etc/lighttpd.conf (фрагмент)
$HTTP["host"] == "new.test.startapp.tk" {
fastcgi.server = (
"/fcgi" => (
"main" => (
"socket" => var.startapptk-root + "run/startapptk.sock",
"bin-path" => var.startapptk-root + "interface.fcgi",
"max-procs" => 3,
"check-local" => "disable",
"fix-root-scriptname" => "enable",
)
)
)
alias.url += (
"/static" => var.startapptk-root + "static"
)
url.rewrite-once = (
"^(/static.*)$" => "$1",
"^(/media.*)$" => "$1",
"^/favicon\.ico$" => "/static/favicon.ico",
"^(/.*)$" => "/fcgi$1",
)
}
#!/usr/bin/env python
import sys, os
sys.path.insert(0, '/home/startapp/django')
ROOT_PATH = os.getcwd()
os.environ["DJANGO_SETTINGS_MODULE"] = "startapp_tk.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(
method="threaded",
daemonize="false",
pidfile=ROOT_PATH + "/run/startapptk.pid"
)
При обращении к /fcgi открывается, при обращении к корню выводится «It work». В остальных случаях 404.