4

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

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

我试图编辑 apache 配置文件Directoryindex,但没有积极的结果。任何人都可以帮助我吗?

4

2 回答 2

3

尝试禁用默认的 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),一切都应该按预期工作。

于 2014-05-09T10:52:56.353 回答
0

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

于 2020-05-20T05:39:12.323 回答