Lighttpd with PiHole and additional sites

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
dunxd
Posts: 1
Joined: Tue May 04, 2021 10:09 pm

Lighttpd with PiHole and additional sites

Post by dunxd »

I have been facing some challenges creating a new website alongside my installation of pihole, with DietPi as the underlying operating system. I had been following some instructions specific to PiHole, but it seems these aren't compatible with DietPi's implementation of lighttpd.

To get around this I have created an additonal conf file at /etc/lighttpd/conf-enabled/external.conf with the necesary configuration to serve the additional site. Is there a more recommended way of doing this? Am I at risk of having this config file overwritten with an update to DietPi?
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Lighttpd with PiHole and additional sites

Post by Joulinar »

Hi,

easiest way is to install PiHole via dietpi-software. This will ensure you are able to run additional software components, like other web services. If you install PiHole another way, like the PiHole guide, PiHole will hijack the web server as it believe being the only web application. This indeed will create challenges if you like to host something else. Therefore it's highly recommended to used dietpi-software
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2924
Joined: Sat Nov 18, 2017 6:21 pm

Re: Lighttpd with PiHole and additional sites

Post by MichaIng »

Since the lighttpd.conf is not what Pi-hole support was expecting, I guess Pi-hole was already installed via dietpi-software, wasn't it? Using /etc/lighttpd/conf-enabled/external.conf will work perfectly fine, or any other file name with .conf ending. To use the Lighttpd tools a little more as intended, use /etc/lighttpd/conf-available/99-<mySite>.conf and then lighty-enable-mod <mySite>. That is a bit more the way how vhost and config snippets in other webservers like Apache2 are handled, so that a config file does not need to be removed but can be enabled/disabled instead. Practically only a symlink from conf-available to conf-enabled is created.
Post Reply