Server Fault is a question and answer site for system and network administrators. 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

On my Mac OS 10.5 machine, I would like to set up a subfolder of ~/Documents like ~/Documents/foo/html to be http://localhost/foo.

The first thing I thought of doing is using Alias as follows:

Alias /foo /Users/someone/Documents/foo/html

<Directory "/Users/someone/Documents/foo/html">
    Options Indexes FollowSymLinks MultiViews

    Order allow,deny
    Allow from all

This got me 403 Forbidden. In the error_log I got:

[error] [client ::1] (13)Permission denied: access to /foo denied

The subfolder in question has chmod 755 access. I've tried specifying likes like http://localhost/foo/test.php, but that didn't work either. Next, I tried the symlink route.

Went into /Library/WebServer/Documents and made a symlink to ~/Documents/foo/html. The document root has

Options Indexes FollowSymLinks MultiViews

This still got me 403 Forbidden:

Symbolic link not allowed or link target not accessible: /Library/WebServer/Documents/foo

What else do I need to set this up?


$ chmod 755 ~/Documents

In general, the folder to be shared and all of its ancestor folder needs to be viewable by the www service user.

share|improve this question
Thanks so much for posting this solution - this really helped me out after spending ages looking for the answer – Tomba Jan 31 '12 at 13:55
@Tomba No problem. – Eugene Yokota Jan 31 '12 at 14:28
up vote 24 down vote accepted

I'll bet that some directory above the one you want to access doesn't have permissions to allow Apache to traverse it. Become the user that Apache is running as (sudo -i -u apache or whatever), then try to change into the directory of interest and ls it. If you can't (as expected), then try getting into the directories above it, one by one, until one lets you in. The subdirectory of that is that one that needs to have o+x set. Lather, rinse, repeat as required.

share|improve this answer
Yes, if 'Sites' is working, you probably have a right problem on Documents, if 'Sites' is not working you probably have a right problem on your user directory (this can appends with filevault) – radius Jun 29 '09 at 1:37
~/Documents was 700. – Eugene Yokota Jun 29 '09 at 1:40
If I run sudo -i -u _www on OS X (since the Apache user is _www by in the default apache config on OS X), then I do whoami, I still get my username, not _www – Jason S Nov 2 '13 at 6:12
To fully change to another user with sudo, I use '-' by itself: sudo - www-data (for Ubuntu). – Alexis Wilke Nov 2 '13 at 22:31

Use +FollowSymlinks

Alias /foo /Users/someone/Documents/foo/html

<Directory "/Users/someone/Documents/foo/html">
    Options +Indexes +FollowSymLinks +MultiViews

    Order allow,deny
    Allow from all
share|improve this answer
According to, "if all the options on the Options directive are preceded by a + or - symbol, the options are merged." How is that going to help ~/Documents being 700? – Eugene Yokota Jun 29 '09 at 4:16
AFAIK FollowSymLinks does not enable the option, only allows it to be enabled in at a lower level of the directory hierarchy. – Dave Cheney Jun 29 '09 at 4:52
This was the correct answer for me. I modified the conf file in /etc/apache2/users, and allowed FollowSymLinks (without the +). Remember to restart. – superluminary May 29 '12 at 14:57

Check to ensure that file vault isn't enabled. I had the same problem. I tried everything else I could find. Nothing worked. But after an hour of trying to figure this out, I recalled that I had file vault enabled.

Disabling it resolved the problem.

share|improve this answer

Check the symlink ownership. Since you're on Mac OS X, then symlink owners can be changed. In /Library/WebServer/Documents do ls -l

If your symlink to ~/Documents/foo/html is called foo and has permissions like

lrwxr-xr--  1 root  wheel 27  2 Nov 17:00 foo -> /Users/username/Documents/foo/html

Then by default on OS X Apache runs as the _www user and _www group, so in the above mentioned case it won't be able to traverse the symlink to ~/Documents/foo/html

Run man 8 chown on your system terminal, or look at it online man chown

You will see that using the -h option will change the ownership of the symlink itself, rather than the file it points to (it's source). Then you can do something like

sudo chown -h :_www foo 

This will change the simlink to

lrwxr-xr--  1 root  _www 27  2 Nov 17:02 foo -> /Users/username/Documents/foo/html

and the Apache _www group will be able to traverse the link.

share|improve this answer

Check your /Users directory (ls -l /Users) to see rights on your user (someone).
Also is the 'Sites' directory correctly available on localhost/~someone ?

share|improve this answer
localhost/~someone works. – Eugene Yokota Jun 29 '09 at 1:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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