一 虚拟网站主机功能
1.使用nmtui命令给网卡配置置多个IP地址
[root@localhost ~]# nmtui
然后按下键点击确定,在返回到原来的界面点击确定完成设置
2.重新启动网卡服务
[root@localhost ~]# nmcli connection reload ens 33
[root@localhost ~]# nmcli connection up ens 33
3.检查配置的IP地址是否连通
这样是ping通了 按ctrl c退出
4.在/text/www中创建用于保存不同网站数据的2个目录,并向数据中写入数据。 [root@localhost ~]# mkdir –p /text/www/237
[root@localhost ~]# mkdir –p /text/www/238
[root@localhost ~]#echo « IP“192.168.31.237 ” > /text/www/237/index.html
[root@localhost ~]#echo « IP“192.168.31.238 ” > /text/www/238/index.html
5.修改httpd的主配置文件,并把二个基于IP地址的虚拟主机网站参数