Eu instalei o lightpd em um Raspberry Pi (executando o Raspbian Stretch) desta forma:
apt-get install -y lighttpd php-common php-cgi php
lighty-enable-mod fastcgi-php
usermod -aG www-data pi
depois de iniciar o serviço eu verifiquei e funcionou bem, servindo as páginas web do php conforme o esperado. Após a reinicialização, o serviço não inicia mais:
$ systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-09-09 21:26:39 CEST; 6min ago
Process: 1302 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Process: 1295 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 1302 (code=exited, status=255)
Sep 09 21:26:38 rpi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Sep 09 21:26:39 rpi systemd[1]: Stopped Lighttpd Daemon.
Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Start request repeated too quickly.
Sep 09 21:26:39 rpi systemd[1]: Failed to start Lighttpd Daemon.
Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Unit entered failed state.
Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Aqui o arquivo de configuração:
$ cat /etc/lighttpd/lighttpd.conf
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
)
server.document-root = "/home/pi/www"
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"
O que devo verificar?