Я получаю это в /var/log/lighttpd/error.log после попытки запуска:

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.

Попытка начала

sudo lighttpd -D -f lighttpd.conf

с последующим

/usr/bin/cgi-bin: Permission denied

в выводе терминала. Раньше пробовал

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

без влияния на запуск сервера. Моя конфигурация lighttpd.conf:

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,
  ))
)

Я использую скрипт отсюда: GitHub . Как его правильно запустить?

answer

В сообщении об ошибке говорится

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

bin-pathдолжен быть обычным файлом, а не каталогом. Это должен быть путь к вашему сценарию приложения. См. Например Lighttpd и FastCGI .