403 on Symlink

Hi,

I’m trying to setup a project using the Symfony framework. I don’t want the whole thing being accessible to the web, so I’m not putting it in the document root. Instead, I want to create a symbolic link from a directory in the document root to the web directory under the framework.

I did this:

ln -s /path/to/project/web /path/to/docroot/projectname

The link was created. But when I try to browse to it, I get:

$ tail -1 /var/log/apache2/error_log
[Sat Mar 03 14:13:39 2012] [error] [client ::1] Symbolic link not allowed or link target not accessible: /path/to/docroot/projectname

The thing is, the permissions are fine, so it should be able to access it fine. Everything is readable and the directories are executable.

project/web:

drwxr-xr-x+ 805 brandonolivares  staff  27370 Mar  3 02:09 web

docroot/projectname:

lrwxr-xr-x    1 brandonolivares  staff      82 Mar  3 02:42 projectname -> /path/to/project/web

Also, FollowSymLinks is enabled as far as I can tell.

Any help would be appreciated.

Have you got apache set to allow it to follow symlinks? its an option in the config, if you don’t have access ot that, you may be able to over ride it via a .htaccess file however that might nto work with the .htaccess if its in the linked folder. Check your opts.

For reference, the code to make Apache follow symlinks (what Tim said ^):


Options +FollowSymlinks

in either a .htaccess file or (indeed, if you have access to it) httpd.conf

Thats the badger, I couldn’t just remember it off hand!

Thanks, I had already had that enabled.

I figured it out, though. The directory the symlink referred to didn’t have th right permissions. The directory itself did, but some of the directories above that didn’t. Now it works. :slight_smile: