Centos7修改apache默认页面方法

时间:2026-02-14 02:14:26

1、操作系统是CentOS Linux release 7.2.1511,和Centos6在服务和配置文件路径方面还是有区别的

Centos7修改apache默认页面方法

2、安装apache

yum install httpd

Centos7修改apache默认页面方法

3、启动apache服务

Centos7修改apache默认页面方法

4、apache的默认配置文件名称为httpd.conf,使用find / -name httpd.conf命令查找到具体的路径为/etc/httpd/conf/httpd.conf

Centos7修改apache默认页面方法

5、进入到apache的主目录/etc/httpd

里面有一个conf.d的目录

Centos7修改apache默认页面方法

6、进入conf.d目录,找到welcome.conf配置文件并编辑它,这个欢迎页面就是apache默认首页

Centos7修改apache默认页面方法

7、通过查看welcome.conf这个配置文件,可以发现apache默认页面文件为

/usr/share/httpd/noindex/index.html

Centos7修改apache默认页面方法

8、重置默认首页文件的内容

[root@client conf.d]# echo '192.168.1.167 It is work!' > /usr/share/httpd/noindex/index.html

Centos7修改apache默认页面方法

9、防火墙放行apache的默认端口80,并在浏览器中访问测试,如图所示修改默认页面成功

Centos7修改apache默认页面方法

© 2026 一点知道
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com