I am working from a NextCloud install first then installing PiHole afterwards. I had trouble allowing the correct access via different port than 80. I chose 81.
Added it to new pihole.conf in the /etc/apache2/sites-available
sudo nano /etc/apache2/sites-available/pihole.conf
added or edited the following lines:
<VirtualHost *:81>
DocumentRoot /var/www/html/admin/
<Directory /var/www/html/admin/>
Not sure if that was all overkill or I opened it up too much but that I how I got it working on my R-Pi 4.
Documenting it to help out anyone else who was a NOOB like meβ¦
In case someone else needs to know this: since pihole v6, they have moved from using lighttpd to host the web interface to using pihole-FTL itself to host & run it. Hence, it's not possible anymore to host the interface on apache nor lighttpd, because it's not compatible in any way (the web interface files are .lp files instead of .php nowadays).
If you are running any web server on the same installation as pihole, I recommend moving the pihole web interface files from /var/www/html/admin to a different location and then configuring the new file location either with pihole-FTL --config or editing /etc/pihole/pihole.toml. On top of that, you need to edit the same config to change pihole webserver ports to something else than 80/443, as they will conflict with the existing webserver. If I knew these, I'd have saved hours of debugging