0

So I've been reading up a lot on the subject but can't figure out what I'm doing wrong, I also tried a couple solutions found here but still...
I have multilple vhosts set up with Apache, everything working fine serving different files from both /home/usr1/html and /home/usr2/html.

Now I symlinked /home/usr1/html/thisfolder to /home/usr2/html/thatfolder, double checked the FollowSymlinks option is enabled both in apache2.conf and in vhost.conf, but I'm getting a 403 Error.

Why should this be about permits? I mean, www-data can read without any problem from both folders, how is it that when symlinked it just doesn't?

Thanks

EDIT:

Error returned by Apache: (notice the missing script filename, only extension is provided)

[Wed Apr 20 12:13:11.297208 2016] [authz_core:error] [pid 19883] [client 192.168.0.1:12345] AH01630: client denied by server configuration: /home/usr2/html/thatfolder/.php

Virtual Host conf file:

<VirtualHost *:80>

ServerName server.domain.lan
ServerAdmin adm@lan
DocumentRoot /home/usr2/html

<Directory /home/usr2/html>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
<Directory /home/usr1/html/thisfolder> // original folder
        Require all granted
</Directory>

</VirtualHost>
nxet
  • 738
  • 2
  • 10
  • 22
  • Do you have `Options +FollowSymlinks` set in the config or the local .htaccess? – Pekka Apr 20 '16 at 09:42
  • just tried, doesn't change a bit. altough I was under the impression that when enabled in the __.conf__ files it wasn't necessary to specify it on __.htaccess__... – nxet Apr 20 '16 at 09:45
  • Yes, when enabled in the conf, it shouldn't be necessary there. Can you look in the error log what the exact message is? – Pekka Apr 20 '16 at 10:05
  • `[Wed Apr 20 12:13:11.297208 2016] [authz_core:error] [pid 19883] [client 192.168.0.1:12345] AH01630: client denied by server configuration: /home/usr2/html/folder/.php` please notice the fact there is no script filename, just the extension. – nxet Apr 20 '16 at 10:17
  • Googling that error message suggests the problem might not be the symlink, but a different misconfiguration http://stackoverflow.com/questions/18392741/apache2-ah01630-client-denied-by-server-configuration – Pekka Apr 20 '16 at 10:25
  • as soon as I posted the error I googled for the code and read the very same question. unfortunately the _Require all granted_ directive is set already (on the vhost.conf) – nxet Apr 20 '16 at 10:27
  • 1
    But is the ``Require all granted`` set for directories which are the target of the symlinks as well as the directory containing the symlinks. – Graham Dumpleton Apr 20 '16 at 10:28
  • just added the `require` to vhost to no avail... – nxet Apr 20 '16 at 10:31
  • You meant `Require all granted`, correct? And just to rule out all possibilities: you know that conf changes require a server restart, right? – Pekka Apr 20 '16 at 10:39
  • turns out it was an `.htaccess` rule messing things up, I had all .php files stripped of their extension, resulting in apache trying to get /thatfolder.php instead of /thatfolder/index.php – nxet Apr 20 '16 at 14:04

0 Answers0