You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apache2: UserDir Sites

On Mountain Lion w/ Server installed:


All I want is for:

http://localhost/~user

to work


I have played with UserDir setting in httpd.conf (it's actually in /private/etc/apache2/extra/httpd-userdir.conf - but I've played with moving it around from there to httpd.conf, etc.)


For the life of me I can't get it to work.


ownership/perms for Sites:
drwxr-xr-x 3 user staff 102 Jul 29 10:04 Sites


http://localhost/~user results in a 404


The error in the logs is:

[Tue Jul 31 17:13:21 2012] [error] [client fe80::226:8ff:fee1:382] File does not exist: /Library/Server/Web/Data/Sites/Default/~user


This has to be stupid simple but I'm not seeing it.


mod_userdir is there and being loaded (not commented out).

I see nothing that would stop this but, obviously, it's not working (unless it's the group on the Sites directory).


Any help is appreciated.


From /private/etc/apache2/extra/httpd-userdir.conf:

#

# UserDir: The name of the directory that is appended onto a user's home

# directory if a ~user request is received. Note that you must also set

# the default access control for these directories, as in the example below.

#

UserDir Sites


#

# Users might not be in /Users/*/Sites, so use user-specific config files.

#

Include /private/etc/apache2/users/*.conf

<IfModule bonjour_module>

RegisterUserSite customized-users

</IfModule>


That tells me that it should just do the UserDir Sites bit. I've tried it with/without the user.conf file which is included at the bottom.


What am I missing?


Thanks,

Brad

Mac mini, Mac OS X (10.7.3)

Posted on Jul 31, 2012 2:18 PM

Reply
20 replies

Jun 14, 2014 7:56 PM in response to Brad Bishop

This is not working for me with 10.9.3 and server admin 3.1.2 on a brand new machine. I had previously used the methods described above but there now seems to be one more problem. After defining the user .conf files and enabling the include of httpd-userdir.conf I now get the meassage:


Jun 14 12:04:29 macpro2014.local Server[67199]: XSWebConfig:ERROR:

Syntax error on line 10 of /private/etc/apache2/extra/httpd-userdir.conf:

Invalid command 'UserDir', perhaps misspelled or defined by a module not included in the server configuration


It appears that mod_userdir is no longer enabled by default. This should be straightforward, but who knows.

Jun 14, 2014 8:43 PM in response to Dave Rocks

Ok. In httpd_server_app.conf I enabled line:


LoadModule apple_userdir_module ${SERVER_INSTALL_PATH_PREFIX}/usr/libexec/apache2/mod_userdir_apple.so

and

Include /private/etc/apache2/extra/httpd-userdir.conf

by removing #.

I had already created the 'Sites' directory in my user accounts and the username.conf files in etc/apache2/users directory. I used the same files I've used the lst few years.

Under simple tests everything appears fine.

Apr 21, 2016 4:46 PM in response to simonpie

Finally got it.


So I use server app on El Capitan. I followed the traditionnal instructions to activate userdir by modifying files in /etc/apache2 ...


But it would not be picked up by apache. Finally, I discovered in the plist, thanks to this post, that apache, or web services, once the server app is installed uses the following config file :

/Library/Server/Web/Config/apache2/httpd_server_app.conf


So I went ahead and modified this file in the standard ways (activating modules and including config files) and Tada ! Now my user dir work.

Apache2: UserDir Sites

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.