Centos7修改apache默认页面方法

2025-05-26 06:03:12

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

Centos7修改apache默认页面方法

2、安装apacheyum 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/http颊俄岿髭d/noindex/index.html

Centos7修改apache默认页面方法

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

Centos7修改apache默认页面方法
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