From 21dc360c96baefa0bdc246e3e8cf6d38672b5343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81mie=20DUCASTEL?= Date: Tue, 3 Nov 2020 22:00:17 +0100 Subject: [PATCH] Update pihole.md --- doc/pihole.md | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/doc/pihole.md b/doc/pihole.md index 7678b41..a24a944 100644 --- a/doc/pihole.md +++ b/doc/pihole.md @@ -42,3 +42,108 @@ Vous ne pourrez pas vous connecter aux périphériques avec leurs noms d’hôte Si les deux inconvénients ci-dessus sont des pactes pour vous, vous pouvez les surmonter partiellement en utilisant le fichier PiHole Hosts ou en publiant complètement l’adresse IP de PiHole via Dnsmasq dans un routeur (si cette fonction est prise en charge). > >Notez que si vous choisissez cette méthode, vous devrez renouveler les baux DHCP fournis par le routeur. Pour ce faire, le plus simple consiste à redémarrer le routeur. + +## faire tourner d'autres sites avec Apache + +https://discourse.pi-hole.net/t/migrating-pi-hole-from-lighttpd-to-apache/152/14 : + +> I just installed pihole on ubuntu server and because I already use Apache & PHP I uninstalled lighttpd. +I have several virtual sites on Apache so I added also pihole; all work without problems. + +> Here it is my config if anybody need to replicate for his use: +edit: /etc/apache2/sites-available/000-default.conf + +``` +#=== pihole WEBSITE === + + + ServerAdmin webmaster@localhost + ServerName pihole + ServerAlias pi.hole + + DocumentRoot /var/www/html/dns + + Options FollowSymLinks MultiViews + AllowOverride all + Order deny,allow + allow from all + + + ErrorLog ${APACHE_LOG_DIR}/pihole_error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/pihole_access.log combined + + +#=== site1 WEBSITE === + + + ServerAdmin webmaster@localhost + ServerName site1 + + DocumentRoot /var/www/html/site1 + + Options FollowSymLinks MultiViews + AllowOverride all + Order deny,allow + Deny from all + allow from 127.0.0.1 + allow from 10.22.22.0/24 + + + ErrorLog ${APACHE_LOG_DIR}/site1_error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/site1_access.log combined + + +#==== site2 WEBSITE ==== + + + ServerAdmin webmaster@localhost + ServerName webtv + + DocumentRoot /var/www/html/site2 + + Options FollowSymLinks MultiViews + AllowOverride all + Order deny,allow + Deny from all + allow from 10.22.22.0/24 + allow from 127.0.0.1 + + + ErrorLog ${APACHE_LOG_DIR}/site2_error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/site2_access.log combined + + +``` + +> edit your server hosts file so you can access any website you need from server, +( if you host your custom files for blocking): + +``` +# /etc/hosts +127.0.0.1 localhost +127.0.1.1 ubuntu1 +127.0.1.2 pihole +127.0.1.3 site1 +127.0.1.4 site2 + +10.22.22.16 site1 +10.22.22.16 site2 +10.22.22.16 pihole +10.22.22.16 ubuntu1 +``` + +> copy all web files for pihole ( move it from /var/www/html/ ) and also content from pihole in dns: +it will look like this: + + /var/www/html/dns/admin/... + /var/www/html/dns/pihole/... + /var/www/html/dns/blockingpage.css + /var/www/html/dns/index.js + /var/www/html/dns/index.php + /var/www/html/site1/... + /var/www/html/site2/... + +> If I did not forgot something this is all you need to change to have pihole working in Apache, so now reload/restart apache.