Change "server.document-root" for lighttpd

The issue I am facing:
I want to change the server.document-root from the default /var/www/html to e. g. /var/www/pihole.

For this I

  • renamed the folder with cd /var/www; mv html pihole and
  • edited /etc/lighttpd/external.conf to use server.document-root = "/var/www/pihole" and
  • restarted lighttpd with sudo service lighttpd restart

That gave an error, lighttpd can not start. Using server.document-root := "/var/www/pihole" in the external.conf works (lighttpd service starts), but now browsing http://pi.hole/admin gives a 404.

I don't know how to achieve this. I checked

Details about my system:
Raspberry Pi OS
Only other external.conf line is server.bind = "xxx.xxx.xxx.xxx" [local pi-hole server address]

What I have changed since installing Pi-hole:
See above.

Is this impossible? :frowning:

I don't recommend.

From lighttpd point of view is possible, but Pi-hole installer and pihole -up (and maybe a few other functions) expect to find the web interface repo in /var/www/html. This change will break at least the update process and version check.

Thank you, that's very helpful. I wonder if this "needs to be this way" (static - so maybe it is necessary to have a default path set) or if it's possible to remove those hard coded parts and replace them by a variable/placeholder like it is done for other parts already.

/var/www/html -> /var/www/$webroot where $webroot = pihole|html|whatever