Jan 13, 2012
tom

OSX equivalent to sudo chgrp -R www-data

Question

I normally do

sudo chgrp -R www-data <directory>

on Ubuntu to set a folder writable by the Apache process. What’s the Mac OS X equivalent for www-data?

Answer

On Ubuntu you use “www-data” because that is the user the Apache process runs as. You can identify the user Apache will use by checking the config file. On my Mac, it looks like this:

$ cat /etc/apache2/httpd.conf
[...]
User _www
Group _www
[...]

So one way to make your files writable would be to chgrp them to _www.

Related posts:

  1. OSX equivlaent to sudo chgrp -R www-data
  2. is it safe to chmod 775/664 with owner www-data:www-data?
  3. Setting umask for www-data user (run via sudo) on Ubuntu 10.04 LTS
  4. Is adding users to the group www-data safe on Debian?
  5. How to let Apache access /home/*/www/?

Leave a comment