Installing apache2 stops pihole web page from loading

It would seem that Apache changes ownership of directories to www-data.

Please try adding Pi-hole's pihole user to www-data:

sudo usermod -aG www-data pihole

Please report back - if your issue persists despite that change, we may also have to adjust permissions.