关防火墙
systemctl stop firewalld
setenforce 0
安装挂载web
mount /dev/sr0 /mnt
dnf install nginx -y
启动web
systemctl start nginx
nmcli配置网卡
nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.182.100/24 +ipv4.addresses 192.168.182.200/24 ipv4.gateway 192.168.182.2 ipv4.dns 8.8.8.8
激活配置
nmcli connection up ens160
xshell更新连接ip后创建子配置文件并定义多个server模块
vim /etc/nginx/conf.d/test_ip.conf
创建对应目录文件
mkdir /test/{100,200} -pv
mkdir: created directory '/test'
mkdir: created directory '/test/100'
mkdir: created directory '/test/200'
echo test 100 > /test/100/index.html
echo test 200 > /test/200/index.html
重启服务
systemctl restart nginx
curl测试本地
测试网页