I have searched for recent posts on this, and older ones do not fix the issue. I have Rasbian Buster (2021) on a pi4. Apache2. The default /var/www/html works trying to move it to a hdd /media/pi/Data/www/html fails I have given it www-data user and group permissions for all folders. I have checked that it has this in GUI and console. Looking at the permissions on /var/www/html they are ROOT when apache2 is installed and this site works. BUT all documents say it should be www-data. Ihave not tried changing it as it will probably break it and is my reference. I have checked that apache2 envars APACHE_RUN_USER = www-data and APACHE_RUN_GROUP=www-data
So why does it install /var/www/html as ROOT but all documents (rightly) say www-data should have permissions then it still not work?
For example I followed https://pimylifeup.com/raspberry-pi-apache/ and logged ou etc and it still fails ith Forbidden :Yu dn'thave permission to access this resource. There seem to be varying ways to fix it, but not so only www-data has access, and I shouldn't need ROOT to have it as its very bad practice...so why does the default site have it?!
Wht is the correct fix to use adifferent directory for the website (eventualy it will be webdav but one simple step at a time!) Thank you