Will changing the port of lighttpd affect PiHole’s use?

Raspian lite
lighttpd
apache2
pihole
raspberry pi 4

Yesterday I set up PiHole on a raspberry pi 4 for the first time, I’ve had it for a few years and never used it. I installed pihole, unbound, and pivpn. It’s all working well.

I understand pihole uses lighttpd.

I’m trying to restart apache2, which I just installed, and I’m unable to because lighttpd is using port 80, which apparently apache does as well.

So, I’m wondering if I change the port number (never done something like this before) will it affect the way pihole works, will I have to make other changes elsewhere (in my router, for instance)?

Thank you for any help, and time.

You can safely change the port used by lighttpd.

A permanent method of changing the lighttpd port (for lighttpd version 1.4.46 or later):

Check your lighttpd version with this command.

lighttpd -v

If that returns 1.4.46 or above, you can overwrite the port from Pi-hole's lighttpd.conf in your external.conf like this:

server.port := 8888

Note that the := operator isn't supported in older versions of lighttpd .

So, I went to do as you've suggested and before doing anything I thought I'd just reboot the Pi. After restart I'm able to restart apache and it's using port 80. Does that mean pihole is now using apache? Because I'm still able to access the pihole ui without issue. I didn't do anything.

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

Here it is:

https://tricorder.pi-hole.net/4Nu3hSoz/

edit: i appreciate the help

Reading your debug log (you can read it too at /var/log/pihole/pihole_debug.log), the web interface is running using Apache.

Just remember, Apache is not officially supported by Pi-hole and the debug log can't find Apache errors or PHP errors if you use Apache.

Ok, so I'll use another Pi for what I wanted to do. If I remove Apache will I need to do anything else to get Pihole to use lighttd?

Edit: thanks for your reply I appreciate it

If you want to use pi-hole web interface after removing Apache, just revert the changes you made to external.conf and restart all services.

As I said I didn’t make any changes, apache2 just took over lighttpd’s role after a reboot. So I just uninstalled apache2 and did a reboot of the pi and it’s working. I can access the pihole ui on 192.168.50.168/admin

Thank you!

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