Archive for the ‘ Gentoo Prefix ’ Category

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
Advertisements