Monday, July 03, 2006

"Symbolic link not allowed or link target not accessible..."

Apache 2 refused to serve pages with that claim in the error_log (Suse 10.1). I had tried everything (permissions, ownership, etc.) - nothing worked. My httpd.conf piece looked really perfect:

<Directory "/srv/www/htdocs">
                Options FollowSymlinks
                AllowOverride None
                Order allow,deny
                Allow from all
</Directory>


and no success. Then, I found the line in the httpd.conf:

Include /etc/apache2/default-server.conf

Yes, yes, that include file contained a configuration for the document root, and certainly overwrote my settings. So, if your settings look really good, and the symlink problem still exists - look for such an include.

The problem seems to be obvious - but search Google for it, and you may be surprised...

12 comments:

Anonymous said...

This could also be a security issue on redhat enterprise 4.
edit /etc/selinux/config
change to
SELINUX=permissive

you might have to restart the server.
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/

Anonymous said...

Well, this end my pain to setup the bugzilla on SuSe 10.1

Anonymous said...

Thank You!

I'd been searching google for quite some time, but to no avail - this was a life saver. Sneaky includes undoing all my careful configuration...

Keep up the good work!

Anonymous said...

Thank you!!!!! How many hours have I spent on this so far....

Anonymous said...

Wow, this helped me fix some problems I could never figure out, thanks a bunch!

Anonymous said...

Woohoo it works! Thanks buddy. Wish I'm a Linux Geek ^^

nafiz ozen said...

it is iwritten that symbolic link is forbidden.
how can I solve that promis

printelectric said...

Hey all. Not sure if this applies on Linux, but I was able to work around this problem with access control lists on my Leopard test server. FYI - my only reason for the symlink in this case was to enable my code editor (Coda) access to htdocs. Instead of the symlink, I ended up using the following:

chmod -R -v +a "staff allow readattr,readextattr,readsecurity,list,search,read,execute,writeattr,writeextattr,delete,delete_child,add_file,add_subdirectory,write,append,file_inherit,directory_inherit" /usr/local/apache2/htdocs

This specifically enables all necessary privileges on my htdocs folder, without altering standard Posix perms for all other users and groups. Since I'm the only user in "staff" here, that worked for me. Hope this helps somebody. FYI on Mac OS / Leopard my conclusion was that in order for symlink to work, users had to have perms for the requested folder and all parents. This is cleaner as it preserves the restrictions to parent folders - important things like /usr/ !

Anonymous said...

yes, the many many cursing hours spent just because I used the default httpd.conf..... THANK YOU VERY MUCH!

Anonymous said...

In my particular problem it was an selinux problem.

This solved it right away
echo 0 >/selinux/enforce

This shows how to do it permanently.

http://www.crypt.gen.nz/selinux/disable_selinux.html

David Horat said...

I won't donate, but I will invite you to a beer at CERN. ;)

zsolt rossz molnár said...

:) Ok, when?