大网数据广告活动
网站运营与故障问答

What does "Require all granted" on Directory / (root) REALY means? (Apache 2.4 on CentOS7

· 52CE 我爱测

im sure, this question looks really stupid first. but i need a "second opinion" on this, even i did some research on my own but i am still unsure about this. By default the Apache Configuration on CentOS7 and pretty much any Dist…

问题原文

原帖链接 · Axel Werner · CC BY-SA 3.0

im sure, this question looks really stupid first. but i need a "second opinion" on this, even i did some research on my own but i am still unsure about this.

By default the Apache Configuration on CentOS7 and pretty much any Distro i know so far usually denies access recursively to the ROOT Filesystem (/) with a Directory Statement like this:

Default: /etc/httpd/conf/httpd.conf

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

Usually Followed by some Directory Statements (Blocks) that "relaxes" Permissions to the parts of the filesystem that contain html or other web server content.

Now i have to deal with "some Web App" from "some Company" lately that is requesting/requiring the following Change to the apache config file:

Requested by Software Company: /etc/httpd/conf/httpd.conf

<Directory />
    AllowOverride none
    Require all granted
</Directory>

This raised some red flag inside my mind and i tried to research this on the net. not yet found anything stating clearly what this configuration would effectively mean. But i would guess, this grants read access to pretty much any file on the whole Linux Server which can be read by usergroup "other" or the apache service account or service group. So if i am right, it would be a really really baaaaaad idea to ever do something like this on an internet webserver.

am i correct on this assumption? or am i missing something here?

thanks for any hint/tip/explaination on this!

best regards Axel

已采纳解答

原帖链接 · Matthew Haeck · CC BY-SA 4.0

This is an issue I've ran into a few times & it stems from a change in terminology from Apache 2.2 to Apache 2.4 (detailed here). Access control options that were previously addressed with 'Order X, Allow or Deny from X', can now be managed with 'Require X'. The simplest use case example would be...

Apache 2.2:

Order allow,deny
Allow from all

..on the more recent Apache would equate to...

Apache 2.4:

Require all granted

So basically, Yes - you are correct to assume that this change extensively losens access privledges on your server (holding all else equal of course).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-06-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。