Lighttpd daemon won't start

Please follow the below template, it will help us to help you!

Expected Behaviour:

lighttpd daemon starts and web interface is accessible

Actual Behaviour:

[โœ—] lighttpd daemon is failed

Debug Token:

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

Hello,

I am running Nextcloud on port 80 and Pihole on 8888. I wanted to install "open office" document server for Nextcloud and followed a few tutorials on it. I think installing docker and docker-compose along with some other things caused lighttpd to stop working. I have since uninstalled docker and docker-compose. Nextcloud still loads fine, its just lighttpd won't run and thus I can't access the web interface for Pihole.

Thanks for any help, its much appreciated!

lighttpd will not start because apache2 is currently running and bound to port 80.

[80] is in use by apache2 (https://docs.pi-hole.net/main/prerequisites/#ports)

Yes I know so I edited the lighttpd.conf file and also the external.conf file and set the port to 8888. It's worked fine for weeks now until I tried to install the docker related things.

I've been accessing like: http://192.168.x.x:8888/admin/

Here is some more details. If I try to restart lighttpd:

$ sudo service lighttpd restart

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

sudo systemctl status lighttpd -l


โ— lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2021-03-03 01:23:03 GMT; 1min 1s ago
  Process: 6396 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)

Mar 03 01:23:03 nextcloudpi systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.
Mar 03 01:23:03 nextcloudpi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Mar 03 01:23:03 nextcloudpi systemd[1]: Stopped Lighttpd Daemon.
Mar 03 01:23:03 nextcloudpi systemd[1]: lighttpd.service: Start request repeated too quickly.
Mar 03 01:23:03 nextcloudpi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Mar 03 01:23:03 nextcloudpi systemd[1]: Failed to start Lighttpd Daemon.

Good information to include in your original post.

Run that command and see what the error is.

sudo /usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf

Sorry about that, I mean't this with "Pihole on 8888". Many thanks for the quick responses! Here is what I get:

sudo /usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
Duplicate config variable in conditional 0 global: server.port
2021-03-03 01:40:46: (configfile.c.1296) source: cat external.conf 2>/dev/null line: 2 pos: 1 parser failed somehow near here: (EOL) 
2021-03-03 01:40:46: (configfile.c.1296) source: /etc/lighttpd/lighttpd.conf line: 116 pos: 1 parser failed somehow near here: (EOL)

You have two or more server.port lines in your lighttpd.conf file and/or external.conf file.

Ok this fixed it thank you!

I don't understand as I followed the below and it had worked this whole time. I ran a Pihole update today so I guess something in the new version. The second server port was in my external.conf file as instructed from the below:

###############################################################################
#     FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.     #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#              CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE:              #
#                         /etc/lighttpd/external.conf                         #
###############################################################################

Our original lighttpd.conf file uses server.port = 80. Your lighttpd.conf file was modified in some way and either has been modified to be read-only or you haven't run a pihole -up since the file was modified.

Edit: Source => pi-hole/lighttpd.conf.debian at cbfb58f7a283c2a3e7aad95a834a0287175ccb24 ยท pi-hole/pi-hole ยท GitHub

Ah ok I get it, I had updated lighttpd.conf to 8888 and then later did the external.conf with the same. That makes sense it was conflicting then. Strange it didn't have this issue until today as I did this weeks ago. But thanks again for your help, have a great day!

1 Like

lighttdp.conf will be overwritten on Pi-hole updates.

What's your lighttpd version?

lighttpd -v

If that returns 1.4.46 or above, you should be able to overwrite the port from Pi-hole's lighttpd.conf in your external.conf like this:

server.port := 8888

Note that the := operator isn't supported in older versions of lighttpd.

3 Likes

Thank you! This worked for me

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