Unable to get Pi Hole Admin Page working with Kubuntu 17.04 (32-Bit) [SOLVED]

So I recently installed Pi Hole onto my Raspberry Pi and it worked like a charm, though I wanted to install it rather onto a repurposed Mac Mini, now running Kubuntu 17.04. However, I came across a few issues, of which I've fixed a couple. However, now, Lighttpd no longer appears to work; due to some issue with using Php 7 rather than 5. I've tried pretty much every way to attempt to move it to Apache 2 due to the support of Php 7, however, I have had no luck and would really appreciate if anyone could document exactly how to do this.

It should work with PHP 7. Run pihole -d for a debug token. Also give the output of sudo service lighttpd status

So what I received appears to be alright, however, when I try to go to the admin page, it says it's forbidden.

The token is: u7mqxg6rns
The output of the service status is:

● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset:
Active: active (running) since Thu 2017-06-29 11:25:29 BST; 2min 13s ago
Main PID: 9489 (lighttpd)
CGroup: /system.slice/lighttpd.service
└─9489 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

Jun 29 11:25:28 KubuntuMacMini systemd[1]: Starting Lighttpd Daemon...
Jun 29 11:25:29 KubuntuMacMini systemd[1]: Started Lighttpd Daemon.

What are the permissions on the folders?

Please post the output of

ls -lh /var/www
ls -lh /var/www/html
ls -lh /var/www/html/admin

ls -lh /var/www

html

ls -lh /var/www/html

admin index.lighttpd.html index.lighttpd.orig pihole

ls -lh /var/www/html/admin

-rw-r--r-- 1 root root 5.8K Jun 28 21:45 api_FTL.php
-rw-r--r-- 1 root root 2.2K Jun 28 21:45 api.php
-rw-r--r-- 1 root root 2.7K Jun 28 21:45 api_PHP.php
-rw-r--r-- 1 root root 846 Jun 28 21:45 CONTRIBUTING.md
-rw-r--r-- 1 root root 949 Jun 28 21:45 debug.php
-rw-r--r-- 1 root root 1.3K Jun 28 21:45 gravity.php
-rw-r--r-- 1 root root 9.4K Jun 28 21:45 help.php
drwxr-xr-x 2 root root 4.0K Jun 28 21:45 img
-rw-r--r-- 1 root root 6.6K Jun 28 21:45 index.php
-rw-r--r-- 1 root root 14K Jun 28 21:45 LICENSE
-rw-r--r-- 1 root root 3.3K Jun 28 21:45 list.php
-rw-r--r-- 1 root root 4.3K Jun 28 21:45 queries.php
-rw-r--r-- 1 root root 1.1K Jun 28 21:45 queryads.php
-rw-r--r-- 1 root root 2.0K Jun 28 21:45 README.md
drwxr-xr-x 4 root root 4.0K Jun 28 21:45 scripts
-rw-r--r-- 1 root root 36K Jun 28 21:45 settings.php
drwxr-xr-x 3 root root 4.0K Jun 28 21:45 style
-rw-r--r-- 1 root root 903 Jun 28 21:45 taillog-FTL.php
-rw-r--r-- 1 root root 895 Jun 28 21:45 taillog.php

Which leads me to believe I need to chmod 755 the whole directory, perhaps...

No, I don't think so. You already have -rw-r--r-- == 644.

The permissions are missing for /var/www and /var/www/html. I assume you forgot to use -lh as an option?

Just to add, this might be interesting as well:

ls -lh /var/log/lighttpd

Whoops, my bad about the permissions for the other directories:

drwxrwxr-x 4 www-data www-data 4.0K Jun 29 11:22 html

And

drwxr-xr-x 7 root root 4.0K Jun 28 21:45 admin
-rw-r--r-- 1 root root 3.3K Jun 28 22:26 index.lighttpd.html
-rw-r--r-- 1 root root 3.3K Jun 28 21:45 index.lighttpd.orig
drwxr-xr-x 2 root root 4.0K Jun 28 21:46 pihole

Finally:
ls: cannot open directory '/var/log/lighttpd': Permission denied

Okay, that all looks not too bad. Please repeat the last one with sudo powers, i.e.

sudo ls -lh /var/log/lighttpd

