How to enable symlinks 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 to tack FollowSymLinks onto the end of Options Indexes MultiViews in your user config file in /private/etc/httpd/users/.

The only other things I need to change from the default OS X configuration is activating php in the main config and commenting out AllowOverride None in the user config.

2 Responses to “How to enable symlinks from user webspace directories on a default OS X Apache configuration”


  1. 1 Matt

    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.

  2. 2 Chris

    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.

Leave a Reply




Close
Powered by ShareThis