htaccess的所有否定获取Apache服务器的测试页 [英] htaccess deny from all gets apache server test page

查看:265
本文介绍了htaccess的所有否定获取Apache服务器的测试页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 zpanel 的CentOS 6.3 。 现在是什么问题。

I have installed zpanel with centos 6.3. Now what is the problem.

我已经加入域 mydomain.com 和我添加空白的index.php 文件。 我说太的.htaccess 文件,从所有拒绝 现在,当我在浏览器中打开网页,我得到的Apache 2的测试页,而不是 403禁止 但是,如果我打开 http://mydomain.com/index.php ,现在我得到403禁止。

I have added domain mydomain.com and I have added blank index.php file. I added too .htaccess file with "deny from all" Now when I open the page in the browser, I get Apache 2 Test Page instead 403 Forbidden But if I open http://mydomain.com/index.php, now I get 403 Forbidden.

我试图修改Apache的配置文件的DirectoryIndex 但没有任何积极的结果。任何人都可以帮我吗?

I tried to edit the apache config file Directoryindex but there is no positive result. Anyone can help me?

推荐答案

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

Try to disable the default Apache CentOS welcome page:

#
# 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 )后应该做的伎俩太

Edit file /etc/httpd/conf.d/welcome.conf and comment everything. Simply removing the welcome.conf file (or renaming it as .conf.disabled for example) should do the trick too.

然后重装Apache的配置(服务的httpd重新启动),事情应该正常工作。

Then, reload apache configuration (service httpd restart) and things should work as expected.

这篇关于htaccess的所有否定获取Apache服务器的测试页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