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.

1 Answer 1


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .