Changing port in new install blocks web interface

The issue I am facing:
I'm installing pihole on a new pi because the SD card on my live one seems flaky. I have apache2 in the same pi, and it uses ports :80 and :8080 for other apps.
I want pihole's new web server to render the web interface on :8888 so in
/etc/pihole/pihole.toml I changed
port = "80o,443os,[::]:80o,[::]:443os"
to
port = "8888o,443os,[::]:8888o,[::]:443os"

but when I open http://[newPi-IP]:8888/admin/ I see
Error 404: Not Found
Not found

Opening http://[newPi-IP]:8888/ shows
Error 403: Forbidden
Error: Directory listing denied
which is different to another installation I have that shows a proper 403:
Opening http://[workingPi-IP]:8888/ correctly shows
"403
Oops! Access denied.
You don't have permission to access / on this server.
Did you mean to go to your Pi-hole's dashboard instead?"

So something's different on the new installation.

Details about my system:
It's a freshly installed LAMP server, fully updated after install, RaspiOS bookworm.

I've checked that there's no mention of :8888 in /etc/apache2/ports.conf
which has
Listen 80
Listen 8080
<IfModule etc. ...

and that /etc/apache2/sites-enabled/000-default.conf defines virtual hosts for *:80 and *:8080 only.

What I have changed since installing Pi-hole:
just the port line in /etc/pihole/pihole.toml

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

Thank you.

https://tricorder.pi-hole.net/unH5tcgx/

I have looked through the debug log but can't spot anything that helps me identify the problem.

Your debug log shows the web server was successfully started using ports 8888 and 443:

2025-04-23 09:42:57.757 HKT [715M] INFO: Web server ports:
2025-04-23 09:42:57.757 HKT [715M] INFO:   - 0.0.0.0:8888 (HTTP, IPv4, optional, OK)
2025-04-23 09:42:57.757 HKT [715M] INFO:   - 0.0.0.0:443 (HTTPS, IPv4, optional, OK)
2025-04-23 09:42:57.757 HKT [715M] INFO:   - [::]:8888 (HTTP, IPv6, optional, OK)
2025-04-23 09:42:57.758 HKT [715M] INFO:   - [::]:443 (HTTPS, IPv6, optional, OK)

You should be able to access the web interface using: http://192.168.0.110:8888/admin and https://192.168.0.110/admin

This doesn't look like the Pi-hole 404 error.

When you receive the 404 error, do you see a corresponding line in apache2 error log (or maybe in access log)?

I just opened http://192.168.0.110:8888/admin/
and find that apache2 access.log for 192.168.0.110 for today is empty (checked with WinSCP and in terminal with nano)

Not until I open http://192.168.0.110:80 does anything appear in the file, as follows:
192.168.0.2 - - [23/Apr/2025:12:08:33 +0800] "GET / HTTP/1.1" 200 3380 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0"
192.168.0.2 - - [23/Apr/2025:12:08:33 +0800] "GET /icons/openlogo-75.png HTTP/1.1" 200 6040 "http://192.168.0.110/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0"

apache2 error.log for today shows
[Wed Apr 23 00:00:11.063908 2025] [mpm_prefork:notice] [pid 866:tid 866] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Wed Apr 23 00:00:11.064075 2025] [core:notice] [pid 866:tid 866] AH00094: Command line: '/usr/sbin/apache2'
[Wed Apr 23 00:46:59.460334 2025] [mpm_prefork:notice] [pid 866:tid 866] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Apr 23 09:42:59.107723 2025] [mpm_prefork:notice] [pid 880:tid 880] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Wed Apr 23 09:42:59.123946 2025] [core:notice] [pid 880:tid 880] AH00094: Command line: '/usr/sbin/apache2'

I did journalctl -b >journal.txt
Don't really know how to interpret the contents of that but a text search on 'error' showed only lines related to camera and audio that I don't use.

I wondered if something else was bound to 8888, so in /etc/pihole/pihole.toml, I changed
port = "8888o,443os,[::]:8888o,[::]:443os"
to
port = "8880o,443os,[::]:8880o,[::]:443os"
but going to http://192.168.0.110:8880/admin/
gave me the same
Error 404: Not Found
Not found

I've now reverted to 8888 (which works on the other pi with a flaky micro SD), but I still have no clue of where else to look. The failure of 8880 to work suggests to me that it's something within the pihole built-in server.

Help!

I have now uninstalled pihole completely and then reinstalled it. Changed that one line in pihole.toml to
port = "8888,443os,[::]:80o,[::]:443os" ### CHANGED, default = "80o,443os,[::]:80o,[::]:443os"
making :8888 not optional and leaving IPV6 alone, as I don't use it.

After that, the result is the same.
http://192.168.0.110:8888/admin/
Error 404: Not Found
Not found

Again HELP!

I shall start a new question, because I have greatly simplified the setup that reproduces the same problem.

Solution identified in a new installation and a new question here: