Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OSX Mountain Lion and Apache 2.2.22.

I have always had the httpd.conf set as:

User www Group www

and it was running as such. Until today. Rebooted the server for another reason and when I tried to make some changes to a website via FTP this evening, it said access denied. Got to looking at the processes and httpd is now running as _www. WTH?

Now of course all of my users are getting denied messages I assume because they were all created and permitted with the www user, not _www.

Any idea why this happened or what I may have done to cause it?

share|improve this question

closed as not a real question by MDMarra, Magellan, Brent Pabst, mdpc, Scott Pack Nov 5 '12 at 21:27

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

A quick web search shows that _www is the user/group for apache on OS X installs since at least Leopard.

You're barking up the wrong tree if you think it's because the user name changed. In all likelihood that name did not change, you just didn't notice the underscore.

share|improve this answer
I'm not using the built-in OSX web server. I installed Apache with MacPorts and it has always run as user "www" until yesterday. With the https.conf file telling it to run as "www", that's what it should run as regardless. – Ethon Bridges Nov 4 '12 at 15:43
An equally quick web search shows that Macports installs of apache also use _www. – MDMarra Nov 4 '12 at 18:46
I'm not crazy, it WAS running as www. This also does not explain why it is running as such when the directive is telling it to be "www"? There is definitely a problem. Anything uploaded now under the _www user works, but anything uploaded when it was running as www gives a denied permission. – Ethon Bridges Nov 4 '12 at 19:02

In the default user setup of OS X, www is an alias of the _www user (and similarly www is an alias of the _www group). Note the RecordName listings here:

$ dscl . -read /Users/www

AppleMetaNodeLocation: /Local/Default
NFSHomeDirectory: /Library/WebServer
Password: *
PrimaryGroupID: 70
 World Wide Web Server
RecordName: _www www
RecordType: dsRecTypeStandard:Users
UniqueID: 70
UserShell: /usr/bin/false

$ dscl . -read /Groups/www
AppleMetaNodeLocation: /Local/Default
GroupMembership: _devicemgr _teamsserver
Password: *
PrimaryGroupID: 70
 World Wide Web Server
RecordName: _www www
RecordType: dsRecTypeStandard:Groups

One possibility that occurs to me is that you may have somehow created another account with the name www, and the system is getting confused between that and the builtin one. You can check for this with dscl's search command. Here's what the output should be:

$ dscl . -search /Users RecordName www
_www        RecordName = (
$ dscl . -search /Users RealName www
[no output]

If you see any additional matches for either RecordName=www or RealName=www, that's almost certainly the problem. Another thing to check is the numeric file ownership on the files you're having trouble accessing, with ls -ln. If they're assigned to user and/or group 70, that's the builtin system user & group. Note that depending on how your site is set up, it's entirely normal (and even desirable) for the web files to not be assigned to the web server, so them being assigned to something else is not necessarily a sign of trouble.

share|improve this answer
Most of the files are either 80 (www?) or 501 (admin/staff). There are no files assigned to group 70 anywhere on the server's document directories. – Ethon Bridges Nov 5 '12 at 3:42
80 is the admin group, and 501 is (generally) the first user account on the computer (i.e. the initial admin account). These are both reasonable things to see in your web files. I'm guessing here, but I suspect the _www vs. www issue is a distraction that has nothing to do with what's really going wrong with your server. – Gordon Davisson Nov 5 '12 at 7:34
@GordonDavisson I agree as well. Maybe two people telling him this will make him believe it :) – MDMarra Nov 5 '12 at 19:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.