Reinstall DietPi/help with Lighttpd Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
gpioneer
Posts: 9
Joined: Sun Dec 24, 2017 11:27 am

Reinstall DietPi/help with Lighttpd

Post by gpioneer »

Hello, I pulled out my Raspberry Pi from storage and hooked it up. All I used it for was Pi Hole. I'm not sure why but I can't access the web interface for PiHole. Everything else with PiHole runs fine but Lighttpd is the issue.

sudo service lighthttpd restart
Failed to restart lighthttpd.service: Unit lighthttpd.service not found.

I don't know what would be easier, to reinstall DietPi or try to fix Lighttpd with your help? I tried doing apt remove lighttpd and apt install lighttpd, but I don't know enough about Linux to troubleshoot further. I did try doing Pihole -f (fix command), too. All comes clear, but going to the admin console doesn't work (since lighttpd is broken)

ps is there a way to reinstall DietPi without taking out the SD card, rewriting the image on another computer, and reinstalling?
Something like a dietpi -reinstall command that will wipe everything and do a clean install without having to take out the SD card?
User avatar
Joulinar
Posts: 2025
Joined: Sat Nov 16, 2019 12:49 am

Re: Reinstall DietPi/help with Lighttpd

Post by Joulinar »

Hi,

well it depends on you, if you like to find out what happen (why your web server is not working) or if your like to quickly get it done by reinstalling your system. 8)

If you like to reinstall, I would recommend to perform a fresh and clean installation by re-flashing your SD card. But yeah, this would mean to take out the SD card. If you don't like to take out the SD card, you could try to run the following scripts as describe on this GitHub post. But there is no grantee that it will work.

Attention
Before doing this, you would need to ensure that some other device in your local network will take over DNS functionality (as PiHole will be away for 1-2 hours). Not sure if you use DHCP as well on your PiHole. If yes, it might be needed to re-activate DHCP functionality on your Internet Router.
Another option would be to reinstall lighttpd by running the following

Code: Select all

dietpi-software reinstall 84



However, if your like to find out what happen on your web server, some more information are needed.

pls try the following

Code: Select all

systemctl restart lighttpd
systemctl status lighttpd
journalctl -u lighttpd
cat /var/log/lighttpd/error.log
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gpioneer
Posts: 9
Joined: Sun Dec 24, 2017 11:27 am

Re: Reinstall DietPi/help with Lighttpd

Post by gpioneer »

Maybe resetting lighttpd would be easiest?

systemctl restart lighttpd
Job for lighttpd.service failed because the control process exited with error code.
See "systemctl status lighttpd.service" and "journalctl -xe" for details.

Code: Select all

root@DietPi:~# systemctl status lighttpd
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2020-02-01 18:45:30 CST; 30s ago
  Process: 22562 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)

Feb 01 18:45:30 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Feb 01 18:45:30 DietPi systemd[1]: Stopped Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Feb 01 18:45:30 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.

For journalctl -u lighttpd I'm not sure how to copy the entire output from the terminal window since I can't scroll up and select more :( I'm very newbie, sorry!

But here is what I can select

Code: Select all

Feb 01 18:45:29 DietPi lighttpd[22553]: 2020-02-01 18:45:29: (configfile.c.1154) source: /etc/lighttpd/conf-enabled/99-dietpi-pihole.
conf line: 33 pos: 1 parser failed somehow near here: (EOL)
Feb 01 18:45:29 DietPi lighttpd[22553]: 2020-02-01 18:45:29: (configfile.c.1154) source: find /etc/lighttpd/conf-enabled -name '*.con
f' -a ! -name 'letsencrypt.conf' -printf 'include "%p"\n' 2>/dev/null line: 3 pos: 8 parser failed somehow near here: (EOL)
Feb 01 18:45:29 DietPi lighttpd[22553]: 2020-02-01 18:45:29: (configfile.c.1154) source: /etc/lighttpd/lighttpd.conf line: 56 pos: 1 
parser failed somehow near here: (EOL)
Feb 01 18:45:29 DietPi systemd[1]: lighttpd.service: Control process exited, code=exited status=255
Feb 01 18:45:29 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Feb 01 18:45:29 DietPi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 01 18:45:29 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Feb 01 18:45:30 DietPi systemd[1]: Stopped Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: Starting Lighttpd Daemon...
Feb 01 18:45:30 DietPi lighttpd[22562]: /bin/sh: 1: /usr/share/lighttpd/create-mime.conf.pl: not found
Feb 01 18:45:30 DietPi lighttpd[22562]: Duplicate config variable in conditional 0 global: server.error-handler-404
Feb 01 18:45:30 DietPi lighttpd[22562]: 2020-02-01 18:45:30: (configfile.c.1154) source: /etc/lighttpd/conf-enabled/99-dietpi-pihole.
conf line: 33 pos: 1 parser failed somehow near here: (EOL)
Feb 01 18:45:30 DietPi lighttpd[22562]: 2020-02-01 18:45:30: (configfile.c.1154) source: find /etc/lighttpd/conf-enabled -name '*.con
f' -a ! -name 'letsencrypt.conf' -printf 'include "%p"\n' 2>/dev/null line: 3 pos: 8 parser failed somehow near here: (EOL)
Feb 01 18:45:30 DietPi lighttpd[22562]: 2020-02-01 18:45:30: (configfile.c.1154) source: /etc/lighttpd/lighttpd.conf line: 56 pos: 1 
parser failed somehow near here: (EOL)
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Control process exited, code=exited status=255
Feb 01 18:45:30 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Feb 01 18:45:30 DietPi systemd[1]: Stopped Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Feb 01 18:45:30 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 01 18:45:30 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
cat /var/log/lighttpd/error.log
empty
User avatar
Joulinar
Posts: 2025
Joined: Sat Nov 16, 2019 12:49 am

Re: Reinstall DietPi/help with Lighttpd

Post by Joulinar »

pls can you past output of

Code: Select all

grep -r 'server.error-handler-404' /etc/lighttpd/
If you at least receive 2 lines back, you can try running the following to fix Lighttpd,

Code: Select all

sed -i '/^[[:blank:]]*server.error-handler-404/d' /etc/lighttpd/lighttpd.conf
  • Note that this removes any custom 404 handler page. Pi-hole itself uses the 404 handler to show the blocking page on blocked requests.
  • If you want to disable the blocking page instead, run the above command with /etc/lighttpd/conf-available/99-dietpi-pihole.conf as target.
  • Finally (re)start Lighttpd: systemctl restart lighttpd
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gpioneer
Posts: 9
Joined: Sun Dec 24, 2017 11:27 am

Re: Reinstall DietPi/help with Lighttpd

Post by gpioneer »

Hey thank you, it got the page to work, but it is not usable, it is missing all the page elements. It looks as if Javascript were turned off or something. It's okay, I will reinstall DietPi, with the help of the tutorial you had kindly provided.

Thank you Joulinar 8)
Post Reply