I support a dev server for WordPress sites. Server is using the Nginx/php-fpm stack. I'm struggling with setting up file and directory permissions so that www-data has read and write access while our developers in the users group can have the same ability to read and write files/directories. How would this be accomplished without killing security best practices.
This may not be best practice but I typically create a new group for the site, add the users to the group including the web server daemon user (apache in my case), change the permissions on the site dir and then set the group sticky bit.
Site dir: /var/www/site1
# groupadd site1 # useradd -G site1 user1 # useradd -G site1 user2 # useradd -G site1 apache # chown -R apache:site1 /var/www/site1 # chmod -R 770 /var/www/site1 # chmod -R g+s /var/www/site1