Skip to content

Commit ea558d9

Browse files
author
Patrick Moore
authored
Update 2022-12-18-install-pihole-ha.md
1 parent 6078ad7 commit ea558d9

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

_posts/2022-12-18-install-pihole-ha.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,18 @@ I also like to turn on DNSSEC in <u>Settings</u> > <u>DNS</u> > <u>Advanced DNS
5252

5353
![systemctl status keepalived](/assets/img/install-pihole-ha-3.png)
5454

55-
The last change that I make is to add the hostname I will use for this instance to an authorized hosts array in the web interface php file. I do this so that when I try and access my instance from the friendly name I have set up in DNS or a reverse proxy, I don't have to remember the /admin suffix. To do this, you will need to edit the index.php file of Pi-hole.
55+
### Redirect to Admin
56+
57+
The last change that I make is to redirect HTTP requests to the root path to the pihole `/admin` path. I find it annoying this isn't done by default but it's an easy fix. Simply add the following line to the `lighttpd.conf` file.
5658

5759
```bash
58-
sudo nano /var/www/html/pihole/index.php
60+
sudo nano /etc/lighttpd/lighttpd.conf
5961
```
6062

61-
In this file I edit the authorizedHosts array
62-
63-
```php
64-
$authorizedHosts = [ "localhost", "pihole.local" ];
63+
```conf
64+
url.redirect = ("^/$" => "/admin" )
6565
```
6666

67-
> index.php is likely overwritten whenever Pi-hole is updated and these changes will need to be reapplied
68-
{: .prompt-warning }
69-
7067
## High Availability with keepalived
7168

7269
To have a high availabilty cluster, you will need more than one Pi-hole instance running. Once you have them both running, you can configure `keepalived` to set up a virtual IP between them using a technology called VRRP. It allows both servers to share a virtual IP between them, swapping instantly when one of them goes down. Because this is more of a "hot spare" methodology, one node will be primary, and the rest will be secondary. To get started you will need to install two pacakges.
@@ -220,4 +217,4 @@ To break this down, `* * * * *` will ensure the command runs every minute. This
220217
> You should manually run the rsync commands in terminal to save the host thumbprint, and ensure the command works
221218
{: .prompt-tip }
222219

223-
Congratulations, you should now have a high availabilty Pi-hole cluster!
220+
Congratulations, you should now have a high availabilty Pi-hole cluster!

0 commit comments

Comments
 (0)