Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

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.

share|improve this answer
add comment

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.