Dont need to do that.
During install, you were asked two questions:
- Install web server (
lighttpd
); - Install web files/interface (in
/var/www/html/
).
These are stored in below file:
pi@ph5b:~ $ cat /etc/pihole/setupVars.conf
[..]
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
[..]
So setting INSTALL_WEB_SERVER=false
, makes sure that Pi-hole wont install lighttpd
+ PHP dependencies.
But keeping INSTALL_WEB_INTERFACE=true
, makes sure the web files are installed in that /var/www/html/admin/
folder that can be used as a DocumentRoot
for a VirtualHost
in apache2
.
Below the PHP web dependencies that are also needed for apache2
:
pi@ph5b:~ $ curl -sSL install.pi-hole.net | grep -i deps
[..]
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php-common php-cli php-pdo php-xml php-json php-intl)
[..]
And the www-data
user, under which apache2
runs, needs to be a member of the pihole
group to be able to write to certain locations.
With below you can check
pi@ph5b:~ $ groups www-data
www-data : www-data pihole
And below can be used if you want to add the www-data
user to the pihole
group:
sudo usermod -a -G pihole www-data