Linux   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vhost配置)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

在Ubuntu上的Apache我已经设置了一个vhost,但在浏览器中我不断收到“403 Access forbidden”错误;日志显示“客户端被服务器配置拒绝:/ home / remix /”. 在线寻找解决方案我发现很多关于目录访问的帖子(允许所有人等),但据我所知,我已经做到了.在httpd-vhosts.conf中有以下代码: NameVirtualHost *:80 <Virtua
在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.

大佬总结

以上是大佬教程为你收集整理的linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vhost配置)全部内容,希望文章能够帮你解决linux – Apache“服务器配置拒绝客户端”,尽管允许访问目录(vhost配置)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。