2

I'm running apache v2.4 to host a personal web site on my office mac mini running OS X 10.10. The basic site is working fine but its throwing the 403 forbidden access error when I add symbolic link to a directory (in the ~/anil/Documents/ folder).

I've enabled FollowSymLinks on /etc/apache2/httpd.conf like so

DocumentRoot "/Users/anil/Sites"
<Directory "/Users/anil/Sites">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options All MultiViews
    MultiviewsMatch Any

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

Here's my /etc/apache2/users/anil.conf

<Directory "/Users/anil/Sites/">
    AddLanguage en .en
    LanguagePriority en fr de
    ForceLanguagePriority Fallback
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from localhost
    Require all granted
</Directory>

I've also verified that all the directories in the symlink target directory have the execute permission but to no avail; to try and rule this out I created a symlink for a dummy file in a directory one level down in the site rootdir but still same error.

$ ls -lrt
total 24
-rw-r--r--+ 1 anil  staff   49 Feb 24 08:15 somefile
lrwxr-xr-x  1 anil  staff   29 Feb 24 09:13 Corpus -> /Users/anil/Documents/Corpus
drwxr-xr-x  3 anil  staff  102 Feb 25 07:37 tmp_folder
lrwxr-xr-x  1 anil  staff   20 Feb 25 07:38 blankfile -> tmp_folder/blankfile

Here's the relevant output from apache's error_log:

[Thu Feb 25 13:51:14.465824 2016] [core:error] [pid 42861] [client x.x.x.x:p] AH00032: Symbolic link not allowed or link target not accessible: /Users/anil/Sites/blankfile
[Thu Feb 25 13:51:14.465925 2016] [core:error] [pid 42861] [client x.x.x.x:y] AH00037: Symbolic link not allowed or link target not accessible: /Users/anil/Sites/Corpus
  • Does the webserver have read permissions to all the directories all the way up the tree to the target dir? I've had that problem before where I forgot that the webserver couldn't even see the target dir because of the dir it was inside of. – jhaagsma Feb 25 '16 at 22:15
  • Yes, I've confirmed they do. In fact, the directory tmp_folder was created just to verify this-as the ls listing above shows tmp_folder is both readable and executable. Plus every directory above tmp_folder is also readable since the web site is served properly (I verified this is indeed the case via command line). – AnilRamakrishna Feb 25 '16 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.