Admin page does not load despite pihole running fine

This is a continuation of a thread i made. Long story short, i screwed up my raspi and had to start over from scratch. I copied the config files over, and pihole runs fine however the admin page refuses to load. I think something went wrong along the way.

I have my pi's static IP as 192.168.2.200

nslookup pi.hole

Server:		192.168.2.1
Address:	192.168.2.1#53

** server can't find pi.hole: NXDOMAIN
nslookup pi.hole 192.168.2.200

Server:		192.168.2.200
Address:	192.168.2.200#53

Name:	pi.hole
Address: 192.168.2.200
Name:	pi.hole
Address: fe80::58e4:1db8:a7ec:7e5d
nslookup 192.168.2.200

** server can't find 200.2.168.192.in-addr.arpa: NXDOMAIN

pihole -d errors


*** [ DIAGNOSING ]: Pi-hole processes
[✗] lighttpd daemon is failed
[✓] pihole-FTL daemon is active


*** [ DIAGNOSING ]: Dashboard headers
[✗] Web interface X-Header: X-Header does not match or could not be retrieved.



*** [ DIAGNOSING ]: contents of /etc/lighttpd/conf.d
/etc/lighttpd/conf.d does not exist.

oddly, even though the static ip is 192.168.2.200, hostname -i says

127.0.1.1

i followed this guide and made sure the permissions were correct

service lighttpd status
× lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; preset: ena>
     Active: failed (Result: exit-code) since Thu 2025-03-06 13:51:55 EST; 1h 5>
    Process: 22894 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttp>
        CPU: 37ms

Mar 06 13:51:55 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job>
Mar 06 13:51:55 raspberrypi systemd[1]: Stopped lighttpd.service - Lighttpd Dae>
Mar 06 13:51:55 raspberrypi systemd[1]: lighttpd.service: Start request repeate>
Mar 06 13:51:55 raspberrypi systemd[1]: lighttpd.service: Failed with result 'e>
Mar 06 13:51:55 raspberrypi systemd[1]: Failed to start lighttpd.service - Ligh>

