Pi-Hole on Raspbx

Hello,

I just ran the script to install Pi-Hole on my Raspberry Pi which was already running Raspbx. Raspbx is a distro which runs Rasbian with FreePBX pre-installed. FreePBX has an Apache2 web server listening on port 80 with all the files installed to /var/www/html/admin.

So after I installed pi-hole, it killed my admin folder from FreePBX and I lost access to the FreePBX Web GUI. Is there a way that I can install Pi-Hole to a different location so that both FreePBX and Pi-Hole can co-exist on my Raspberry Pi?

I'll have to revert back to one of my backups because it seems to have buggered up stuff quite well haha

A better question would be: Is there an easy way...

  1. CHANGING THE PATH OF ONE SERVICE

Of course. Either you change the paths in the install scripts before installation or change it later after the install.

What you are asking relates to lighttpd. You could change the path in /etc/lighttpd/lighttpd.conf to a location where you want, for e.g. /home/pihole/web/public_html. After changing restart lighttpd. Then, all the calls for lighttpd will be transfered to that directory.

It is of course up to you if you want to change both /admin/ or both: /admin/ plus /pihole/index.php in there. Then, you need to make respective references.

Mind you, the lighttpd.conf will be overwritten after update. If you want to prevent this, then you need to create the file in that dir - as mentioned in lighttpd.conf last line - with external.conf and makes respective changes in lighttpd.conf too.

  1. ALLOW TWO SERVICES LISTEN ON PORT 80

The best is to avoid two services listen on one port simultaneously.

You may be able to change ports in FreePBX. Then, you will have less troubles.

What you cannot have "working out-of-the-box" is to have Apache2 and pihole listening at the port 80 simultaneously without making many configuration changes.

I did - and further do - consider that this is possible, although some developers here rejected this idea. When I am finished with these modification, I will commit my suggestions to the pi-Hole repo.

Pi-Hole uses the lighttpd daemon (port 80) to return a semi blank page instead of the real ad and gives you the admin web page.
You could setup shop with two IP addresses on the same physical interface and have both daemons listen/bind to the different IP's.
Have a look at below thread how it was done with nginx + lighttpd (both competing for port 80).
Surely you can bind Apache in a similar way.

EDIT: You can have as many services listening on port 80 as you like.
If your subnet is large enough, you can run a thousand daemons listening to their own IP address :wink:

Thanks for the replies!

I like your options number 1 SunderRaj. I'll play around with installing to a different directory. The issue was the default install overwrote my FreePBX WebUI. It is easy enough to change the listening ports for both services after that. I just got everything up and running again so I'll have to do some testing on a spare Raspberry Pi when I have some free time..... make sure I don't kill FreePBX again haha

Did you get this sorted out? I'm looking to do the same

I actually just ended up running bind I think. I wrote a script to download and sort a bunch of the Pi-hole URL lists and dump them into a hosts file. Not nearly as nice a front end as Pi-hole but it got the job done.

I would check and give you a more direct answer but I don’t have access to that machine any longer.