禁用CentOS下Apache的测试页面
来源:互联网 发布:掌趣科技 涵凌网络 编辑:程序博客网 时间:2024/04/30 03:57
禁用CentOS下Apache的测试页面
在CentOS中安装apache并启动后,默认CentOS会为Apache添加一个测试页面,安装完毕并且对Apache的保持默认配置,之后在浏览器中输入你的站点的域名或ip地址,浏览器会打开如下界面
该界面是用来测试Apache服务器是否工作正常。
禁用该测试页面的方法如下:
1.打开终端,登陆到CentOS上
2.在终端中输入以下命令
cd /etc/httpd/conf.d
3.继续输入命令,显示当前目录下的文件
ls
4.找到名为welcome.conf的文件,并用vim打开
vim welcome.conf
welcome.conf的内容如下
#
# 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>
文件中的说明性内容说明了该文件的主要作用,以及关闭该作用的方法。其实该文件也是一个普通的配置文件,并被包含进了Apache服务器httpd.conf主文件中,只要用"#"将welcome.conf的内容注释掉即可,如下:
#
# 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>
5.重新启动Apache
service httpd restart
注:查看noindex.html为存放路劲
cd /var/www/error/
ls
0 0
- 禁用CentOS下Apache的测试页面
- CentOS下Apache的升级
- Apache禁用测试页(默认页)
- Centos下配置Apache的虚拟目录
- centos 无法访问apache下的网站
- Centos下Apache的源码安装
- CentOS 下安装Apache
- centos 下 apache 安装
- Centos下GTK的安装与测试
- centos 下memcached的安装到测试
- Centos下GTK的安装与测试
- 禁用页面缓存的方法
- 禁用web页面的缓存
- centos下apache访问根目录下目录失败的解决
- 使用apache ab进行页面的压力测试
- 测试web页面下的过滤器
- apache使用ab进行页面的压力测试,并发测试,性能测试,中文注释
- CentOs下Apache配置全过程
- What's the difference between doGet()/doPost() and processRequest()?
- Servlet的默认processRequest方法
- 我在大学毕业后学习Linux系统的心得经验
- Vim常用功能总结
- 数据库SQL优化大总结之 百万级数据库优化方案
- 禁用CentOS下Apache的测试页面
- 虚拟主机
- 鸡年的几次面试
- request.getParameter() 和request.getAttribute() 区别
- 2017-2-20读过的书单
- 2017年二月观影小结
- 基础知识Notes: 字符串编码(ASCII, Unicode and UTF8)
- install gcc-4.8 and g++-4.8 on ubuntu16.04
- 《C++ Primer 第五版》学习笔记-第二章-变量和基本类型