I have apache set to the _www user account. Every time I create a file in the site directory, It's getting created with owner/group of myusername / wheel, so apache doesn't have access to it and I have to go chown+chmod the folder/files. Looking for either a "correct" setup or any suggestions.

This is a development machine.

link|improve this question
feedback

1 Answer

You could create a group called www-admin and add yourself and apache to it. When you work on the website, change your active group to www-admin and make sure the files are readably by group. You'll still own the files, but Apache will have correct access to them. Here's a guide on Unix Groups.

If this machine has more than one user, you could also consider moving to using per-user web directories and setting up Apache with su-exec so it'll run as the user that owns the directory. This probably isn't necessary or useful on most dev machines, though (this is the setup that shared hosting companies use).

link|improve this answer
Thanks for the suggestion, but I'd still have the same issue if doing anything outside of terminal, e.g. from finder / photoshop – cwolves Jul 5 '11 at 21:39
You might be best off going the su_exec way, then (which I just edited in). Documentation here: httpd.apache.org/docs/2.2/suexec.html – jcrawfordor Jul 5 '11 at 21:42
feedback

Your Answer

 
or
required, but never shown

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