Tin Minnow wrote:Had my LAMP server up and running nicely and was able to see the default Debian/Apache page on my domain. But since setting up Pi-hole to block Ads on my network, I just receive a page that say's 'Blocked by Pi-hole'.
There's a FAQ on
https://pi-hole.net/help/ that seems to be about the problem.
Is there a way around this? I couldn't really make much sense of the possible solutions on there, try running it through a different port, or changing from the default page?
Not really sure what I'm talking about , but I do feel this is a problem that's not just specific to me.
Thanks,
Tin
Hi Tin,
When PiHole blocks a advert, it redirects the request on port 80, to the IP address of the device. Because that device is running a webserver, you end up seeing the default webpage (
/var/www/index.html). This page contains the text "blocked by PiHole".
If we look at
/etc/pihole/gravity.list, we can see how it works:
The above shows that any requests made to
001wen.com will be redirected to
192.168.0.111.
Theres a few options to free up the webserver's default page:
Option 1:
Change all IP address entries in
/etc/pihole/gravity.list to a null IP address, eg:
0.0.0.0 . The advert will still be blocked, but it wont be redirected to the webpage on the device. This then free's up
/var/www/index.html.
Code: Select all
#Redirect blocked sites to a null IP address
sed -i "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/0.0.0.0/" /etc/pihole/gravity.list
Option 2:
Overwrite
/var/www/index.html with something else. Bear in mind, this page will also be displayed on the client device, everytime PiHole blocks an advert.
Option 3:
Move your website to a subdirectory, eg:
/var/www/mywebsite/index.html, then you can access the site with
http://myserver/mywebsite