Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何调试apache';s允许/拒绝规则?_Apache_Security_Configuration - Fatal编程技术网

如何调试apache';s允许/拒绝规则?

如何调试apache';s允许/拒绝规则?,apache,security,configuration,Apache,Security,Configuration,我尝试添加logleveldebug,但我得到的只是 client denied by server configuration: /somedir/html/file.html 我对一个位置有一个复杂的允许/拒绝规则,可以简化为此来重现我的问题: <LocationMatch "/somedir/(.*)\.html" > SetEnvIf Referer "^https?\:\/\/[^\/\?\#]*domain\.com(\:\[0-9]+)?([\/\?\#]|$)"

我尝试添加
logleveldebug
,但我得到的只是

client denied by server configuration: /somedir/html/file.html
我对一个位置有一个复杂的允许/拒绝规则,可以简化为此来重现我的问题:

<LocationMatch "/somedir/(.*)\.html" >

 SetEnvIf Referer "^https?\:\/\/[^\/\?\#]*domain\.com(\:\[0-9]+)?([\/\?\#]|$)" SAME_ORIGIN_HOST_CHECK=1
 SetEnv DEV_BUILD_ALLOW 1

 Order deny,allow
 Deny from all
 Allow from env=SAME_ORIGIN_HOST_CHECK
 Allow from env=DEV_BUILD_ALLOW
</LocationMatch>

SetEnvIf Referer“^https?\:\/\/[^\/\?\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
SetEnv DEV_BUILD_允许1
命令拒绝,允许
全盘否定
允许来自环境=相同来源主机检查
允许来自env=DEV\u BUILD\u Allow
来自domain.com的referer工作正常,但是设置dev build var被忽略


除了允许/拒绝规则外,有没有其他方法可以获得更精细的日志输出,比如mod rewrite?我目前在
顺序
拒绝
允许
方面也有类似的问题。。。它只是没有做我认为它应该做的事情,而且显然根本没有对此进行调试:/this old:)我今天发现了这个问题,这是一个奇怪的巧合。我的错误是在
\[0-9]
。。。应该是
[0-9]
。在我再次调试前一天,你对这个一个月的问题发表评论的几率有多大?不管怎样,很抱歉帮不上忙。在这种情况下,它只是一个坏的regexp。除了删除单独的行,重新启动apache,重复…,我没有找到更好的调试方法:(我同时发现了问题。事实证明,
/
Deny
语句的顺序可能不重要(至少文档这么说),但
块的顺序非常重要。我必须移动
块来解决我的问题。