mikaelrandy
mikaelrandy

Reputation: 281

How to add a user to apache group on Mac Os X?

I'm actually trying to run Symfony2 on my MacBook Pro (Mac OS X 10.6).

When i launch my application by apache, all cache and log file are created by the _www:_www user/group. But, i already have to edit these files in the CLI, with my own user.

My question is : how to add my user to the _www group ?

I have tried to edit the /etc/group to add my user name to _www group, restart apache : fail I have also tried to edit /etc/apache2/httpd.conf to change user and group used by Apache : complete error acces.

Anyone have an idea ?

Upvotes: 28

Views: 24144

Answers (3)

Raj Wilson Dsouza
Raj Wilson Dsouza

Reputation: 171

I was facing the same issue just to make it global on your personal mac not production i would suggest to run this and you will never have to do chmod again

sudo dseditgroup -o edit -a _www -t user staff

Upvotes: 9

swisscheese
swisscheese

Reputation: 1775

sudo dseditgroup -o edit -a your_username -t user _www

Upvotes: 52

Benji
Benji

Reputation: 807

I'd suggest the same as above but here's a bit more copy/paste friendly version:

sudo dseditgroup -o edit -a `whoami` -t user _www

Upvotes: 45

Related Questions