【问题标题】:htaccess deny from all gets apache server test pagehtaccess deny from all 获取 apache 服务器测试页
【发布时间】:2020-05-20 13:39:12
【问题描述】:

我已经安装了zpanelcentos 6.3。 现在有什么问题。

我添加了域mydomain.com 并添加了空白index.php 文件。 我也添加了 .htaccess 带有“全部拒绝”的文件 现在,当我在浏览器中打开页面时,我得到的是 Apache 2 测试页面 403 Forbidden 但是如果我打开http://mydomain.com/index.php,现在我会得到 403 Forbidden。

我尝试编辑 apache 配置文件 Directoryindex,但没有得到肯定的结果。谁能帮帮我?

【问题讨论】:

  • 尝试添加Order allow,deny

标签: apache .htaccess


【解决方案1】:

尝试禁用默认的 Apache CentOS 欢迎页面:

#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

编辑文件/etc/httpd/conf.d/welcome.conf 并评论所有内容。只需删除 welcome.conf 文件(或将其重命名为 .conf.disabled 例如)也应该可以解决问题。

然后,重新加载 apache 配置 (service httpd restart),一切都会按预期工作。

【讨论】:

  • 这正是我的问题所在,在亚马逊的 linux 上使用 apache2.4。我拒绝了特定的虚拟主机,并且 每个 我尝试正确的请求都是 403,但“裸”根除外。结果当我升级 apache 时,它​​重新创建了导致这种行为的welcome.conf!
【解决方案2】:

同样的问题,当 apache 更新后,文件welcome.conf 已经创建。 我已将其重命名为禁用它,现在我可以看到拒绝所有指令的禁止页面

【讨论】:

  • 这是作为答案发布的,但并不试图回答这个问题。可能应该是评论。
猜你喜欢
  • 1970-01-01
  • 2014-12-11
  • 2011-07-09
  • 2021-09-07
  • 2014-02-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多