简体   繁体   English

别名上的Apache 2.4.10错误403

[英]apache 2.4.10 error 403 on aliases

I updated my apache server to 2.4.10 from version 2.2.x on debian7 and I have problem with multi virtual hosts. 我在debian7上将我的apache服务器从2.2.x版本更新到2.4.10,并且我遇到了多个虚拟主机的问题。 When I try to load page I have forbidden [403] error. 当我尝试加载页面时,出现[403]错误。 If I enable only one alias the page works fine, when I try to enable another page, then I received 403 error. 如果我仅启用一个别名,则页面工作正常,当我尝试启用另一页面时,则收到403错误。 I add to all configs Require all granted. 我添加到所有配置都需要全部授予。

What I doing wrong? 我做错了什么?

code of alias 1: 别名代码1:

<VirtualHost example.com:3099>
DocumentRoot /home/ftp/example.com
alias alias1 /home/ftp/example.com/alias1/>
<Directory /home/ftp/example.com/alias1/>
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride None
        Require all granted
</Directory>
</VirtualHost>

code of alias 2: 别名2的代码:

<VirtualHost example.com:3099>
    DocumentRoot /home/ftp/example.com
    alias alias2 /home/ftp/example.com/alias2/>
    <Directory /home/ftp/example.com/alias2/>
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride None
            Require all granted
    </Directory>
    </VirtualHost>

UPDATE 1 In /etc/apache2/apache2.conf I Have 更新1在/etc/apache2/apache2.conf中

<Directory />
        Options FollowSymLinks
        AllowOverride none
        Require all denied
</Directory>

If I change denied to granted, error 403 disappear, but I have access to all subdirs in /home/ftp/example.com even they haven't virtual host alias. 如果我将拒绝更改为授予,则错误403消失,但是我可以访问/home/ftp/example.com中的所有子目录,即使它们没有虚拟主机别名也是如此。

UPDATE 2 I have error, when I write a post here, In server config I have proper directory location. 更新2我有错误,当我在这里写文章时,在服务器配置中我有正确的目录位置。

These parameters don't match, so the path is forbidden. 这些参数不匹配,因此路径被禁止。 Look at the last character: 看最后一个字符:

  alias alias2 /home/ftp/example.com/alias2/>
    <Directory /home/ftp/example.com/alias1/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM