I am working on a desktop environment with Ubuntu 18.04.
I have my Apache 2 server setup with multiple websites in the folder
/var/www/ (each site lives in its own folder there)
Made myself owner and assigned www-data as group :
sudo chown $USER:www-data -R /var/www
Fixed permissions with :
sudo chmod -R 774 /var/www
Everything works fine, untill I add a file or add a new website (git pull). New files will not come with the group www-data. Disallowing Apache to run.
This is fixed by re executing
sudo chmod -R 774 /var/www, but this doesn't feel like a fix.
What do I do wrong?
Edit: It seems
git pull doesn't respect the permissions I have set earlier. Even though the parent folder has the permissions set correctly.