Pi Server port change issue

The issue I am facing:
Been trying to change the server port for Pi-hole from default 80 as will be deploying Open Media Vault on the same device. Was able to change "server-port" from 80 to user-defined one in lighttpd.conf file but as many have said that this isn't a permanent solution as Pi-hole would revert to 80 upon next update.

Solution was said to be making similar entry in external.conf BUT that is an empty file and when I do make a such an entry into it and then try to restart lighttpd service I get the error:-
"Job for lighttpd.service failed because the control process exited with error code. See "systemctl status lighttpd.service" and "journalctl -xe" for details."

Been referring to this link for it; raspbian - How Do I Change Pi-Hole's URL Path? - Raspberry Pi Stack Exchange
Details about my system:
Raspberry Pi 4 4GB variant, connected to an ONT via Ethernet cable and Router's DHCP configuration has Pi's Ethernet interface IP as DNS
What I have changed since installing Pi-hole:
Nothing, except the server port in lighttpd.conf file

You're out of luck here:
While Pi-hole won't touch external.conf, settings in there are not allowed to conflict with PI-hole's own settings, i.e. you cannot reassign its port.

You'd have to stick with changing lightttpd.conf and rememberiing to edit it again after updates.

Alternatively, you may try to configure OVM's webserver to host Pi-hole's UI as well.

Pi-hole's support is limited to lighttpd, but you may find a user who has solved that problem for OMV.

To increase your chances to attract such users, try to put OMV in your topic's title. :wink:

@Bucking_Horn Is it possible to make a copy of lighttpd.conf in a personal directory (such as desktop) and copy it back to /etc/lighttpd/ every night using a corn job, maintaining all permissions using a flag of cp?

Sure, it will be overwritten and you'll have to restart lighttpd to get the config you want loaded.

@DanSchaper I’m fine with doing a reboot. I do it every night using crontab already. Do you think you will be changing lighttpd.conf in future versions of pi.hole? If not, I’ll give it a shot.

Here's a “do it all” maintenance shell script
Run daily or weekly using crontab

sudo pihole -g
sudo apt-get -y update
sudo apt-get -y upgrade
sudo cp -p /home/pi/Documents/lighttpd.conf /etc/lighttpd/lighttpd.conf
sudo reboot

Already done by Pi-hole every Sunday morning.

Don't do this. Read the release notes and then decide if the update is something you want to install.

1 Like

ok. I'd rather run it every night so that it is more recent. On sudo pi-hole -up, I feel comfortable updating, as I can downgrade if it causes issues, but thanks for telling me

Not in all cases. The update to V5.0 was not reversible, and future updates may be similar.

thanks for telling me. I will remove it then

Hint :wink:

@deHakkelaar Thanks for the help, but I already figured out that sudo cp -p works

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