2

My apache server runs as user foo.

I have some Rails applications in /home/foo/app1 /home/foo/app2. Each of them has an vhost

<VirtualHost *:80>
    ServerName app1.foobar.com
    ServerAlias www.app1.foobar.com
    DocumentRoot /var/www/html/app1/current/public
    RailsEnv production
    <Directory /var/www/html/app1/current/public>
    AllowOverride all
     Options -MultiViews
    </Directory>
</VirtualHost>

I have a symlink in /var/www/html/app1 :

current -> /home/foo/app1/tmp_20102611

All file permissons are set correctly (user foo group foo), I can go through the filesystem from shell.

SELINUX is disabled

Distro is CentOs 5.5

Which the above symlink I get an 403 and an error entry in error_log

Symbolic link not allowed or link target not accessible:/var/www/html/app1/current

When I symlink my app in the subdir of /var/www/html instead of /home/foo it works.

How I can avoid this error still placing my app in my /home/foo directory ?

1
  • If I may suggest you read about SELinux on wiki.centos.org/HowTos/SELinux. It would better to have SELinux running and just modify your file securities to better secure your linux machine.
    – user108076
    Jan 24, 2012 at 9:00

2 Answers 2

8

I had a very similar problem. Like you, I was unable to follow symlinks under my home directory even though I had the FollowSymlinks enabled plus I could ls around with my http user, but putting symlinks under /srv/http worked just fine... I fixed it by chmod'ing my home directory to be executable:

chmod +x /home/mgalgs

And that did it for me! Maybe try

chmod +x /home/foo/app1
1

You might try setting the option

Options +FollowSymLinks 

in your configuration. See the Documentation here for more details.

2
  • not so easy, my Apache has this option turned on in my global config. Thanks anyway
    – astropanic
    Nov 26, 2010 at 8:05
  • 1
    normally this gets set on a per directory base. can you us give the relevant configuration lines
    – pacey
    Nov 26, 2010 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .