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

Running Arch Linux I am trying to get apache to use /www (not /var/www) as DocumentRoot. /www is a softlink to /home/user/www. However, I keep getting an "Access Forbidden" error. The / and /home folders are part of different partitions. Could this be the problem?

I have already excluded as a problem:

  • CHMOD permission issues. All directories have 777 and are owned by Apache. The symlink as well.
  • FollowSymLinks option is working fine. If I link /www to /srv/http it does work. It's only when I point it to the /home/ folder that it stops working.

The exact error in the Apache error log is:

[Sun Oct 23 09:52:24 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /www

I used strace to see if that would provide something useful, but it did not provide any clue.

Anybody any idea? If the problem indeed is that the symlink refers to a folder on another partition, is there some workaround?

share|improve this question
2  
777 is a really, REALLY unsafe permission set. @growse's answer will probably fix what you need (although simply setting DocumentRoot to /home/user/www would have the same effect) so you can change the permissions back to something sane before you put that server live. –  Shadur Oct 23 '11 at 9:52
    
ls -la /home/user/www? –  quanta Oct 24 '11 at 3:22
add comment

3 Answers

It sounds like you need to set the FollowSymLinks for the Document Root.

share|improve this answer
    
Thanks, but as mentioned in the post this directive is set. Also, if I refer the symlink to another directory then it does work. It only does not work when linking it to a directory on another partition. –  user60129 Oct 23 '11 at 16:45
add comment

Is SELinux active?

You might have this guys problem:

http://lwn.net/Articles/289365/

share|improve this answer
    
Nope, SELinux was unfortunately not installed. –  user60129 Oct 23 '11 at 16:45
add comment

You'll need to tell apache that it's OK to use that directory:

<Directory /home/user/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

If that's not it, it may be that the x-bit is missing on directories between / and /home/user. chmod a+x /home/user should help there.

share|improve this answer
add comment

Your Answer

 
discard

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