PiHole reinstall on Ubuntu Server 24.04.2 using Apache2 and php files for web interface

Hello community,

The issue I am facing:
I couldn't update pihole on my ubuntu server anymore with "sudo pihole -up", so I have removed it with "sudo pihole uninstall" and want to do a clean reinstall.
At reinstalling with his commands, I was not asked to install without webserver:

git clone --depth 1 GitHub - pi-hole/pi-hole: A black hole for Internet advertisements Pi-hole
cd "Pi-hole/automated install/"
sudo bash basic-install.sh

At "Installation Complete" it told me that I can view web interface at http://...:8080/admin/
(But access not working because port 8080 is used by Apache2 web server and I tried to switch the port, but I couldn't find any lighttpd config file to change the port for pihole web interface.)

Also there was for the web interface at folder /var/www/html/admin/ no *.php files. Instead I had here *.lp files which I can't open with Apache2.

So I uninstalled pihole again.

Should I firstly remove something else which could make troubles from the old pihole installation?
I already did "sudo pihole uninstall".

And secondly what is the correct was to install pihole with *.php files unter .../html/admin/ for web interface without additional webserver, so that I can use existing Apache2 with virtualhost config, because I'm using Apache2 also for other websites on my ubuntu server.

Details about my system:
Ubuntu Server 24.04.2 TLS (GNU/Linux 6.8.0-1019-raspi aarch64) on Raspberry Pi 5
Apache2 with different websites under /var/www/
PHP8.3.6
certbot (letsencrypt)

Thank you for helping,
Alex

This won't happen.
The new web server is Pi-hole itself (pihole-FTL). Without it, Pi-hole won't work.

Pi-hole v6 web interface is a completely new web interface, written in Lua (PHP is gone). It needs to be executed by pihole-FTL web server (we also removed lighttpd).

Apache can't execute the Lua pages, so you need to use the embedded web server.

You can change the Pi-hole port to any other port you want using:

pihole-FTL --config webserver.port '8880,443s'

Notes:

  • port 8880 is just an example. You can use any port you like.
  • you can configure a secure port (https) adding the s flag to a port. This port can also be changed.

You can't. PHP is not part of Pi-hole v6.

You can still run your services under Apache2, but you will need to use pihole-FTL to execute the new Pi-hole web interface.

Thank for the all the informations.

I have disabled port 81 at Apache2 and config the port for pihole-FTL.

After reboot everything now working perfectly.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.