第一步 配置网络
[root@localhost ~]# nmcli connection modify ens160 ipv4.addresses 192.168.52.132/24 ipv4.gateway 192.168.52.1 ipv4.dns 114.114.114.114 ipv4.method manual connection.autoconnect yes
[root@localhost ~]# nmcli connection modify ens160 ipv4.addresses 192.168.52.131/24 ipv4.gateway 192.168.52.1 ipv4.dns 114.114.114.114 ipv4.method manual connection.autoconnect yes
激活链接
[root@localhost ~]# nmcli connection up ens160
第二步 创建目录
[root@localhost ~]# mkdir /www/xiaopang
[root@localhost ~]# mkdir /www/dapang
编写内容
echo xiaopang > /www/xiaopang/index.html
echo dapang > /www/dapang/index.html
编辑配置文件
[root@localhost ~]# vim /etc/httpd/conf.d/vhosts.conf
第四步 编辑域名解析
[root@localhost ~]# vim /etc/hosts
访问结果