For the last few days my web server has been crashing. It happened because I put a gallery online and as people look at it it spans more and more threads to cope with the additional demand. As long as I didn't have more than 15 threads at a time it was fine.
The crashes started coming more and more often, though and I could not figure it out. So I tried a few things until I found this little gem.
In Leopard, Apple changed all the daemon usernames to have a leading underscore in the name - e.g. 'www' became '_www'. However, part of the upgrade process fails to update httpd.conf to reflect this change (this can also happen if you've manually copied your old httpd.conf from 10.4). As a result, Apache is trying to locate the 'www' user to run as, but can't (because it doesn't exist), hence the fatal error.
The solution is simple. Edit your httpd.conf (/etc/apache2/httpd.conf if you're using the standard Apple build) and change the line:
and restart apache.
Why in heaven's name would you change that? Was it a security feature? Was it an optimization feature? Why did it have to be different? Gah! All that pain for something so stupid.