If you create a dummy file

echo "<html><body>ABC <?php echo ("DEF"); ?></body></html>" | sudo tee /var/www/html/test.php

can you access this page under http://pi.hole/test.php ? If yes, what does it print?

Repeating the last one with sudo returned:

-rw-r--r-- 1 www-data www-data 31K Jun 29 12:19 access.log
-rw-r--r-- 1 www-data www-data 775 Jun 29 11:25 error.log

Also I can't access the page for it states:

403 - Forbidden

Okay, can you also show what

sudo tail /var/log/lighttpd/access.log

says?

1498733825|api.mobula.sdk.duapps.com|GET /adunion/slot/getDlAd?h=1080&w=1920&model=BRAVIA+4K+GB&vendor=Sony&sdk=24&dpi=320&sv=1.0.9.9&svn=SELF-1.0.9.9&pkg=com.estrongs.android.pop&v=582&vn=4.1.6.6.2&tk=4Z61PC%2BIqaab7NcE5nuBOA%3D%3D&goid=RSB_PHbsrjP-m1DVnHb1nBYYm1D4Qy7BPADVm10knH0YnAw-PjbY&locale=en_GB&ntt=Ethernet&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=1343c004c8dc6428&play=1&res=1080*460%2C244*244%2C170*170%2C108*108&ps=20&pn=1&sid=11718&sType=native&dllv=normal&pk=FFB83B8C786385AFB011CDEC75C1BE0AD9EA03869B6F3700 HTTP/1.1|404|345
1498734494|api.mobula.sdk.duapps.com|GET /adunion/slot/getDlAd?h=1080&w=1920&model=AFTM&vendor=Amazon&sdk=22&dpi=320&sv=1.0.8.2&svn=SELF-1.0.8.2&pkg=com.estrongs.android.pop&v=560&vn=4.1.6&tk=%2F1RXJINHAgrwLGbDXwC1XA%3D%3D&locale=en_GB&ntt=WIFI&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=fd9c0ae983bbfa28&play=0&res=1080*460%2C244*244%2C170*170%2C108*108&ps=20&pn=1&sid=11718&sType=native&dllv=normal&pk=FFB83B8C786385AF233A5D4DF513C3D243FEC392D51A7A73 HTTP/1.1|404|345
1498734793|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=AFTM&vendor=Amazon&sdk=22&dpi=320&sv=1.0.8.2&svn=SELF-1.0.8.2&pkg=com.estrongs.android.pop&v=560&vn=4.1.6&tk=%2F1RXJINHAgrwLGbDXwC1XA%3D%3D&locale=en_GB&ntt=WIFI&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=fd9c0ae983bbfa28&mdu=adsdk&rv=1.0&ts=1498734793822&seq=521&stype=behavior&s=3f8e7002136bd8923a366a5c5a99c26e HTTP/1.1|404|345
1498734793|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=AFTM&vendor=Amazon&sdk=22&dpi=320&sv=1.0.8.2&svn=SELF-1.0.8.2&pkg=com.estrongs.android.pop&v=560&vn=4.1.6&tk=%2F1RXJINHAgrwLGbDXwC1XA%3D%3D&locale=en_GB&ntt=WIFI&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=fd9c0ae983bbfa28&mdu=adsdk&rv=1.0&ts=1498734793867&seq=521&stype=behavior&s=cfd481f6df8bd97e94721205d2b65185 HTTP/1.1|404|345
1498734793|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=AFTM&vendor=Amazon&sdk=22&dpi=320&sv=1.0.8.2&svn=SELF-1.0.8.2&pkg=com.estrongs.android.pop&v=560&vn=4.1.6&tk=%2F1RXJINHAgrwLGbDXwC1XA%3D%3D&locale=en_GB&ntt=WIFI&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=fd9c0ae983bbfa28&mdu=adsdk&rv=1.0&ts=1498734793885&seq=521&stype=behavior&s=b576b0c5dbfc85c532ea6b331843d658 HTTP/1.1|404|345
1498735082|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=BRAVIA+4K+GB&vendor=Sony&sdk=24&dpi=320&sv=1.0.9.9&svn=SELF-1.0.9.9&pkg=com.estrongs.android.pop&v=582&vn=4.1.6.6.2&tk=4Z61PC%2BIqaab7NcE5nuBOA%3D%3D&goid=RSB_PHbsrjP-m1DVnHb1nBYYm1D4Qy7BPADVm10knH0YnAw-PjbY&locale=en_GB&ntt=Ethernet&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=1343c004c8dc6428&mdu=adsdk&rv=1.0&ts=1498735085130&seq=85&stype=behavior&s=93bbf7bb74a1f5297f57a5b0cc089db5 HTTP/1.1|404|345
1498735082|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=BRAVIA+4K+GB&vendor=Sony&sdk=24&dpi=320&sv=1.0.9.9&svn=SELF-1.0.9.9&pkg=com.estrongs.android.pop&v=582&vn=4.1.6.6.2&tk=4Z61PC%2BIqaab7NcE5nuBOA%3D%3D&goid=RSB_PHbsrjP-m1DVnHb1nBYYm1D4Qy7BPADVm10knH0YnAw-PjbY&locale=en_GB&ntt=Ethernet&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=1343c004c8dc6428&mdu=adsdk&rv=1.0&ts=1498735085162&seq=85&stype=behavior&s=dd737f9e28bc09043c08949b8b866868 HTTP/1.1|404|345
1498735082|rts.mobula.sdk.duapps.com|POST /orts/rpb?h=1080&w=1920&model=BRAVIA+4K+GB&vendor=Sony&sdk=24&dpi=320&sv=1.0.9.9&svn=SELF-1.0.9.9&pkg=com.estrongs.android.pop&v=582&vn=4.1.6.6.2&tk=4Z61PC%2BIqaab7NcE5nuBOA%3D%3D&goid=RSB_PHbsrjP-m1DVnHb1nBYYm1D4Qy7BPADVm10knH0YnAw-PjbY&locale=en_GB&ntt=Ethernet&ls=e65e2b83c7b1752f00d73335f0a4d238&aid=1343c004c8dc6428&mdu=adsdk&rv=1.0&ts=1498735085191&seq=85&stype=behavior&s=b9cf9efee12e0294e6ed8b75fc54360c HTTP/1.1|404|345
1498735182|192.168.1.58|GET /test HTTP/1.1|404|345
1498735195|192.168.1.58|GET /test.php HTTP/1.1|403|345

