I'm on a Mac, but I guess it applies to Linux too, since I'm using a command line. When I write web applications, the apache user (which is _www on a Mac) has to be able to edit files as well as me.

Also, I don't want to set this for every single file or folder, I would like to set up the root folder and then I and _www will have access to every file inside this root directory.

As it stands now, I have to use chown or edit with sudo to accomplish things.

link|improve this question

40% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Add yourself to the group _www and add write permission to the group.

 usermod -a -G _www your_username 
 chgrp _www filename
 chmod 775 filename
link|improve this answer
1  
Great, thanks! This got me to an answer, so I'm set you answer to accepted. Just two things I had to do also / differently: useradd is not a command on a Mac, so I had to use this command: sudo dscl . append /groups/_www GroupMembership my_username. Also I had to do sudo chmod -R g+w root_folder so that the _www group (which I am a part of now) can write to files. – duality_ Jun 17 '11 at 10:40
feedback

Your Answer

 
or
required, but never shown

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