Login is constantly redirecting me to the dashboard


I've installed PiHole on 2 Raspberry Pis. On one, all went well, although I had some issues starting FTL, on the 2nd one I seem not to be able to login, everytime I try I get redirected to the Dashboard with no login done. Even if I login with CTRL+Enter I see the setting page, but everytime I select another page on the left menu or save the settings I get redirected to the login page again.

I've created a debug log: y9l7zm2gxn

Any ideas on what is different?

Check if the disk is full (use df -h for this). When the disk is full, no session can be created for your user resulting in a login having no effect.

Looks fine for me:
Filesystem Size Used Avail Use% Mounted on
/dev/root 459G 244G 196G 56% /
devtmpfs 481M 0 481M 0% /dev
tmpfs 485M 28K 485M 1% /dev/shm
tmpfs 485M 14M 472M 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 485M 0 485M 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 52M 202M 21% /boot
/dev/sdc1 917G 772G 99G 89% /mnt/MyBook
tmpfs 97M 0 97M 0% /run/user/1000
tmpfs 97M 0 97M 0% /run/user/999

Found the issue, I just don't know how to solve it.
On this Pi I have a NextCloud server, and so I have this configuration on apache /etc/apache2/sites-available/000-default.conf with a dynamic DNS server to access it from the internet:

RewriteEngine on
RewriteCond %{SERVER_NAME} =MYSERVERNAME.ddns.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
#Header set Set-Cookie HttpOnly;Secure

So if I open the site using the external address all is fine. But I don't what to have PiHole accessible from the Internet. Any ideas how to fix it?

Don't use Apache for Pi-hole. Just use lighttpd and run it on another port. This will also shield it from the Internet.

This seems the best approach. I will investigate how I can have them both working in the same machine.

Just as a tip: You can use what Pi-hole installed and just change the port. You will have to re-do this after an update as an update runs pihole -r which is "fixing" the port away (in case a user misconfigured it). There is an open Feature Request for memorizing the port, you may want to vote for this.

It may not be enough, I believe I also need to change the path used to serve the webpage (/var/www/html/), and move the Pi-hole files overthere, otherwise it will still be available in Apache.

Regarding the feature request to memorize the port number, this request is set as Implemented:

Although I've seen some other newer requests so it might got broken.
I voted on this one:

Solution was much simpler. I just followed this answer to add the location directive to the apache configuration files for the admin and pihole folders.

In the end they look like this:

<Directory /var/www/html/admin>
  Require host localhost
  Require ip
  Require ip 192.168
  Require ip 10

<Directory /var/www/html/pihole>
  Require host localhost
  Require ip
  Require ip 192.168
  Require ip 10

This solves my problem.

1 Like