Pihole running, but can't access admin page

Expected Behaviour:

Accessing admin page via http://[ip_address]/admin should load.

Actual Behaviour:

Getting Site cannot be reached error. I've tried in several browsers.

Debug Token:

s93z96k24v

It was all working perfectly for several months, then it stopped when I tried to add a new list. Ultimately I completely reconfigured it (without saving settings). Now, I can ssh into the orange pi, and pihole says everything is fine, but the admin page won't load. I currently have DHCP and DNS on the router, bypassing the pihole, so I don't know if it's actually blocking anything. I'm hesitant to configure anything else until I can get the admin page up.

Currently, I'm getting:

$ pihole status
  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled
$ pihole enable
  [i] Blocking already enabled, nothing to do
$ curl -I http://localhost/admin/
curl: (7) Failed to connect to localhost port 80: Connection refused

I recently had the same issue. What resolved it was: sudo service lighttpd restart

Don't ask me why a reboot or shutdown didn't work, but that CLI did. Still a mystery.

1 Like

Sadly, that doesn't fix it. Still unable to resolve the admin page.

Verify that you have port 80 specified in the lighttpd.conf file.See my example below.

cd /etc/lighttpd/
sudo nano lighttpd.conf

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"

What is the output of these commands?

service lighttpd status
journalctl -u lighttpd

@n6vmo all those settings are correct

@Mcat12 output is below

service lighttpd status
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-05-18 12:26:05 UTC; 9h ago
  Process: 4524 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 4513 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 4524 (code=exited, status=255)

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

journalctl -u lighttpd
-- Logs begin at Sat 2019-05-18 14:39:41 UTC, end at Sun 2019-05-19 20:36:57 UTC. --
May 19 20:36:53 orangepizero systemd[1]: Starting Lighttpd Daemon...
May 19 20:36:53 orangepizero systemd[1]: Started Lighttpd Daemon.
May 19 20:36:53 orangepizero lighttpd[23774]: 2019-05-19 20:36:53: (log.c.171) opening errorlog '/var/log/lighttpd/error
May 19 20:36:53 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 19 20:36:53 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:53 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
May 19 20:36:54 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 19 20:36:54 orangepizero systemd[1]: Stopped Lighttpd Daemon.
May 19 20:36:54 orangepizero systemd[1]: Starting Lighttpd Daemon...
May 19 20:36:54 orangepizero systemd[1]: Started Lighttpd Daemon.
May 19 20:36:54 orangepizero lighttpd[23797]: 2019-05-19 20:36:54: (log.c.171) opening errorlog '/var/log/lighttpd/error
May 19 20:36:54 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 19 20:36:54 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:54 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
May 19 20:36:54 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 19 20:36:54 orangepizero systemd[1]: Stopped Lighttpd Daemon.
May 19 20:36:54 orangepizero systemd[1]: Starting Lighttpd Daemon...
May 19 20:36:55 orangepizero systemd[1]: Started Lighttpd Daemon.
May 19 20:36:55 orangepizero lighttpd[23818]: 2019-05-19 20:36:55: (log.c.171) opening errorlog '/var/log/lighttpd/error
May 19 20:36:55 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 19 20:36:55 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:55 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
May 19 20:36:55 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 19 20:36:55 orangepizero systemd[1]: Stopped Lighttpd Daemon.
May 19 20:36:55 orangepizero systemd[1]: Starting Lighttpd Daemon...
May 19 20:36:55 orangepizero systemd[1]: Started Lighttpd Daemon.
May 19 20:36:56 orangepizero lighttpd[23838]: 2019-05-19 20:36:55: (log.c.171) opening errorlog '/var/log/lighttpd/error
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 19 20:36:56 orangepizero systemd[1]: Stopped Lighttpd Daemon.
May 19 20:36:56 orangepizero systemd[1]: Starting Lighttpd Daemon...
May 19 20:36:56 orangepizero systemd[1]: Started Lighttpd Daemon.
May 19 20:36:56 orangepizero lighttpd[23860]: 2019-05-19 20:36:56: (log.c.171) opening errorlog '/var/log/lighttpd/error
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:56 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.
May 19 20:36:57 orangepizero systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart.
May 19 20:36:57 orangepizero systemd[1]: Stopped Lighttpd Daemon.
May 19 20:36:57 orangepizero systemd[1]: lighttpd.service: Start request repeated too quickly.
May 19 20:36:57 orangepizero systemd[1]: Failed to start Lighttpd Daemon.
May 19 20:36:57 orangepizero systemd[1]: lighttpd.service: Unit entered failed state.
May 19 20:36:57 orangepizero systemd[1]: lighttpd.service: Failed with result 'exit-code'.

Your output is cut off, but from what I see it looks like you don't have correct permissions on /var/log/lighttpd. Make sure that folder and anything in it is able to be read and written to by the www-data user.

I've updated the journalctl with the full output after attempting to restart again.

I tried to add the permissions (I think), but it wasn't working.

$ cd /var/log
$ ls -l lighttpd
total 0
-rw-r--r-- 1 root root 0 May 15 16:45 access.log
-rw-r--r-- 1 root root 0 May 15 16:45 error.log
$ chmod uog+rw lighttpd
$ ls -l lighttpd/access.log
total 0
-rw-rw-rw- 1 root root 0 May 15 16:45 access.log
-rw-r--r-- 1 root root 0 May 15 16:45 error.log
$ ls -l lighttpd/error.log
total 0
-rw-rw-rw- 1 root root 0 May 15 16:45 access.log
-rw-rw-rw- 1 root root 0 May 15 16:45 error.log

Restarted the service again, and no change in the journal, and admin still doesn't load.

Make sure it can access the folder. What is the output of this command?

ls -al /var/log/lighttpd
$ ls -al /var/log/lighttpd
drwxrwxrw- 2 root root 4096 May 15 16:45 .
drwxr-xr-x 8 root root 4096 May 19 00:00 ..
-rw-rw-rw- 1 root root    0 May 15 16:45 access.log
-rw-rw-rw- 1 root root    0 May 15 16:45 error.log

Try deleting the two files in that folder then restarting lighttpd: sudo service lighttpd restart.

Deleted files and restarted the service. Admin still not loading.

The folder /var/log/lighttpd needs to be owned by user www-data too I believe:

pi@noads:~ $ stat /var/log/lighttpd
Access: (0750/drwxr-x---)  Uid: (   33/www-data)   Gid: (   33/www-data)

To change owner for folder and all content in the folder:

sudo chown www-data:www-data -R /var/log/lighttpd

And check again:

stat /var/log/lighttpd

sudo service lighttpd restart

journalctl --no-pager -u lighttpd

1 Like

That did it, @deHakkelaar! Admin now loads. Thank you.

1 Like

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