- Ubuntu 18.04+
- Apache 2.4.18 or higher setup as described here https://gist.github.com/GAS85/8dadbcb3c9a7ecbcb6705530c1252831
- OpenSSL 1.0.2g-1ubuntu4.10 or higher
- e.g. LetsEncrypt certificate
Install pihole from the official repo as described here: https://github.com/pi-hole/pi-hole#one-step-automated-install, e.g. via
curl -sSL https://install.pi-hole.net | bash
During the installation please choose to install Web Interface, but to not install a Web Server.
Basically if you already have working apache2 config, just create file e.g. 004-pihole.conf
in a /etc/apache2/sites-available/
with following content:
<IfModule alias_module>
Alias /admin /var/www/html/admin
<Directory "/var/www/html/admin">
AllowOverride None
Options None
Order deny,allow
Allow from 192.168.0.0/24 localhost 127.0.0.1
#Allow from all
Deny from all
</Directory>
</IfModule>
In this case you can only access Pihole from the local network (192.168.0.0/24). If you would like to access from the internet also, please apply following config:
<IfModule alias_module>
Alias /admin /var/www/html/admin
<Directory "/var/www/html/admin">
AllowOverride None
Options None
Order deny,allow
#Allow from 192.168.0.0/24 localhost 127.0.0.1
Allow from all
#Deny from all
</Directory>
</IfModule>
To enable Apache2 config for pihole please run:
a2ensite 004-pihole.conf
Then test our config and reload apache2 if succeed:
sudo apachectl configtest && sudo service apache2 reload
Now you can access your pihole via http(s)://YourIP_or_Domain/admin
If you would like to change you path from http(s)://YourIP_or_Domain/admin
to e.g. http(s)://YourIP_or_Domain/custom
, simply adjust Alias in 004-pihole.conf to expected path:
#Alias /admin /var/www/html/admin
Alias /custom /var/www/html/admin
And added simple rewrite rule (you have to enable apache mod_rewrite via sudo a2enmod rewrite
) to your virtual host e.g. default-ssl.conf
.
#Pihole rewrite link from /admin to /pihole.
RewriteEngine on
RewriteRule "^/admin/(.*)" "/custom/$2" [R]
Then test our config and reload apache2 if succeed:
sudo apachectl configtest && sudo service apache2 reload
Now you can access your pihole via http(s)://YourIP_or_Domain/custom
Its depends from what you would like to achieve, do you need control Raspberry PI via Alexa, or you want that Raspberry connected to it bidirectional, or you would like to make Alexa from Raspberry?
Check this out:
Personally I use home assistant to control my heaters, lights and curtains updated with Shelly Relays and also controlled centrally.
You can also writ to my private chat here https://cloud.sitnikov.ga/index.php/call/2vnuims3, but I'm on vacation next weeks.