Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
    
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 '12 at 9:00

2 Answers 2

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
share|improve this answer

You might try setting the option

Options +FollowSymLinks 

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.