Lighttpd won't start after raspberry update

Hi.

I installed a pihole some days ago for the first time, and everything went fine directly from the start. No problems, blocking works, everything was good.

But then I updated the raspberry from the actual repository deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi.

The system wanted to upgrade the linux-libc-dev, raspberrypi-kernel and raspberrypi-bootloader.

After installation and reboot I updated the pihole with -up, and the system showed me that everything was ok.

But it wasn't. The lighttpd will not start since then. I got multiple errors, which I could follow to:

Mar 24 19:49:30 pihole lighttpd[7703]: Duplicate config variable in conditional 2 global / $HTTP["url"] =~ "^/admin/": server.document-root
Mar 24 19:49:30 pihole lighttpd[7703]: 2023-03-24 19:49:28: configfile.c.1970) source: /etc/lighttpd/conf.d/pihole-admin.conf line: 19 pos: 32 parser failed somehow near here: (EOL)
Mar 24 19:49:30 pihole lighttpd[7703]: 2023-03-24 19:49:28: configfile.c.1970) source: /etc/lighttpd/lighttpd.conf line: 56 pos: 1 parser failed somehow near here: (EOL)
Mar 24 19:49:30 pihole systemd[1]: lighttpd.service: Control process exited, code=exited, status=255/EXCEPTION

I checked the pihole-admin.conf and the lighttpd.conf. They look like they should be. The pihole-admin.conf's line 19, pos 32 is directly behind "body" in server.stream-response-body = 1:

server.errorlog := "/var/log/lighttpd/error-pihole.log"

$HTTP["url"] =~ "^/admin/" {
    server.document-root = "/var/www/html"
    server.stream-response-body = 1
    accesslog.filename = "/var/log/lighttpd/access-pihole.log"
    accesslog.format = "%{%s}t|%h|%V|%r|%s|%b"

It looks like lighttpd cannot work with the actual pihole-admin.conf. Or did I miss something?

Regards,
Lalle

Debug Token:

https://tricorder.pi-hole.net/mbHNSFOR/

Your lighttpd config files are mixing Debian and Fedora/CentOS configurations.

On /etc/lighttpd/lighttpd.conf, these 2 lines shoudn't exist at the same time:

   ...
   include "/etc/lighttpd/conf-enabled/*.conf"
   ...
   include "/etc/lighttpd/conf.d/pihole-admin.conf"

The first one is used by Debian and derivatives. The second one is used by Fedora/CentOS.

You also have 2 files with the same contents and both are being loaded:

  • /etc/lighttpd/conf-enabled/15-pihole-admin.conf
  • /etc/lighttpd/conf.d/pihole-admin.conf (this file is used by Fedora/CentOS and shouldn't exist on Debian)

Removing the include "/etc/lighttpd/conf.d/pihole-admin.conf" line from /etc/lighttpd/lighttpd.conf and restarting lighttpd should fix the issue.

Your are right. Thank you so much.

But why did this happen? I changed nothing in these files manually.

Or is it possible that the update created a softlink in the conf-enabled directory?

lighttpd creates the conf-available and conf-enabled directories.

Pi-hole installer installs the pi-hole related files and create symlinks if needed.

I don't know how this was created, but the /etc/lighttpd/conf.d/ directory is not created by Pi-hole or lighttpd on Debian.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.