Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: http://superuser.com/a/19333

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

1 Answer 1

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

 
discard

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.