Document root symlink causes "Symbolic link not allowed or link target not accessible"

207 views
Skip to first unread message

Charles Brian Quinn

unread,
Feb 9, 2007, 8:37:41 PM2/9/07
to capis...@googlegroups.com
A client wanted to deploy on their Suse Enterprise Linux Server (SLES)
10, recently, and I kept getting this nasty nasty message along with
some Novell apparmor non-sense in the apache and document specific
logs. Images/stylesheets and generally everything out of the public
document root wouldn't show. Specifically the message was:

Symbolic link not allowed or link target not accessible:
/srv/www/project/current, referer: http://test.project.com/

It ended up being that Apache on SLES did not/could not use a symlink
as the actual directory from which to serve out content. if I
replaced the /srv/www/project/current symlink with the actual
directory, it worked fine.

The fix I ended up using, was I changed my apache setup from:

<Directory "#{deploy_to}/current/public">

to:

<Directory "#{deploy_to}">

so the Document root stayed:

DocumentRoot #{deploy_to}/current/public

but the actual Directory with Options for FollowSymlinks turned on was now:

<Directory "/srv/www/vhosts/project">

and now the symlink option could be followed to get to the current release.

Hope this helps someone,
--
Charles Brian Quinn
self-promotion: www.seebq.com
highgroove studios: www.highgroove.com
slingshot hosting: www.slingshothosting.com
main: 678.389.9462 fax: 678.826.0969

Ruby on Rails Bootcamp at the Big Nerd Ranch
Intensive Ruby on Rails Training:
http://www.bignerdranch.com/classes/ruby.shtml

alohashirt

unread,
Feb 13, 2007, 3:41:40 PM2/13/07
to Capistrano
I had the same problem yesterday on RHEL Apache 2.2.3. I also spent
three hours dealing with a variant of this. I was deploying to /root/
sw/ConfigApache and had symlinks as follows:

/usr/local/apache -> /usr/local/httpd-2.2.3
/usr/local/apache/conf -> /root/sw/ConfigApache/current/public/
MANUAL_CONFIGS/DEV/Apache/$[myhostname}/htdocs

I got the same error because my permissions on /root were too
restrictive. Very, very painful.

In my case /DEV is one of [DEV,QA1,QA2,INT,STG,LOADTEST,PROD] Are
others using ERB to pre-generate deploy.rb files that are approriately
hard-coded? I figure this must be a FAQ with some creative solutions.

Peter

Reply all
Reply to author
Forward
0 new messages