1

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?

2 Answers 2

2

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
  • +1 for a starting point but this is only half of the solution, see also my response...
    – hurikhan77
    Jan 11, 2012 at 15:08
1

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.

You must log in to answer this question.

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