Symbolic link not allowed in Apache2

I'm trying to get a site running Apache, but I am getting the following error:

AH00037: Symbolic link not allowed or link target not accessible: /var/www/wg

      

The "wg" folder is indeed a symbolic link, as far as I can see the permissions are set correctly and the link is valid:

lrwxrwxrwx  1 www-data www-data   33 Dec  8 22:36 wg -> /media/user/Web/www/wg

      

And this is how the website is set up:

<VirtualHost 127.0.0.49:80>
        DocumentRoot "/var/www/wg"
        ServerName wg.local
        <Directory "/var/www/wg">
                Options +Indexes +FollowSymLinks -SymLinksIfOwnerMatch
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

      

Any idea what might be causing this permission error?

Edit:

strace gives me this:

[pid  8603] stat("/var/www/wg/", 0x7fff01b68010) = -1 EACCES (Permission denied)

      

But I don't understand why - "var" and "www" are drwxr-xr-x and wg drwxrwxrwx with owner and group www-data, so everything seems to be configured correctly.

+3


source to share


1 answer


I would assume that the permissions /media/user/Web/www/wg

are not set correctly, so the log is misleading. Or users /media/user/Web/www/wg

and /var/www/wg

are not the same, because you have installed -SymLinksIfOwnerMatch

.

Another solution / question: why don't you install DocumentRoot

directly on /media/user/Web/www/wg

?



Best, M.

0


source







All Articles