Lighttpd errors while enabling HTTPS

hi,

this is the last bit of configuring i'd like to do on my pihole (for now) and even though the process has confounded me pretty severely at times, i've finally managed to work myself past all the problems i had getting a certificate up and whatnot and at long last i was justrr one restart away from being done and this happens:

pi@raspberrypi:~ $ 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.

bringing up the indicated commands gives me:

pi@raspberrypi:~ $ 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 Sun 2019-02-17 18:25:32 PST; 13min ago_
_ Process: 4582 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)_
_ Process: 5018 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)_
_ Main PID: 4582 (code=exited, status=0/SUCCESS)_

Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Control process exited, code=exited status=255
Feb 17 18:25:32 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Feb 17 18:25:32 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Start request repeated too quickly.
Feb 17 18:25:32 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 17 18:25:32 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.

and:

pi@raspberrypi:~ $ journalctl -xe
-- Unit lighttpd.service has failed.
_-- _
-- The result is failed.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Feb 17 18:41:33 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
-- Subject: Unit lighttpd.service has finished shutting down
-- Defined-By: systemd
-- Support: Debian -- Support
_-- _
-- Unit lighttpd.service has finished shutting down.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Start request repeated too quickly.
Feb 17 18:41:33 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
-- Subject: Unit lighttpd.service has failed
-- Defined-By: systemd
-- Support: Debian -- Support
_-- _
-- Unit lighttpd.service has failed.
_-- _
-- The result is failed.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Feb 17 18:41:33 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.

frankly, i'm utterly clueless as to what has gone wrong here. the only way to restore lighttpd functionality is to delete the external.conf file, which is what i plan to do for now. but i would still very much like to make this work. is there anything anyone can suggest that could fix this issue for me?

(and yes, my knowledge of *nix is limited -- or just enough to be a danger to myself and my pi.)

thanks in advance!

Mod Edit: Moved from Enabling HTTPS for your Pi-hole Web Interface

If the issue is fixed by removing external.conf, then it may be that your version of lighttpd is too new for the config we ship. There have been some breaking changes in how lighttpd reads the config. Run pihole -d for a debug token.

Your debug token is: bue85wi6eu

thanks again for helping! i would totally appreciate it if there is anything that jumps out at you besides the lighttpd issues -- still very noobish here and i'm sure i've messed up something along the way.

What is the output of these commands?

lighttpd -t -f /etc/lighttpd/lighttpd.conf
lighttpd -t -f /etc/lighttpd/external.conf
sudo service lighttpd restart
sudo service lighttpd status -l

root@raspberrypi:/home/pi# lighttpd -t -f /etc/lighttpd/lighttpd.conf

2019-02-18 15:39:32: (configfile.c.1154) source: cat external.conf 2>/dev/null line: 21 pos: 1 parser failed somehow near here: (EOL)
2019-02-18 15:39:32: (configfile.c.1154) source: /etc/lighttpd/lighttpd.conf line: 77 pos: 1 parser failed somehow near here: (EOL)
root@raspberrypi:/home/pi# lighttpd -t -f /etc/lighttpd/external.conf
2019-02-18 15:40:04: (configfile.c.1154) source: /etc/lighttpd/external.conf line: 21 pos: 1 parser failed somehow near here: (EOL)

root@raspberrypi:/home/pi# lighttpd -t -f /etc/lighttpd/external.conf

2019-02-18 15:40:04: (configfile.c.1154) source: /etc/lighttpd/external.conf line: 21 pos: 1 parser failed somehow near here: (EOL)

root@raspberrypi:/home/pi# 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.

root@raspberrypi:/home/pi# service lighttpd status -l

lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-02-18 15:40:36 PST; 1min 6s ago
Process: 17001 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Main PID: 15870 (code=exited, status=0/SUCCESS)

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

What are the contents of /etc/lighttpd/external.conf?

$HTTP["host"] == "my.domain.com" {
  # Ensure the Pi-hole Block Page knows that this is not a blocked domain
  setenv.add-environment = ("fqdn" => "true")

  # Enable the SSL engine with a LE cert, only for this specific host
  $SERVER["socket"] == ":443" {
    ssl.engine = "enable"
    ssl.pemfile = "/etc/letsencrypt/live/my.domain.com/combined.pem"
    ssl.ca-file =  "/etc/letsencrypt/live/my.domain.com/fullchain.pem"
    ssl.honor-cipher-order = "enable"
    ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
    ssl.use-sslv2 = "disable"
    ssl.use-sslv3 = "disable"       
  }
  # Redirect HTTP to HTTPS
  $HTTP["scheme"] == "http" {
    $HTTP["host"] =~ ".*" {
      url.redirect = (".*" => "https://%0$0")
    }
  }

Add a final } to the end, your brackets are unbalanced.

1 Like

sigh. that did the trick. i'm so sorry i wasted everyones time with this. i'll make an extra donation as penance. :smile:

2 Likes

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