JJB Blog

How to enable symlinks and .htaccess from user webspace directories on a default OS X Apache configuration

Whenever I set up a new OS X box I drive myself crazy trying to remember which part of the Apache config needs to be tweaked to allow symlinks to arbitrary parts of the file tree from the document root. /private/etc/httpd/httpd.conf includes
Options FollowSymLinks for Directory /, and it’s tempting to think that should take care of it. Then I remember that there are sub config files for each user on the system, in /private/etc/httpd/users/. These do not specify anything for FollowSymLinks, so again, it’s tempting to think that this property will be inherited from Directory /, but then we realize, the Options directive in this file overwrites any previous Options directives.

Anyway, the solution is: tack FollowSymLinks onto the end of Options Indexes MultiViews in your user config file in /private/etc/httpd/users/.

Also: activate php in the main config and, to enable .htaccess files, comment out AllowOverride None in the user config.


3 Comments

For each web app I work on I add a virtual name configuration to my user-specific apache configuration. That way for each one I can set up options that will mimic what I need on the live server. I don’t think I ever changed the main config file.

Posted by Matt on 21 July 2007 @ 5pm

It’s worth mentioning (as I found on another post) that ~/Documents is by default set to 700 permissions, which must be changed to 755 (not 744, obviously) if you want to link to files in the Documents folder.

Posted by Chris on 29 December 2007 @ 4pm

Thanks so much! Worked a treat. The confusing thing is that i thought it was permissions, but it was simply this setting.
FYI, in snow leopard, it’s in the following folder instead:
/private/etc/apache2/users

Posted by chris on 27 February 2011 @ 11pm

Leave a Comment