journalctl -u lighttpd
Feb 13 21:19:00 raspberrypi systemd[1]: Starting lighttpd.service - Lighttpd Da>
Feb 13 21:19:01 raspberrypi systemd[1]: Started lighttpd.service - Lighttpd Dae>
Feb 13 21:20:34 raspberrypi systemd[1]: Stopping lighttpd.service - Lighttpd Da>
Feb 13 21:20:34 raspberrypi systemd[1]: lighttpd.service: Deactivated successfu>
Feb 13 21:20:34 raspberrypi systemd[1]: Stopped lighttpd.service - Lighttpd Dae>
Feb 13 21:20:34 raspberrypi systemd[1]: Starting lighttpd.service - Lighttpd Da>
Feb 13 21:20:34 raspberrypi systemd[1]: Started lighttpd.service - Lighttpd Dae>
Feb 13 21:49:33 raspberrypi sudo[15018]: www-data : PWD=/var/www/html/admin/scr>
Feb 13 21:49:33 raspberrypi sudo[15018]: pam_unix(sudo:session): session opened>
Feb 13 21:50:46 raspberrypi sudo[15018]: pam_unix(sudo:session): session closed>
Feb 13 21:59:46 raspberrypi systemd[1]: Stopping lighttpd.service - Lighttpd Da>
Feb 13 21:59:46 raspberrypi systemd[1]: lighttpd.service: Deactivated successfu>
Feb 13 21:59:46 raspberrypi systemd[1]: Stopped lighttpd.service - Lighttpd Dae>
Feb 13 21:59:46 raspberrypi systemd[1]: lighttpd.service: Consumed 34.176s CPU >
-- Boot 022f89322c3142308835c3563013624a --
Feb 13 21:59:59 raspberrypi systemd[1]: Starting lighttpd.service - Lighttpd Da>
Feb 13 22:00:00 raspberrypi lighttpd[1077]: 2025-02-14 02:59:59: (configfile.c.>
Feb 13 22:00:00 raspberrypi lighttpd[1077]: 2025-02-14 02:59:59: (configfile.c.>
Feb 13 22:00:00 raspberrypi lighttpd[1077]: 2025-02-14 02:59:59: (configfile.c.>
Feb 13 22:00:00 raspberrypi systemd[1]: lighttpd.service: Control process exite>
Feb 13 22:00:00 raspberrypi systemd[1]: lighttpd.service: Failed with result 'e>
Feb 13 22:00:00 raspberrypi systemd[1]: Failed to start lighttpd.service - Ligh>
Feb 13 22:00:00 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job>


Expected Behaviour: pihole admin page loads

Actual Behaviour:
it does not

Debug Token: 7ndM7xnr

OS: Debian GNU/Linux 12 (bookworm) aarch64
Host: Raspberry Pi 4 Model B Rev 1.2
Kernel: Linux 6.6.74+rpt-rpi-v8

Thanks!

Try to restart the web server executing:

sudo systemctl restart lighttpd

If this doesn't work, post the output of:

sudo systemctl status lighttpd

restart unsuccessful

sudo systemctl status lighttpd
× lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; preset: ena>
     Active: failed (Result: exit-code) since Thu 2025-03-06 16:06:30 EST; 8s a>
    Process: 52918 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttp>
        CPU: 37ms

Mar 06 16:06:30 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job>
Mar 06 16:06:30 raspberrypi systemd[1]: Stopped lighttpd.service - Lighttpd Dae>
Mar 06 16:06:30 raspberrypi systemd[1]: lighttpd.service: Start request repeate>
Mar 06 16:06:30 raspberrypi systemd[1]: lighttpd.service: Failed with result 'e>
Mar 06 16:06:30 raspberrypi systemd[1]: Failed to start lighttpd.service - Ligh>


What is the output of lighttpd -tt -f /etc/lighttpd/lighttpd.conf?

(Please, post the full output without cutting the end of the lines, like you did above.)

pi@raspberrypi:~ $ lighttpd -tt -f /etc/lighttpd/lighttpd.conf
2025-03-06 16:12:01: (configfile.c.2109) source: /etc/lighttpd/conf-enabled/10-accesslog.conf line: 1 pos: 7 invalid character in variable name
2025-03-06 16:12:01: (configfile.c.2161) configfile parser failed at: IntxLNK
2025-03-06 16:12:01: (configfile.c.2164) source: /etc/lighttpd/lighttpd.conf line: 74 pos: 0 parser failed somehow near here: (EOL)

What is the output of cat /etc/lighttpd/conf-enabled/10-accesslog.conf?

pi@raspberrypi:~ $ cat /etc/lighttpd/conf-enabled/10-accesslog.conf
IntxLNK../conf-available/10-accesslog.confpi@raspberrypi:~ $ 

it seemed like it was "hung" , and ctrl+C returned the command line to its normal position.

This file is corrupted.

It should contain:

server.modules += ( "mod_accesslog" )

accesslog.filename = "/var/log/lighttpd/access.log"

Edit the file (using the contents from above), save it and try to restart lighttpd again.


Note sure if this corruption happened only in this file or if this is a general disk / SD card failure.

If your disk is failing, I suggest you to reinstall the OS on a different disk/SD card and start again.

pi@raspberrypi:~ $ cat /etc/lighttpd/conf-enabled/10-accesslog.conf
server.modules += ( "mod_accesslog" )

accesslog.filename = "/var/log/lighttpd/access.log"

got it added but there is nothing else in the file i think it was corrupted when i had my original issue (here) I tried updating from buster to bullseye and apparently thats not even a possible thing to do with a running install. anyway...

i rebooted the machine and still nothing. lighttpd still doesnt run. is it something i can unintstall/reinstall?

What is the output of lighttpd -tt -f /etc/lighttpd/lighttpd.conf after fixing the file and rebooting?

$ lighttpd -tt -f /etc/lighttpd/lighttpd.conf
2025-03-08 08:11:59: (configfile.c.2109) source: /etc/lighttpd/conf-enabled/10-fastcgi.conf line: 1 pos: 7 invalid character in variable name
2025-03-08 08:11:59: (configfile.c.2161) configfile parser failed at: IntxLNK
2025-03-08 08:11:59: (configfile.c.2164) source: /etc/lighttpd/lighttpd.conf line: 74 pos: 0 parser failed somehow near here: (EOL)

Looks like /etc/lighttpd/conf-enabled/10-fastcgi.conf is also broken.
Check the file and try to fix it.

The original file looks like this:

# /usr/share/doc/lighttpd/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi

server.modules += ( "mod_fastcgi" )

Maybe your SD card is corrupted and other files are also broken.

i think we are getting closer. i dont suspect the SD card is failing because it is ~1 year old. i think this is because i copied files from the sd card when i was updating the system, as mentioned in my original issue post, which i linked previously. the files i copied from the recovery phase were corrupted when they were copied, i believe. but what to do about the corrupt files?

$ sudo systemctl status lighttpd
× lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; preset: ena>
     Active: failed (Result: exit-code) since Sat 2025-03-08 16:29:57 EST; 2min>
    Process: 1301 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd>
        CPU: 41ms

Mar 08 16:29:57 raspberrypi systemd[1]: lighttpd.service: Scheduled restart job>
Mar 08 16:29:57 raspberrypi systemd[1]: Stopped lighttpd.service - Lighttpd Dae>
Mar 08 16:29:57 raspberrypi systemd[1]: lighttpd.service: Start request repeate>
Mar 08 16:29:57 raspberrypi systemd[1]: lighttpd.service: Failed with result 'e>
Mar 08 16:29:57 raspberrypi systemd[1]: Failed to start lighttpd.service - Ligh>


*** [ DIAGNOSING ]: Pi-hole processes
[✗] lighttpd daemon is failed
[✓] pihole-FTL daemon is active



*** [ DIAGNOSING ]: Dashboard headers
[✗] Web interface X-Header: X-Header does not match or could not be retrieved.


#strange one here
*** [ DIAGNOSING ]: contents of /etc/lighttpd/conf.d
/etc/lighttpd/conf.d does not exist.

TTGLxgR2

Lighttpd is still failing to start, but this is not a bug. This is caused by corrupted config files.

Delete and replace them with fresh files.

is it possible to remove and reinstall lighttpd?

better question, is it as easy as reinstalling lighttpd? how would you suggest replacing the files with fresh ones?

Every time users had corrupted files, the solution was to reinstall the whole OS.

In your case, apparently the issue is related to copying files from a previously corrupted SD card into a new OS.

(I need to ask: Why did you do that???)

To be honest, I don't know if these files will be removed if you uninstall lighttpd and reinstall it. I don't have a Pi-hole v5 instance to test that (I always had v5 only in a docker container).

Maybe you need to do both: delete the old files and then reinstall lighttpd.

the reason why i copied the files was because i wanted to keep the configuration of pihole v5, as i didnt have a teleport backup since when i set up this pihole that wasnt a thing! (it had NOOBS on the card, thats how old this was. circa 2020. i had been updating it periodically and i saw v5 was ending support or something on the older raspiOS, so time to upgrade) So i wanted those configurations since thats really the only thing that I need for the new install besides re-establishing the static IP address. i didnt back it up because i was a silly billy and also didnt know that apparently, you cant even do that. SO....

i have purged and reinstalled lighttpd and it still refuses to start, oddly. i would've thought purging would have removed the old files. i will update with further digging

Actually Pi-hole v6 also works on Raspberry Pi OS.

Pi-hole v6 doesn't use lighttpd or PHP (less dependencies) and it has many new features.

Why are you still using Pi-hole v5?