Lighttpd failed to start on fresh install - configuration issue

Hello,

More than a year I am running Pihole without any issue on Debian Buster with Armbian Linux 5.1.0-aml-s905. I don't know Linux. All this time I only do Pihole install and update by copy paste Linux command from tutorial website, nothing else

But since last update (Pi-hole v5.10 FTL v5.15 Web Interface v5.12) the DNS Server stop running and Pihole has error message "There was a problem applying your settings. Debugging information: PHP error (2): fsockopen(): unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:43"

Already tried uninstall then install Pihole again. First fresh install running fine, but after 2 days the same error happen again.

Post this issue on Pihole Github - Bugs in Pi-hole v5.10 FTL v5.15 Web Interface v5.12 and suggest me to uninstall Apache2 which is interfering with Pihole lighttpd..

I did uninstall Apache2 but after that I am unable to browse Pihole web interface because lighttpd fail to start which looks like a configuration error.

And that is why I am finally in here because they suggest me the place to get help about lighttpd configuration error is in here.

Please help, thanks

"

EDIT:
I've been using your debug log at https://tricorder.pi-hole.net/UNs1ypoV/ as provided by you in your GitHub issue.

There's something off with your routing.
Your router's DHCP server is pushing 192.168.0.249 as your network's router/gateway:

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   * Received 548 bytes from eth0:192.168.0.249
     Offered IP address: 192.168.0.34
     DHCP options:
      Message type: DHCPOFFER (2)
      router: 192.168.0.249
      --- end of options ---

Commonly, routers would tend to assign the first (.1) or last (.254) avallable IP address to themselves. Yours using a .249 would seem unusual (but not at all harmful).

But your routing table looks strange:

*** [ DIAGNOSING ]: Network routing table
   default via 192.168.0.249 dev eth0 onlink 
   default via 192.168.0.253 dev eth0 src 192.168.0.250 metric 202 
   169.254.0.0/16 dev eth0 scope link metric 1000 
   192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.250 metric 100 
   192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.250 metric 202

IPv4 link-locals (169.254.0.0/16) are expected to show up only on devices with no means of address assignment, but your device clearly has been able to assign an IP address to its eth0 network interface. That said, I don't think that should cause any issues, even if it's unexpected.

What could cause issues is that your routing table shows two default routes for the same network interface (eth0), one via your .249 and one via .253.

While .249 seems to match the actual IP of your router, the corresponding route seems to have been forcefully added to the routing table, as suggested by onlink (which would prompt your OS to skip connectivity tests for that route and add it to the routing table regardless).

Your debug log would further suggest that your router (perhaps an Asus ROG GT-AC5300?) would indeed have resided at .253 at some stage in the past, at least when Pi-hole was your DHCP server:

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d
-rw-r--r-- 1 root root 2.7K May 14 14:17 /etc/dnsmasq.d/04-pihole-static-dhcp.conf
   dhcp-host=xx:xx:xx:xx:xx:xx,192.168.0.253,GT-AC5300

Incorrect routing could also explain why your debug log shows your Pi-hole host machine to be unable to contact public DNS servers:

*** [ DIAGNOSING ]: Operating system
[i] dig return code:  9
[i] dig response:  ;; connection timed out; no servers could be reached
*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] ads2.hsoub.com is 0.0.0.0 on lo (127.0.0.1)
[✓] ads2.hsoub.com is 0.0.0.0 on eth0 (192.168.0.250)
[✗] Failed to resolve doubleclick.com via a remote, public DNS server (8.8.8.8)

*** [ DIAGNOSING ]: Name resolution (IPv6) using a random blocked domain and a known ad-serving domain
[✓] www.informacja2273.site is :: on lo (::1)
[✓] www.informacja2273.site is :: on eth0 (fe80::215:18ff:fe01:8131)
[✗] Failed to resolve doubleclick.com via a remote, public DNS server (2001:4860:4860::8888)

Did you change your router's configuration lately, or introduce some change in your network equipment, like adding or reconfiguring additional network equipment (APs, switches, routers,...)?

If there is any change on my network, off course I will know the cause of this issue. But I didn't change anything in my network, also I didn't buy new network equipment in the past 1 year.

The only change is I did Pihole update. Previously no issue with Pihole update, everything is fine. Then after last update - Pi-hole v5.10 FTL v5.15 Web Interface v5.12 - Pihole begin out of service and shows error

That is why the first thing I though there is bug in Pihole which cause this error

No router firmware/software updates? No OS updates on the Pi-hole host device?

I never do router firmware update. Because if anything goes wrong than I have trouble my whole house internet connection will be out of service.

Once I do OS update on Pihole machine. But the OS update happen long ago when first time installing Pihole.. As I was said before I don't know Linux, if anything goes wrong then I don't know how to fix it.

The only thing I do is Pihole update which I do every time Pihole has update. Because every time Pihole release something new, the notification show in my browser that I have to update Pihole. No issue with previous Pihole update, this error only happen with the latest update.

I think the Pihole latest update has something that seriously wrong.

For example, I didn't know if Pihole webserver (lighttpd) will be conflict with Apache2. Also I didn't know that in my Pihole machine already installed Apache2.

But why this web server conflict not happen on many previous update?

The first time I unable to browse Pihole web interface after uninstalling Apache2 (as suggested by Pihole Github). So my assumption, all this time the previous update using Apache2 as web interface and not lighttpd. And old version Pihole didn't complain about this because no error happen.

As we have previously noted, Pi-hole has zero involvement with the Apache2 package. That is installed separately by either the OS or by you.

Sorry but you missed the point.

This issue is not about who installed Apache2. Since beginning Apache2 already in Pihole machine which I and the old version Pihole didn't aware about it.

All this time Pihole old version works fine although in this machine already has Apache2. Even the Pihole old version use Apache2 as its web server.

The first time I am unable browse Pihole web interface after uninstalled Apache2 and Pihole lighttpd fail to run because configuration error.

That is why I assume the cause of this issue is on latest Pihole update

I also assume this error "There was a problem applying your settings. Debugging information: PHP error (2): fsockopen(): unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:43" is not cause by Apache2 conflict with Pihole lighttpd

Previously before uninstalled Apache2, I can uninstalled Pihole then do fresh install Pihole and still able browse Pihole web interface. Latest version Pihole will be working fine although Apache2 already in this machine.

But the problem is the above error will happen again after few days running Pihole fresh install. To solve this error I should endlessly uninstalled Pihole and do fresh install Pihole again.

You should worry about the webserver issue later.

Your routing issue is more severe.
There ought to be only one default route per network interface, and only one router/gateway per subnet. As your routing table shows, the count is two for each of those in your case.

I cannot know whether that would be normal or intended for your network, but your debug log suggests that your OS cannot communicate with remote machines (or DNS servers, at least), quite probably because it isn't able to correctly determine a default gateway: Your debug log shows your Pi-hole's DNS portion to be fully operational, but Pi-hole cannot forward queries to public upstreams, effectively disabling all DNS resolution of public, unfiltered domains.

Until that is solved, you won't be able to use Pi-hole as DNS server.

You should start by trying to find out why there are two router IP addresses on your eth0 network interface.

4 posts were split to a new topic: PHP error (2): fsockopen(): unable to connect to 127.0.0.1:4711 (Connection refused)

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