0

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.

2

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.

Example:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.