0

I get that in /var/log/lighttpd/error.log after start attempt:

2021-04-04 14:47:21: (server.c.1488) server started (lighttpd/1.4.55) 2021-04-04 14:47:21: (gw_backend.c.1404) invalid "bin-path" => "/usr/bin/cgi-bin" (check that file exists, is regular file, and is executable by lighttpd) 2021-04-04 14:47:21: (gw_backend.c.1452) --- gw spawning local \n\tproc: /usr/bin/cgi-bin \n\tport: 0 \n\tsocket /tmp/hello_fastcgi.sock \n\tmin-procs: 2 \n\tmax-procs: 2 2021-04-04 14:47:21: (gw_backend.c.1476) --- gw spawning \n\tport: 0 \n\tsocket /tmp/hello_fastcgi.sock \n\tcurrent: 0 / 2 2021-04-04 14:47:21: (gw_backend.c.451) new proc, socket: 0 /tmp/hello_fastcgi.sock-0 2021-04-04 14:47:21: (gw_backend.c.468) unlink /tmp/hello_fastcgi.sock-0 after connect failed: Connection refused 2021-04-04 14:47:21: (gw_backend.c.324) child exited: 13 unix:/tmp/hello_fastcgi.sock-0 2021-04-04 14:47:21: (gw_backend.c.599) gw-backend failed to start: /usr/bin/cgi-bin 2021-04-04 14:47:21: (gw_backend.c.601) 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. If this is PHP, try removing the bytecode caches for now and try again. 2021-04-04 14:47:21: (gw_backend.c.1490) [ERROR]: spawning gw failed. 2021-04-04 14:47:21: (server.c.1496) Configuration of plugins failed. Going down.

Start attempt is

sudo lighttpd -D -f lighttpd.conf

followed by

/usr/bin/cgi-bin: Permission denied

in terminal output. Previously, I tried

sudo chown -R lighttpd:lighttpd /usr/bin/cgi-bin/
sudo chmod 755 /usr/bin/cgi-bin/

with no affect on server start. My configuration lighttpd.conf is:

server.username             = "lighttpd"
server.groupname            = "lighttpd"
server.port                 = 80
server.modules += (
    "mod_compress",
    "mod_dirlisting",
    "mod_staticfile",
    "mod_fastcgi"  
)
fastcgi.debug = 1
fastcgi.server = (
  "/hello" => ((
    "bin-path" => "/usr/bin/cgi-bin",
    "socket" => "/tmp/hello_fastcgi.sock",
    "check-local" => "disable",
    "max-procs" => 2,
  ))
)

I am using script from here: GitHub. How to run it properly?

1 Answers1

1

The error message says

invalid "bin-path" => "/usr/bin/cgi-bin" (check that file exists, is regular file, and is executable by lighttpd)

bin-path should be a regular file, not a directory. It should be the path to your application script. See for example Lighttpd and FastCGI.

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47