I'm on Mac OS X lion, and I use apache for php and rails development. What groups or permissions should I set so that apache, through the _www user/group has full read/write access to my website directories (located in ~/Projects) but also keeping my own read/write access for changing files?


Set group to _www, user to your username and permissions to 770 i.e.

sudo chown username:_www ~/Projects -R
sudo chmod 770 ~/Projects -R
  • +1 for a starting point but this is only half of the solution, see also my response... – hurikhan77 Jan 11 '12 at 15:08

In addition to what @lsmooth wrote, if you want newly created files in a directory stick with the group ownership of this directory you have to set the group sticky bit in the file permissions which passes permission bit AND owner ship for the group to newly created files.

sudo chmod g+s path/to/directory

The MacOSX toolchain is different from the GNU toolchain, but with GNU find you can apply this to all directories in the following way:

find ~/Projects -type d -print0 | sudo xargs -0 chmod g+s

Usually POSIX semantics implement this behaviour, not sure if MacOSX does so also.

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.