Phython - Unable to start lighttpd (Fastcgi) - Raspbian Stretch

1

I am trying to build DIY project, based on the instructions from https://github.com/nathanpjones/GaragePi

I was able to successfully have it installed. But when I restarted, I am not able to access the webpage. Upon troubleshooting I found that the lighttpd service is not running.

My lighttpd conf is as follows:

    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
)

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

# BEGIN GaragePi SERVER
fastcgi.server = ("/" =>
    ((
        "socket" => "/tmp/garage-fcgi.sock",
        "bin-path" => "/home/pi/GaragePi-work/start_webserver.fcgi",
        "check-local" => "disable",
        "max-procs" => 1,
        "fix-root-scriptname" => "enable",
    ))
)

alias.url += (
    "/static/" => "/home/pi/GaragePi-work/webserver/static/",
)
#END OF GaragePi SERVER

When I try to start the lighttpd manually I get the below output

lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-04-08 10:09:54 BST; 14min ago
  Process: 785 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 776 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 785 (code=exited, status=255)

Apr 08 10:09:54 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Apr 08 10:09:54 raspberrypi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Apr 08 10:09:54 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
Apr 08 10:09:54 raspberrypi systemd[1]: lighttpd.service: Start request repeated too quickly.
Apr 08 10:09:54 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Apr 08 10:09:54 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Apr 08 10:09:54 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
sudo cat /var/log/lighttpd/error.log

2019-04-08 10:47:17: (log.c.217) server started
2019-04-08 10:47:17: (mod_fastcgi.c.1159) the fastcgi-backend /home/pi/GaragePi-                                                                                                                                                                                                                                             work/start_webserver.fcgi failed to start:
2019-04-08 10:47:17: (mod_fastcgi.c.1163) child exited with status 2 /home/pi/Ga                                                                                                                                                                                                                                             ragePi-work/start_webserver.fcgi
2019-04-08 10:47:17: (mod_fastcgi.c.1166) If you're trying to run your app as a                                                                                                                                                                                                                                              FastCGI backend, make sure you're using the FastCGI-enabled version.\nIf this is                                                                                                                                                                                                                                              PHP on Gentoo, add 'fastcgi' to the USE flags.
2019-04-08 10:47:17: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed.
2019-04-08 10:47:17: (server.c.1269) Configuration of plugins failed. Going down                                                                                                                                                                                                                                             .
2019-04-08 10:47:19: (log.c.217) server started
2019-04-08 10:47:19: (mod_fastcgi.c.1159) the fastcgi-backend /home/pi/GaragePi-work/start_webserver.fcgi failed to start:
2019-04-08 10:47:19: (mod_fastcgi.c.1163) child exited with status 2 /home/pi/GaragePi-work/start_webserver.fcgi
2019-04-08 10:47:19: (mod_fastcgi.c.1166) If you're trying to run your app as aFastCGI backend, make sure you're using the FastCGI-enabled version.\nIf this is                                                                                                                                                                                                                                              PHP on Gentoo, add 'fastcgi' to the USE flags.
2019-04-08 10:47:19: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed.
2019-04-08 10:47:19: (server.c.1269) Configuration of plugins failed. Going down

I tried accessing the /var/run/lighttpd and I get permission denied when using the pi account

Could someone please help me in resolving this issue, as I have no knowledge with python, and trying to learn it atm

Any help would be greatly appreciated

Thanks Akay.

akay0402

Posted 2019-04-08T09:28:08.683

Reputation: 11

No answers