lighttpd Placeholder page on Bullseye issue

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
TechEnjoy
Posts: 3
Joined: Wed Oct 13, 2021 6:38 am

lighttpd Placeholder page on Bullseye issue

Post by TechEnjoy »

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,
User avatar
Joulinar
Posts: 5996
Joined: Sat Nov 16, 2019 12:49 am

Re: lighttpd Placeholder page on Bullseye issue

Post by Joulinar »

Hi,

I guess you would need to activate 404 error handle.

Code: Select all

nano /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf
and remove the # hash on the 404 error handle page

Code: Select all

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

Code: Select all

systemctl restart lighttpd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TechEnjoy
Posts: 3
Joined: Wed Oct 13, 2021 6:38 am

Re: lighttpd Placeholder page on Bullseye issue

Post by TechEnjoy »

Joulinar wrote: Wed Oct 13, 2021 8:47 pm Hi,

I guess you would need to activate 404 error handle.

Code: Select all

nano /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf
and remove the # hash on the 404 error handle page

Code: Select all

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

Code: Select all

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:

Code: Select all

# 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?
User avatar
Joulinar
Posts: 5996
Joined: Sat Nov 16, 2019 12:49 am

Re: lighttpd Placeholder page on Bullseye issue

Post by Joulinar »

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
picture.png (23.51 KiB) Viewed 48 times

let's check config again

Code: Select all

cat /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf | grep handler
could you have a look if index.php is existing

Code: Select all

ls -la /var/www/html/pihole/
What happen if you try to open directly

Code: Select all

http://192.168.x.x/html/pihole/index.php
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TechEnjoy
Posts: 3
Joined: Wed Oct 13, 2021 6:38 am

Re: lighttpd Placeholder page on Bullseye issue

Post by TechEnjoy »

Hello,

I ran the first command

Code: Select all

cat /etc/lighttpd/conf-enabled/99-dietpi-pihole.conf | grep handler
It ran and showed nothing, including no errors.

I ran the 2nd command

Code: Select all

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.
PageCapture.PNG
Anymore thoughts and thank you again for your help.
User avatar
Joulinar
Posts: 5996
Joined: Sat Nov 16, 2019 12:49 am

Re: lighttpd Placeholder page on Bullseye issue

Post by Joulinar »

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. :?

To remove the place holder page, you would need to delete the index.html file in folder /var/www/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply