Pi.hole vs pihole.tld.name -> different behaviors

The issue I am facing:

I have pi.hole running on a tld that I have mapped using the internal DNS server: pihole.mytld.com
I am running a number of subdomains on the server hosted through apache and so am using apache (and using a self-signed SSL certificate) rather that lighttpd.

I can connect to pi.hole and pihole.mytld.com fine.

But:

  • I can only see the dashboard graphs when I connect to pihole via pi.hole. The hostname given as 'ubuntu'.

  • I cannot login to pi.hole/admin - it says my password is not recognised,

  • I cannot see the dashboard graphs on pihole.mytld.com (but the rest of the interface is fine). The hostname is given as the hostname set for 127.0.0.1 in my hosts file.

  • I can login to pihole.mytld.com/admin using my password.

Does anybody know what is causing this behaviour? I don't really care about pi.hole but I would like the frontend working correctly through pihole.mytld.com

Details about my system:
Ubuntu + Apache

<VirtualHost 10.10.1.183:443>
ServerName pihole.mytld.com
DocumentRoot /var/www/html/admin
<Directory /var/www/html/admin>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

I have also tried via a non-SSL collection on port 80. Same thing.

What I have changed since installing Pi-hole:

Nothing

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

or do it through the Web interface:

Tools > Generate Debug Log

Thanks for the reply.

I solved this - found the following line in the apache log:

PHP Fatal error:  Uncaught Error: Class 'SQLite3' not found in /var/www/html/pihole/index.php:142\nStack trace:\n#0 {main}\n  thrown in /var/www/html/pihole/index.php on line 142

For others with the problem who are trying to use apache:

I installed the PHP sqlite module, enabled it in php.ini and then all of the graphs work properly. This makes sense when you consider that all of the statistical data is saved by pihole into an sqlite database that the frontend needs to access.

Dont use a public pihole.tld.name but use for example pihole.home.tld.name instead!
The home.tld.name is not a public one and by doing so, below features work as intended (your router most likely does something similar):

image

This prevents lookups for private LAN domains/hostnames that cant be answered by Pi-hole (or maybe the router if its in the loop), mistakenly being leaked/forwarded to your upstream public DNS servers.