Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up a VM with Debian7 for PHP development.

Since PHP needs to write to log files and the like, the www-data group needs write permissions on /var/www/...

I found a good answer here on superuser that makes it go real quick:

However, when I update a project with composer and new cache/log files are created, www-data does not have permission to write to them and I have to execute the last 2 commands again.

I was under the impression that setting permissions to 2775 meant that all future files would have the 775 permission? Or am I wrong about that? Is there a way to prevent having to reset the permissions every time or am I stuck having to do this?

Granted, it's not something that happens often, I'm just curious if there's a way to avoid it, other than setting up a cron job for it.

share|improve this question
up vote 0 down vote accepted

I think this is what you are looking for. This answer describes how to use Access control lists (ACLs) for default permission settings for new files/folders, within a given folder. This is also part of the second answer of the link you provided, where Nikhil Chelliah states the following within his answer:

The setfacl command accepts -s to replace an existing ACL or -m to modify it; -R to make directory ACLs recursive; and -d to make the specified settings the default, which is useful if you're anticipating forthcoming user accounts.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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