目录
1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"
2.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200并创建首页文件index.html
1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"
我们定义的静态页面在/var/www/html目录中,静态网页的名字必须是index.html,这个文件存放在/var/www/html目录下,在访问页面时默认打开这个目录中的index.html文件。
[root@localhost ~]# yum install httpd -y
[root@localhost ~]# systemctl status firewalld #查看防火墙状态
[root@localhostr ~]# systemctl stop firewalld # 关闭防火墙[root@localhost conf]# cd /var/www/html
[root@localhost html]# vim hello.html
[root@localhost html]# systemctl restart httpd
我们还得将首页文件名改为index.html,然后重启httpd服务,就可以在服务器中访问到了。
[root@localhost conf]# cd /var/www/html
[root@localhost html]# mv hello.html index.html
[root@localhost html]# systemctl restart httpd