Brad Bishop

Q: 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

Close

Q: Apache2: UserDir Sites

  • All replies
  • Helpful answers

Previous Page 2
  • by sn_,

    sn_ sn_ Dec 13, 2013 8:28 PM in response to Brad Bishop
    Level 1 (0 points)
    Dec 13, 2013 8:28 PM in response to Brad Bishop

    I also had this problem, and (after only a few hours of head-to-desk impact) found the answer on AskDifferent, from 16 months ago.

     

    http://apple.stackexchange.com/questions/59798/apache-2-userdir-problem-in-os-x- mountain-lion-10-8-server-after-upgrade-fro/59836#59836

     

    If you look /etc/apache2/httpd.conf and your DocumentRoot is /Library/WebServer/Documents, you might not notice that the error you're getting is about a DocumentRoot with a subtly different name.

     

    /Library/Server/Web/Config/apache2/httpd_server_app.conf refers to a DocumentRoot at...oh.  /var/empty.  But it does talk a lot about serving stuff out of /Library/Server/Web/Data, which corresponds the server you seem to be running.

     

    You (like me) may be a bit surprised about that.  It would've been nice for the Server app install to drop a helpful README in /etc/apache2 for us noobs, but we can't have everything.  Where would we put it?

     

    After reading that answer, I came back through my tabs that appeared to have useful info that I didn't understand, and then I got what Gnarlodious and Blaidd Drwgwere trying to explain, but hadn't made clear enough for my little brain.  Two apaches.  Blech.

  • by wfairchild,

    wfairchild wfairchild Feb 5, 2014 7:51 AM in response to Blaidd Drwg
    Level 1 (0 points)
    Feb 5, 2014 7:51 AM in response to Blaidd Drwg

    Shout it from the rooftops!!!!

     

    uncomment line 532 (Include /private/etc/apache2/extra/httpd-userdir.conf)

     

    in

     

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

     

    immediately fixed user web directories on Maverick server (after I had the userdir stuff setup)

  • by Dave Rocks,

    Dave Rocks Dave Rocks Jun 14, 2014 7:56 PM in response to Brad Bishop
    Level 1 (35 points)
    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.

  • by Dave Rocks,

    Dave Rocks Dave Rocks Jun 14, 2014 8:43 PM in response to Dave Rocks
    Level 1 (35 points)
    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.

  • by simonpie,

    simonpie simonpie Apr 20, 2016 6:27 PM in response to Blaidd Drwg
    Level 1 (38 points)
    Servers Enterprise
    Apr 20, 2016 6:27 PM in response to Blaidd Drwg

    Hi,

     

    I just tried what @Blaidd Drwg suggested  in El Capitan as all other solution did not work.

     

    Now I get the following message :

    Websites are turned off.

    An administrator can turn them on using the Server application

     

    Any Idea what I can do ?

  • by simonpie,

    simonpie simonpie Apr 21, 2016 4:46 PM in response to simonpie
    Level 1 (38 points)
    Servers Enterprise
    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.

Previous Page 2