Append apache to www user on Mac OS X 10.6

As a vivid user of Gentoo Prefix I normally don’t mind getting my hands dirty.😉
But from time to time, when I install or update apache, I forget to change Gentoo’s default “apache” user to OS X’s “www”. And then I wonder why apache does not start anymore.😦

But thanks to a colleague of mine and dscl, the Directory Service (aka Apple’s LDAP implementation) command line utility integrated in 10.6, this will come to an end:

# Add apache to the system default web-server user
sudo dscl . -append /Users/www RecordName apache

# And don't forget the group
sudo dscl . -append /Groups/www RecordName apache

# It succeeds without feedback, so better check it ^^
sudo dscl . -read /Users/www
sudo dscl . -read /Groups/www

Awesome! Now I don’t have to alter httpd.conf, watch dispatch-conf closely after upgrading apache or alter some obscure webapp-config files anymore because they can’t find the apache user!😉

References

  • man(8) dscl
    • Woot
    • July 5th, 2011

    Just what I needed ! Thanks !

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: