lighttpd Placeholder page on Bullseye issue

First I want to say thanks for all the work DietPI team your project really helps streamline things.

Previously I was using the Buster VMware image, running pi-hole and cloudflared. When you would go to the root IP or a directory that does not exist it would give you a landing page saying “Pi-hole: Your black hole for Internet advertisements Did you mean to go to the admin panel?” and link back to the Admin Page.

Now that I downloaded and installed the Bullseye VMware image (fresh install) I now see the lighttpd Placeholder page when going to the root IP but if you go to a random directory that does not exist you will get a 404 not found. Is this by design? I have tried to look at the config files and I don’t see anything that stands out to have a landing page show up again like it did not Buster. I only have an Admin and pihole folder here: /var/www/html/

My /etc/pihole/pihole-FTL.conf file is set to: BLOCKINGMODE=IP-NODATA-AAAA

Any help to set this back the way it was in the previous version or a better recommended option it would be greatly appreciated.

Thank you,

Hi,

I guess you would need to activate 404 error handle.

nano /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf

and remove the # hash on the 404 error handle page

# Enable blocking page via 404 handler
server.error-handler-404 = "/html/pihole/index.php"

restart web server

systemctl restart lighttpd.service

Thank you for the information but unfortunately this did not work. My 99-dietpi-pihole.conf did not have this line in it. It actually does not have much in it at all. This is how mine looks:

# Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian

# Admin panel
$HTTP["url"] =~ "^(/html)?/admin/" {
        # Create response header for Pi-hole debugger
        setenv.add-response-header = (
                "X-Pi-hole" => "The Pi-hole Web interface is working!",
                "X-Frame-Options" => "DENY"
        )

        # Allow admin panel access to local fonts
        $HTTP["url"] =~ "\.(eot|otf|tt[cf]|woff2?)$" {
                setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
        }
}

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

# Block public access to 404 page
$HTTP["url"] =~ "^(/html)?/pihole/" {
        $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." {
                url.access-deny = ("")
        }
}

I added the line that you mentioned to un-comment and restarted the service and device and still no luck.

Anymore ideas?

hi,

I did a test and for me this is working fine as you can see on the screen print. It was a test install I did today.

picture.png
let’s check config again

cat /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf | grep handler

could you have a look if index.php is existing

ls -la /var/www/html/pihole/

What happen if you try to open directly

http://192.168.x.x/html/pihole/index.php

Hello,

I ran the first command

cat /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf | grep handler

It ran and showed nothing, including no errors.

I ran the 2nd command

ls -la /var/www/html/pihole/

It returned the following:

total 40
drwxr-xr-x 2 root root 4096 Oct 14 03:43 .
drwxr-xr-x 4 root root 4096 Oct 11 01:56 …
-rw-r–r-- 1 root root 13849 Oct 11 06:16 blockingpage.css
-rw-r–r-- 1 root root 14911 Oct 12 07:23 index.php
lrwxrwxrwx 1 root root 20 Oct 11 06:17 pihole → /var/www/html/pihole

If I go to the file directly yes it does load.

After doing the above things I now can get that page in your screenshot to show when going to 192.168.x.x/RANDOMHERE
But if I still go to the root of just 192.168.x.x I get the lighttpd placeholder page. I feel like I am missing just one thing but at least I fixed the 404 error when going to any random page.


Anymore thoughts and thank you again for your help.

I’m a little bit confused now because we did not changed anything as we juste checked configs.

The first command was to check if the 404 error handle is part of your configuration. But it dosne’t seems so because it did not return any line. Therefore I’m wondering how it is possible to work now. :thinking:

To remove the place holder page, you would need to delete the index.html file in folder /var/www/

Sorry for the delay in responding. But I did want to follow up on this. So looks like when you first instructed me to do:

I did not have that line in my conf file. Today after I updated pi-hole it went back to giving 404 error pages. I then went back to the 99-diet-pihold.conf file and manually added in

# Enable blocking page via 404 handler
server.error-handler-404 = "/html/pihole/index.php"

Restaretd the service and it came back. So that line missing seems to be the problem in my case.

We do not enable the blocking page for Pi-hole by default anymore, since it doesn’t work well anymore (most ads are HTTPS, where this cannot work) and is about to be removed from Pi-hole as well: https://github.com/pi-hole/pi-hole/pull/3910