Apache 2.4权限设置( you don't have permission to access / on this server Apache2.4)

Posted mall

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache 2.4权限设置( you don't have permission to access / on this server Apache2.4)相关的知识,希望对你有一定的参考价值。

摘要 you don‘t have permission to access / on this server Apache2.4 

Apache 从2.2升级到 Apache2.4.x 后配置文件 httpd.conf 的设置方法有了大变化,以前是将 deny from all 全部改成 Allow from all 实现外网访问,现在是将 Require all denied 以及 Require local 都该为 Require all granted 就可以了。

.htaccess 如果不起作用将 LoadModule rewrite_module modules/mod_rewrite.so 前面的注释(#)去掉就可以了。

下面看一下 Apache2.4 的变化:(官方英文说明)

所有的请求都被拒绝

2.2上的配置

Order deny,allow
Deny from all

2.4上的配置

Require all denied

所有请求都是允许的

2.2上的配置

Order allow,deny
Allow from all

2.4上的配置

Require all granted

在域中的所有主机都可以访问example,所有其他外网主机的访问被拒绝

2.2上的配置

Order Deny,Allow
Deny from all
Allow from example.org

2.4上的配置

Require host example.org

要想外网访问将 Require local 该为 Require all granted 。

?

1 2 3 4 5 6 经常会用到的: Require all denied Require all granted Require host xxx.comRequire ip 192.168.1 192.168.2 Require local

举例说明

仅允许IP:192.168.0.1 访问

Require all granted
Require ip 192.168.0.1

仅禁止IP:192.168.0.1访问

Require all granted
Require not ip 192.168.0.1

允许所有访问

Require all granted

拒绝所有访问

Require all denied

默认是 Require local 仅允许本地访问。

还有好多变化,可以去官方说明详细看一下,不过只有英文版的。软件变化无常,建议大家升级前详细阅读官方更新文档,以免来个措手不及。

转自:http://www.07net01.com/2015/08/916905.html 








以上是关于Apache 2.4权限设置( you don't have permission to access / on this server Apache2.4)的主要内容,如果未能解决你的问题,请参考以下文章

解决问题 “You don't have permission to access /index.html on this server.”

apache 2.4.23 只能本地访问,其他用户不能访问,提示You don't have permission to access

安装phpstudy 测试出现403错误 Forbidden You don't have permission to access / on this server. 跪求解

apache2.4 You don‘t have permission to access / on

打开路由器设置,上面出现了 403 Forbidden You don''t have permission to access on this server.

linux apache Forbidden You don't have permission to access / on this server.