Hmm, it is not immediately clear what is happening here... Typically, a website produces a 401 Unauthorized error when special permission is required but sometimes a 403 Forbidden is generated instead, so that cannot be ruled out.

Can you try visiting http://pi.hole/test.php again and send the output of

sudo tail /var/log/lighttpd/error.log

?

We might have to investigate if it is your PHP that is failing somehow.

2017-06-28 22:52:53: (server.c.1828) server stopped by UID = 0 PID = 1
2017-06-28 22:52:54: (log.c.217) server started
2017-06-28 23:06:39: (server.c.1828) server stopped by UID = 0 PID = 1
2017-06-28 23:14:47: (log.c.217) server started
2017-06-28 23:14:57: (server.c.1828) server stopped by UID = 0 PID = 1
2017-06-28 23:14:58: (log.c.217) server started
2017-06-28 23:25:09: (server.c.1828) server stopped by UID = 0 PID = 1
2017-06-29 11:25:18: (log.c.217) server started
2017-06-29 11:25:28: (server.c.1828) server stopped by UID = 0 PID = 1
2017-06-29 11:25:29: (log.c.217) server started

Next step: We need to identify if it is a PHP problem or not.

Please try

echo "<html><body>ABC</body></html>" | sudo tee /var/www/html/test.html

and try to access http://pi.hole/test.html

I can access that site, and it shows ABC. So that's working, now I believe it's a PHP problem...

I agree. But it is strange that there is no mentioning in error.log...

Please try

sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo /etc/init.d/lighttpd force-reload

Ignoring unknown module: fastcgi
Run /etc/init.d/lighttpd force-reload to enable changes

It can't find fastcgi or fastcgi-php as modules...

Please try

sudo apt-get --purge remove lighttpd
sudo apt-get install lighttpd
sudo lighty-enable-mod fastcgi 
sudo lighty-enable-mod fastcgi-php
1 Like