magento - 后台提示服务器配置错误导致包含敏感信息的配置文件可浏览

13 篇文章 0 订阅

突然间,进入magento后台,发现提示一条信息:

Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.

 

输入magento的local.xml文件的路径果然可以访问。再一想这不只是泄露了数据库的信息,同时整个magento模板的的layout配置也完全暴露。

事实上magento有在相关的目录,如app的目录下放置了.htaccess文件来限制对这些目录下文件访问。但是为什么失效了。打开配置文件发现,之前为了封锁baidu搜索引擎的爬行,做了一个测试,却忘记了将文件恢复:

 

 SetEnvIfNoCase User-Agent "^Baidu" bad_bot

<FilesMatch ".*">

Order Allow,Deny
Allow from all
Deny from env=bad_bot

</FilesMatch>

而据我查阅的apapche文档中的一段说明:

 

<Files> sections are processed in the order they appear in the configuration file, after the <Directory> sections and .htaccess files are read, but before <Location> sections. Note that <Files> can be nested inside <Directory> sections to restrict the portion of the filesystem they apply to.

 

显然files,filesmatch这两个命令是在directory,.htaccess文件之后处理的,所以也就导致了有.htaccess而无效的问题了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值