1

I had a Mac under OS X Lion. I upgrade it to Mountain Lion, and buy the OS X Server software in the AppStore.

Since the beginning, I use the Apache version bundled in Mac OS, and it work fine.

But after solving some problems (like the change of location of the main directory from /Library/WebServer/Documents to /Library/Server/Web/Data/Sites/Default), I can't figure out how to configure UserDir to work again!

As explained here:

Please note - the Mountain Lion install removes the contents of the directory
/private/etc/apache2/users
so if you counted on those configuration files working for you, oops.

So, I follow advices found here, and finally my file /etc/apache2/extra/httpd-userdir.conf look like this:

#
# 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>

<Directory "/Users/*/Sites/">
Options Indexes
Order allow,deny
Allow from all
</Directory>

But, event after some sudo apachectl restart or reboot, impossible to acces again to my UserDir /Users/utilisateur/Sites/ through http://127.0.0.1/~utilisateur

Can you provide me some advice for the configuration please?
Remember: I've installed the Server software from the AppStore.

Thank you in advance!

[EDIT] I also tried these recommendations: Mountain Lion, Apache, Sites folder, htaccess and mod_rewrite, but it dosen't help…

[EDIT 2] In response to the possible duplicate with "How do I get my user directory working for web sharing again?", I will say that in my case, it's not a permission denied, but a 404 Not Found. It is probably due to the concomitant installation of the OS X Server application from the AppStore, so, it's a distinct issue IMHO…
In fact, I've tested the solution provided, and it does not work at all for me.

1

2 Answers 2

5

It seems that the Apache configuration files in /etc/apache2 are not at all considered by the Apache version provided by the Server application.

With the Server application, all configurations are in /Library/Server/Web/Config/apache2

As the ReadMe.txt of this directory says, the default apache configuration file is httpd_server_app.conf, and I just had to uncomment the line Include /private/etc/apache2/extra/httpd-userdir.conf in this file!

problem solved.

[EDIT] As notified by Kristopher Johnson, it may also be necessary to uncomment LoadModule apple_userdir_module

1
  • 1
    I found that I also had to uncomment the line that starts with LoadModule apple_userdir_module ... Commented May 25, 2014 at 0:48
-2

the answer is as follow:

you must to check if you have a file with the name .conf in this directory:

/private/etc/apache2/users/

by default I think you have the Guess.conf file with this content:

# cat /private/etc/apache2/users/Guest.conf 
<Directory "/Users/Guest/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

If you have the user "macuser" and you want to use localhost/~macuser URL, then you must create the macuser.conf with the correct information (Sites directory, probably /Users/macuser/Sites). After the change you need to restart the apache process:

sudo apachectl restart
1
  • The question is already answered, and this answer do not solve the problem at all because the Server App had moved the configuration files (as you can read in my solution). So, you replied without completely reading the question neither the answer...
    – Pascal Qyy
    Commented Oct 9, 2012 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .