0

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?

  • 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
1

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

  • 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
0

Is SELinux active?

You might have this guys problem:

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

  • Nope, SELinux was unfortunately not installed. – user60129 Oct 23 '11 at 16:45
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy