加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vho

发布时间:2020-12-13 18:43:50 所属栏目:Linux 来源:网络整理
导读:在Ubuntu上的Apache我已经设置了一个vhost,但在浏览器中我不断收到“403 Access forbidden”错误;日志显示“客户端被服务器配置拒绝:/ home / remix /”. 在线寻找解决方案我发现很多关于目录访问的帖子(允许所有人等),但据我所知,我已经做到了.在httpd-vho
在Ubuntu上的Apache我已经设置了一个vhost,但在浏览器中我不断收到“403 Access forbidden”错误;日志显示“客户端被服务器配置拒绝:/ home / remix /”.

在线寻找解决方案我发现很多关于目录访问的帖子(允许所有人等),但据我所知,我已经做到了.在httpd-vhosts.conf中有以下代码:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/opt/lampp/htdocs/"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "/home/remix/"
    ServerName testproject
    ServerAlias testproject
    <Directory "/home/remix/">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

我还补充道

127.0.0.1    testproject

到/ etc / hosts文件.

此外,/ home / remix /文件夹包含一个index.html文件,并在httpd.conf中启用了vhost.

有什么我没看到的吗?

编辑:这是Apache error_log条目:

[Sat Aug 18 09:15:32.666938 2012] [authz_core:error] [pid 6587] 
[client 127.0.0.1:38873] AH01630: client denied by server configuration: /home/remix/

解决方法

更改您的授权配置:
<Directory /home/remix/>
    #...
    Order allow,deny
    Allow from all
</Directory>

…到Apache 2.4版本相同.

<Directory /home/remix/>
    #...
    Require all granted
</Directory>

查看upgrading overview document以获取有关您可能需要进行的其他更改的信息 – 请注意,您在Google(以及本网站)上找到的大多数配置示例和帮助都是指2.2.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读