第一步:添加俩个ip地址
nmcli connection modify haha ipv4.addresses 192.168.118.200/24 +ipv4.addresses 192.168.118.100/24 ipv4.gateway 192.168.118.254 ipv4.dns 192.168.118.1 ipv4.method manual autoconnect yes
(配置文件名为haha)
nmcli connection up haha
第二步:创建目录与文件
mkdir -pv /www/ip/{100,200}
echo this is 100 > /www/ip/100/index.html
echo this is 200 > /www/ip/200/index.html (文件名必须为index.html)
因为被定义了
第三步:写配置文件(在 /etc/httpd/conf.d 目录下写配置文件)
vim /etc/httpd/conf.d/100.conf (文件名为100.conf)
systemctl restart httpd
setenforce 0
curl 192.168.118.100
curl 192.168.118.200