Debian – Lighttpd with FastCGI won’t create /tmp/fcgi.sock on startup

debianfastcgilighttpdpythonsocket

I'm running lighttpd-1.4.19 on a debian 5 box and try to run web2py with fastcgi. The problem with that is, that lighttpd does not create the socket file /tmp/fcgi.sock.

If I'm creating the file by myself

 touch /tmp/fcgi.sock

lighttpd will start but will throw this error after some time running:

unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: unix:/tmp/fcgi.sock

My config looks like this:

fastcgi.server = (
  "/handler_web2py.fcgi" => (
      "handler_web2py" => ( #name for logs
        "check-local" => "disable",
        "socket" => "/tmp/fcgi.sock",
        "idle-timeout" => 20,
        "max-procs" => 1
      )
   ),
)

Is there any known problem with running lighttpd on debian 5?

Thanks for any help.

I have pasted the whole lighttpd config: http://pastie.org/1660646

Best Answer

Make sure that when you 'touch' the file that lighttpd still has permissions to access the file.

Secondly, check to make sure that the scgi mod is enabled in lighttpd conf

Lastly, if it is binding to a port less than 1024 (likely is) it needs root or super user level privileges to bind. sudo should be able to have the socket bind to a lower port.

EDIT: ran a quick google search of the error and found this: https://stackoverflow.com/questions/4353351/error-while-setupping-django-under-lighttpd-fastcgi