This started when I noticed one site was giving client denied by server configuration errors in the Apache error.log but only on certain files in one local site. The rest of the site and all other sites were fine and did not give the error. Since all had the same permissions, it seems odd but trying to kill two birds with one stone, I started looking at permissions and ownership as follows.
Trying to keep the permissions compatible between my local development system and the live server which requires 755 permissions on the folders and 644 permissions for files, I've set mine on the local development system to those same permissions using:
sudo cd /var/www/html
sudo find . -type d -exec chmod 0755 {} \;
sudo find . -type f -exec chmod 0644 {} \;
However, with those permissions and user/ownership for both as www-data
I can no longer save new or edit changed files even though my own user name is part of the www-data group. I am running Apache2 on Ubuntu 20.04.
UPDATE: I didn't like having to do this but had to get it working so I made myself the owner using sudo chown -R don:www-data /var/www/html
which at least it lets me keep the 644/755 file/folder permissions while still being able to read and write to the files. I would love to hear how to make it work with the proper www-data user, though!
However, the client denied by server configuration
error is still there on some files in the Apache error.log file. Any ideas for getting rid of it? All files and folders have the proper permissions so not sure why this is happening on a couple files and only on one single site.