[RPi, Apache2] Problems after v6 upgrade, UI no longer reachable, FTL not starting up

Hello,

I am currently using Apache2 as my web server on my Raspberry Pi and I noticed only after upgrading that the PHP files were overwritten by LP files. As there is no documentation about these changes, what are these LP files, and how can Apache parse them?

The only documentation there is is in the changelog.

If I use lighttpd, it is only able to deliver 2 pages: 403 if the requested file or folder exists, 404 if not.
I can't get FTL to start so my local CNAME's don't work either.

I first upgraded from v5 to v6, then reinstalled pihole v6.

EDIT: Actually, I may not need apache to parse those files, but if I could use the /admin folder as I always have until now, it'd be great.

How do I solve all of this?

I'm trying to find a solution as well, but I still need help.
I installed libapache2-mod-lua, enabled the Lua mod, and added this to my 000-default.conf file.

<IfModule mod_lua.c>
  #AddHandler lua-script .lp
  #LuaRoot /var/www/html/admin
  <Directory /var/www/html/admin>
    Require all granted
    AddHandler lua-script .lp
    SetHandler lua-script
  #</Directory>
</IfModule>

This URL doesn't work yet : http://127.0.0.1/admin/%3C?=pihole.fileversion('scripts/js/charts.js')?>.

I got AH02330: lua: Failed to obtain Lua interpreter for entry function 'handle_err' in /admin/sparx.lp, referer: http://127.0.0.1/admin/, though obviously sparx.lp doesn't exist.

Now getting AH01482: Error loading /var/www/html/admin/index.lp: @/var/www/html/admin/index.lp instead.

The permissions on the /var/www/html/admin folder are 755 and it is owned by www-data:www-data.

I should add that I'm getting 403'd when using Lighttpd, even if I set permissions to 777. Do not tell me those changes were tested before they got merged to v6.

I can't figure anything else out as there is strictly no discussion or documentation about those LP files and what they are.

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 if you run your Pi-hole as a Docker container:

docker exec -it <pihole-container-name-or-id> pihole -d

where you substitute <pihole-container-name-or-id> as required.

There you go: https://tricorder.pi-hole.net/fY9psJJH/

What I have done since yesterday that's not included in the above link:

  • Use port 3002 in the FTL webserver configuration, at least any other than 80 and 443 since they're already in use.
  • Made pihole a member of the www-data group.
  • Made www-data:www-data the owner of the /var/www/html/admin contents with rwxrwx--- permissions.
  • Restarted pihole-FTL.

Now all I get are 403 listing errors when browsing 127.0.0.1:3002 with no error logged to the /var/log/pihole/webserver.log file. By the way, what are these LP files?

On a quick note, even if I think this is obvious, v5.x web UIs don't work. Why would we break something that works perfectly well?

Same problem here. Everything worked with apache2 and pihole until i updated to pihole 6. Now i just get a file-list when trying to access the admin panel of pihole.
debug.log: https://tricorder.pi-hole.net/R4VVRs9j/

That's likely because they are generated by your Apache.

Pi-hole v6 comes with an embedded webserver, so neither lighttpd nor PHP are used anymore, as mentioned in Introducing Pi-hole v6.

As you are running Apache, you may not have been shown a dialog box about disabling lighttpd during your v6 upgrade.

I'm not fluent enough in Apache to help you get lua scripting to work, but I can help you sort port conflicts.

Currently, your Pi-hole tries to listen on the same port as your Apache, which will prevent it from starting at all if Apache is already active.

*** [ DIAGNOSING ]: contents of /etc/pihole
(…)
-rw-rw---- 1 pihole pihole 51K Feb 22 16:01 /etc/pihole/pihole.toml
(…)
   [webserver]
     (…)
     port = "80o,443os,[::]:80o,[::]:443os"

To avoid port conflicts, you should set webserver.port.

You should either move it to some other ports, e.g. via CLI:

sudo pihole-FTL --config webserver.port '8088o,8443os,[::]:8088o,[::]:8443os'

Instead of trying to get lua working in Apache, that would allow you to consider to using Pi-hole's webserver.

Or, if instead you'd want to disable it, you could set webserver.port to an empty string:

sudo pihole-FTL --config webserver.port ''

Note that if this value is not set (empty string), the web server will not be started and, hence, the API will not be available.


Unrelated to your issue, your debug log shows that your router is advertising its own IPv6 addresses as DNS servers:

     Recursive DNS server 1/2: 2a<redacted>40
     Recursive DNS server 2/2: fe<reddacted>40
This would allow IPv6 capable clients to by-pass Pi-hole and should be addresses in your router (click for details)

You'd have to find a way to configure your router to stop advertising its own IPv6 as DNS server, or to advertise your Pi-hole host machine's IPv6 instead.

You'd have to consult your router's documentation sources on further details for its IPv6 configuration options.

If your router doesn't support configuring IPv6 DNS, you could consider disabling IPv6 altogether, provided you'd not depend on IPv6 for reasons.

If your router doesn't support that either, your IPv6-capable clients will always be able to bypass Pi-hole via IPv6.

You could then try to mitigate this, by setting Pi-hole as the only upstream of your router, provided your router supports it.
But note that you won't be able to attribute DNS requests to original individual IPv6 clients in such a configuration.

2 Likes

That was what I thought as well: moved it to port 3002 instead, since 3000 is already in use by something else and use integrated web server instead of Apache. In that case, I guess that /var/www/html/admin is now meaningless and useless?

Can't get this to work. I plan to add https to the Web UI as well, but I keep that for later.

Will be resolved once I get Pi-Hole to work as usual. Well, my ISP doesn't let me edit upstream DNS but, hey, they let me disable everything IPv6-related, so I think I'm going to do this.

Okay so reinstalling got the thing to work as expected, it means that the Web UI is now listening on port 8080, as intended. I still don't understand that, when using port 3002 before reinstalling, it didn't respond and got me a directory listing error. Must've done something wrong.

/var/www/html/admin is still useful after all. So, third time, what is the .lp file extension?

Solution was to reinstall AND/OR to bind to other ports. Their Web UI is apparently meant to listen on ports 8080 and 8443 if the standard 80 and 443 don't work. I did not edit my Apache config file after reinstalling PiHole. You may not need to reinstall PiHole after all.

On a quick note, some strings appear to be missing in the Settings. Shouldn't v6 be marked as pre-release on github?

Thank you very much!
That did it for me.

4 posts were split to a new topic: Why does pihole-FTL --config webserver.port xxx -f not work?

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