Installed & Configured Everything... But No Activity

Hello!
After much hassle with ad-blockers, modded apps, & the like per device, I've decided to jump on the bandwagon & setup a network-wide system once it for all.

I'm using a Raspberry Pi 3B+ running Dietpi [Raspbian Lite (Debain 11)].
I've setup Pi-hole according to the docs (cloning the repo), & on the surface, everything looks to be fine.

The only edit I've made is using NGINX, configured from the docs, & it's working great. I'm able to access Pi-hole from my local network & domain without any issues

My Token

Common commands I saw being asked on the forums:-

Pi has been assigned a static IP:

Configuring the Router to use Pi-hole:

My /etc/dhcpcd.conf:

interface eth0
metric 300
static domain_name_servers=127.0.0.1

interface wlan0
metric 200

/etc/resolv.conf:

# Generated by dhcpcd from eth0.dhcp, eth0.ra
# /etc/resolv.conf.head can replace this line
nameserver 127.0.0.1
nameserver fe80::1%eth0
# /etc/resolv.conf.tail can replace this line

ufw status verbose:

Status: active
Logging: off
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
2222/tcp                   ALLOW IN    Anywhere
80                         ALLOW IN    Anywhere
443                        ALLOW IN    Anywhere
Anywhere                   ALLOW IN    192.168.1.0/24
80/tcp                     ALLOW IN    Anywhere
53/tcp                     ALLOW IN    Anywhere
53/udp                     ALLOW IN    Anywhere
67/tcp                     ALLOW IN    Anywhere
67/udp                     ALLOW IN    Anywhere
2222/tcp (v6)              ALLOW IN    Anywhere (v6)
80 (v6)                    ALLOW IN    Anywhere (v6)
443 (v6)                   ALLOW IN    Anywhere (v6)
80/tcp (v6)                ALLOW IN    Anywhere (v6)
53/tcp (v6)                ALLOW IN    Anywhere (v6)
53/udp (v6)                ALLOW IN    Anywhere (v6)
67/tcp (v6)                ALLOW IN    Anywhere (v6)
67/udp (v6)                ALLOW IN    Anywhere (v6)

nslookup pi.hole:

Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   pi.hole
Address: 127.0.0.1
Name:   pi.hole
Address: ::1

echo ">stats >quit" | nc 127.0.0.1 4711

domains_being_blocked 99443
dns_queries_today 1853
ads_blocked_today 45
ads_percentage_today 2.428494
unique_domains 386
queries_forwarded 1168
queries_cached 594
clients_ever_seen 12
unique_clients 12
dns_queries_all_types 1852
reply_NODATA 135
reply_NXDOMAIN 33
reply_CNAME 146
reply_IP 383
privacy_level 0
status enabled

Still, I've got nothing:

What am I missing? Are there settings I'm yet to configure?
In case my router wasn't using Pi-hole correctly, I've also tried manually adding my Pi as the DNS on my laptop to no avail.
ipconfig /all:

   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : 192.168.1.2
   NetBIOS over Tcpip. . . . . . . . : Enabled

Pretty much fumbling around the dark now, any help would be greatly appreciated!

Your telnet API stats results demonstrate that your Pi-hole is receiving, filtering and forwarding queries. Those numbers would also be reflected in Pi-hole's UI, suggesting that this is indeed a display issue, likely due to nginx.

A common cause for issues with nginx would be wrong or missing permissions, e.g. due to group memberships. Please reverify that you've applied the respective steps from the nginx user guide

1 Like

Huh, that's weird, I went back & fiddled with the syntax, permissions & instructions a bit more. No dice.
My default.conf looks like:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;
        server_name XXXX;
        autoindex off;

        index pihole/index.php index.php index.html index.htm;

        location / {
                expires max;
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
                fastcgi_pass unix:/run/php/php8.0-fpm.sock;
                fastcgi_param FQDN true;
                auth_basic "Restricted"; # For Basic Auth
                auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
        }

        location /*.js {
                index pihole/index.js;
                auth_basic "Restricted"; # For Basic Auth
                auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
        }

        location /admin {
                root /var/www/html;
                index index.php index.html index.htm;
                auth_basic "Restricted"; # For Basic Auth
                auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
        }

        location ~ /\.ht {
                deny all;
        }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/XXXX/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/XXXX/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    if ($host = XXXX) {
        return 301 https://$host$request_uri;
    } # managed by Certbot



        server_name XXXX;
    listen 80;
    return 404; # managed by Certbot
}

The .htpasswd file is owned by root:root with 644 permissions just like the rest of the nginx folder.

/var/www/html has the pihole folder owned by www-data:www-data with permissions 755.

And by now I've added pihole to www-data 3 times at least, so what gives?

Though one more thing of note,
attempting to access Settings > Group Management > Groups
I'm hit with:

DataTables warning: table id=groupsTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7

Same goes for Tools > Pi-Hole disgnosis
And Tools > Network gives:

An unknown error occurred while loading the data.

Finally Long-term data > Query Log returns:

An unknown error occurred while loading the data.

Check the server's log files (/var/log/lighttpd/error.log) for details.

You may need to increase PHP memory limit.

You can find more info in pi-hole's FAQ:
https://docs.pi-hole.net/main/faq/#error-while-loading-data-from-the-long-term-database

I should hope the 512M I've allocated should be enough,
Since I don't have lighttpd logs, I checked nginx & sure enough, they were filled with:

Stack trace:
#0 /var/www/html/admin/api_db.php(26): SQLite3_connect()
#1 {main}
  thrown in /var/www/html/admin/scripts/pi-hole/php/database.php on line 61" while reading response header from upstream, client: 192.168.1.6, server: XXXX, request: "GET /admin/api_db.php?status HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "19>2022/03/16 00:17:08 [error] 30238#30238: *296 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Undefined constant "SQLITE3_OPEN_READONLY" in /var/www/html/admin/scripts/pi-hole/php/database.php:61

That was eye-opening, & this forum post led me to install php8.0-sqlite3 which ended up fixing the whole problem :sweat_smile:

Many thanks, & wistful thinking, but with hope I may never face a problem again.

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