Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I'm using Snow Leopard (upgraded from Leopard) and in System Preferences I have enabled "Web Sharing". The preference pane lists the following urls as active:

When I click on the first link I get a page with "It Works" in big letters. When I click on the second link I get a "Forbidden" error and Apache logs into error_log "client denied by server configuration".

To fix this I had to add a .conf file in /etc/apache2/users with the content:

<Directory /Users/myusername/Sites>
    Order allow,deny
    Allow from all

Now I can access just fine.

Is this normal? I would have thought Apple would make this a tad easier for users to enable per user site sharing.

share|improve this question
up vote 1 down vote accepted

I would imagine this is a form of security, particularly if you're using multiple accounts. It's easier to enable browsing through the .conf file for one user account, then it is to disable browsing for several accounts.

Malicious people then just simply can't enable web sharing and have unrestricted access to a user folder, unless they edit the conf file first.

Edit: I enabled sharing on my Snow Leopard installation, and it worked straight off the bat. Perhaps it was just a bug that the .conf file wasn't setup correctly?

share|improve this answer
Yeah I think it was probably a bug or glitch. In the past (on previous MacOS editions) it has worked just fine out of the box. I kinda just wanted to share my experience in case others have the same problem. – orj Sep 11 '09 at 12:54

This was problematic for Leopard as well. It seems to work on Lion now. Within /etc/apache2 (aka /private/etc/apache2), httpd.conf includes extra/httpd-userdir.conf, which has these lines of interest:

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

So, it seems that having ~/Sites may be sufficient, although you may have to create that folder yourself.

share|improve this answer

You must log in to answer this question.

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