lighttpd placeholder

I installed pihole via dietpi’s software install process which installed lighttpd separately. There seems to be a difference between installation this way vs just installing pihole normally.

When I goto the base http://ipaddress/, I get the lighttpd placeholder page instead of the pihole redirect page. going to /admin takes me to pihole admin page as usual.

Looking in /var/www/html, I only see two folders, admin and pihole.

I tried placing an ‘index.html’ in /var/www/html to auto-redirect to admin but I still get the placeholder.

How do I get rid of the placeholder page?

The web server root directory is /var/www. There the placeholder page is located in

I replaced the placeholder html page with a cut down version of /var/www/pihole/index.php (I had a strange issue when I used the full code in index.php but I can’t remember what it was now…)

It just looks like this and placed in /var/www/index.php, I also added a php autoredirect to admin page in 3 seconds, you can adjust the time below:

<?php header("Refresh:3; url=/admin"); ?>
    <html lang='en'>
        <head>
            <meta charset='utf-8'>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <title>Pi-hole</title>
            <link rel='stylesheet' href='blockingpage.css'>
            <link rel='shortcut icon' href='/admin/img/favicons/favicon.ico' type='image/x-icon'>
        </head>
        <body id='splashpage'>
            <div id="pihole_card">
              <img src='/admin/img/logo.svg' alt='Pi-hole logo' id="pihole_logo_splash" />
              <p>Pi-<strong>hole</strong>: Your black hole for Internet advertisements</p>
              <a href='/admin'>Did you mean to go to the admin panel?</a>
            </div>
        </body>
    </html>

copy blockingpage.css to /www as well so index.php gets the css stylesheet
Rename index.lighttpd.html to index.lighttpd.html.old

You may also need to restart lighthtpd with systemctl (or restart service from dietpi-launcher) if it doesn’t work straightaway.

AH, /var/www, ok now that makes sense.

When I look at my other dietpi install (where pi-hole was installed using pihole’s installer vs dietpi), I have nothing in /var/www. Looking more carefully at lighttpd, I notice there is an added line in the conf.

server.error-handler-404 = “/pihole/index.php”

I guess with that, there’s no need to copy index.php and it’s handled incase index.php ever gets updated

there is a reason why we use /var/www/ as web server root. Because we try to ensure other web applications are working as well on same web server like NextCloud or OwnCloud. Using PiHole’s own installer makes this nearly impossible as PiHole guys configure web server in a way as it would be the only web application on your system. They don’t care about compatibility between other app or to run more than PiHole on your system. Therefore its highly recommended to use dietpi-software on a DietPi system.