Pi-hole no web interface access and lighttpd.service failed to start

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

Hi, thanks for being part of this great project. I would need help as my friend google can not help me anymore

Expected Behaviour:

Access to web interface

Actual Behaviour:

after a power outage the web interface is not accessible anymore. lighttpd refuses to start, blocking and dns over http works

Debug Token:

k999znraw2

what I did:

  1. pihole -r didn't help
~$ 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 2018-11-04 19:44:12 WIB; 18min ago
  Process: 4158 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 4148 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 4158 (code=exited, status=255)

Nov 04 19:44:12 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 04 19:44:12 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 04 19:44:12 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 04 19:44:12 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 04 19:44:12 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
Nov 04 19:44:12 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 04 19:44:12 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

thanks in advance cheers

2 Likes

Can you paste the contents of /etc/lighttpd/lighttpd.conf ?

1 Like

@RamSet , thanks for helping

server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_auth",
        "mod_expire",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
        "mod_rewrite"
)
server.document-root        = "/var/www/html"
server.error-handler-404    = "pihole/index.php"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
accesslog.filename          = "/var/log/lighttpd/access.log"
accesslog.format            = "%{%s}t|%V|%r|%s|%b"

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"

# Prevent Lighttpd from enabling Let's Encrypt SSL for every blocked domain
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"

# If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" {
    # Create a response header for debugging using curl -I
    setenv.add-response-header = (
        "X-Pi-hole" => "The Pi-hole Web interface is working!",
        "X-Frame-Options" => "DENY"
    )

    $HTTP["url"] =~ ".ttf$" {
        # Allow Block Page access to local fonts
        setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
    }
}

# Block . files from being served, such as .git, .github, .gitignore
$HTTP["url"] =~ "^/admin/\.(.*)" {
     url.access-deny = ("")

What is the output of this command?

journalctl -u lighttpd
orangepione@orangepizero:~$ journalctl -u lighttpd
-- Logs begin at Mon 2018-11-05 13:17:01 WIB, end at Mon 2018-11-05 22:54:05 WIB
Nov 05 13:17:13 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:14 orangepizero lighttpd[957]: 2018-11-05 13:17:14: (log.c.171) ope
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Main process exited, 
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Unit entered failed s
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Failed with result 'e
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Service hold-off time
Nov 05 13:17:14 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:14 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[984]: 2018-11-05 13:17:14: (log.c.171) ope
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, 
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed s
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'e
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:15 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[1016]: 2018-11-05 13:17:15: (log.c.171) op
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, 
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed s
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'e
lines 1-23...skipping...

The output is cut off, try journalctl -u lighttpd -l

orangepione@orangepizero:~$ journalctl -u lighttpd -l
-- Logs begin at Mon 2018-11-05 13:17:01 WIB, end at Mon 2018-11-05 22:55:01 WIB. --
Nov 05 13:17:13 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:14 orangepizero lighttpd[957]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:14 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:14 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[984]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:15 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[1016]: 2018-11-05 13:17:15: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:16 orangepizero lighttpd[1037]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:16 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:16 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:17 orangepizero lighttpd[1058]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

Check the permissions on this file

-rw-r--r-- 1 root root 122 Nov 4 06:25 /var/log/lighttpd/error.log

Run sudo chown www-data:www-data /var/log/lighttpd/error.log

orangepione@orangepizero:~$ sudo chown www-data:www-data /var/log/lighttpd/error.log
orangepione@orangepizero:~$ sudo ls -l /var/log/lighttpd/error.log
-rw-r--r-- 1 www-data www-data 122 Nov 4 06:25 /var/log/lighttpd/error.log

Does restarting lighttpd work now?

orangepione@orangepizero:~$ sudo service lighthttpd restart
Failed to restart lighthttpd.service: Unit lighthttpd.service not found.

the log file is may strange
sudo nano /var/log/lighttpd/error.log
2018-11-02 13:17:11: (log.c.217) server started
2018-11-04 06:25:04: (server.c.1534) logfiles cycled UID = 0 PID = 1772

sudo service lighttpd restart

Be very careful on spelling, it counts with computers.

1 Like

Thanks Dan
orangepione@orangepizero:~$ sudo service lighttpd restart
no output and

$ sudo 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 Tue 2018-11-06 00:03:38 WIB; 14s ago
  Process: 4833 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 4823 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 4833 (code=exited, status=255)

Nov 06 00:03:38 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 06 00:03:38 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 06 00:03:38 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 06 00:03:38 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
Nov 06 00:03:38 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
Nov 06 00:03:38 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 06 00:03:38 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

Check journalctl -u lighttpd -l again

-- Logs begin at Mon 2018-11-05 13:17:01 WIB, end at Tue 2018-11-06 00:05:01 WIB. --
Nov 05 13:17:13 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:14 orangepizero lighttpd[957]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:14 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:14 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:14 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:14 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[984]: 2018-11-05 13:17:14: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:15 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:15 orangepizero lighttpd[1016]: 2018-11-05 13:17:15: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:15 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:15 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:15 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:16 orangepizero lighttpd[1037]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Nov 05 13:17:16 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
Nov 05 13:17:16 orangepizero systemd[1]: Stopped Lighttpd Daemon.
Nov 05 13:17:16 orangepizero systemd[1]: Starting Lighttpd Daemon...
Nov 05 13:17:16 orangepizero systemd[1]: Started Lighttpd Daemon.
Nov 05 13:17:17 orangepizero lighttpd[1058]: 2018-11-05 13:17:16: (log.c.171) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
Nov 05 13:17:17 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
lines 1-39

Nothing new has been written to the log. Check the permissions on the error file again, and its contents.

orangepione@orangepizero:~$ sudo ls -l /var/log/lighttpd/error.log
-rw-r--r-- 1 www-data www-data 122 Nov 4 06:25 /var/log/lighttpd/error.log

sudo nano /var/log/lighttpd/error.log
2018-11-02 13:17:11: (log.c.217) server started
2018-11-04 06:25:04: (server.c.1534) logfiles cycled UID = 0 PID = 1772