Hardware/OS:
Custom build home server running Debian Stretch; current on software updates
Expected Behaviour:
When I navigate directly to a blocked domain from a client, a block page (as seen in this post) should appear.
Actual Behaviour:
When I navigate to http://scorecardresearch.com/ as in the post above, I get redirected to the DocumentRoot for pihole (/var/www/html/).
Debug Token:
97hjv6ww7x
Apache2 virtual host configs in /etc/apache2/sites-enabled:
000-default.conf:
<VirtualHost 192.168.1.210:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/webdir
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.1.210:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/webdir
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
pihole.conf:
<VirtualHost 192.168.1.220:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
ServerName pi.hole
ErrorLog ${APACHE_LOG_DIR}/error_pihole.log
CustomLog ${APACHE_LOG_DIR}/access_pihole.log combined
<Directory "/var/www/html/">
php_admin_flag engine On
</Directory>
ErrorDocument 404 /pihole/index.php
</VirtualHost>
Additional information:
This looks like an apache2 configuration issue, but I'm not seeing where I messed up. In addition to the redirection to the DocumentRoot, I cannot navigate directly to /pihole/index.php on a client either; the server gives me a 404. index.php is definitely there along with index.js and blockingpage.css, either of which can be read just fine through a browser:
root@server:/var/www/html/pihole# ls -al
total 28
drwxr-xr-x 2 www-data www-data 4096 Nov 12 21:02 .
drwxrwsr-x 5 www-data www-data 4096 Nov 12 21:03 ..
-rwxr-xr-x 1 www-data www-data 5137 Nov 12 21:02 blockingpage.css
-rwxr-xr-x 1 www-data www-data 61 Nov 12 21:02 index.js
-rwxr-xr-x 1 www-data www-data 7009 Nov 12 21:02 index.php
What configuration steps have I missed here? Am I right in assuming that if this page is not working, my pixel blocking is also non-functional on my clients? Running
curl http://scorecardresearch.com/ads.jpg
On my server yields the expected image, but doing the same on my Ubuntu 16.04 box yields a 404:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /ads.jpg was not found on this server.</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at scorecardresearch.com Port 80</address>
</body></html>
Any ideas? Where do I start to troubleshoot this?