多IP访问多网站

root@server \~\]# mount /dev/sr0 /mnt #挂载 \[root@server \~\]# dnf install nginx -y #安装 ![](https://i-blog.csdnimg.cn/direct/b9f6963745f149168baf6ba6a6f776ea.png) \[root@server nginx\]# systemctl stop firewalld #关闭防火墙 \[root@server nginx\]# systemctl restart nginx #重启 \[root@server nginx\]# setenforce 0 #关闭selinux \[root@server nginx\]# nmtui #写多IP ![](https://i-blog.csdnimg.cn/direct/b36cef15650d41e7ad837d9d82501a27.png) \[root@server nginx\]# nmcli connection up ens160 #重启nmtui ![](https://i-blog.csdnimg.cn/direct/cab044b17c9a47e2a18f1f7e222c0053.png) \[root@server nginx\]#vim /etc/nginx/conf.d/test_ip.conf #编辑 ![](https://i-blog.csdnimg.cn/direct/5861f282058b4ff081c8d5cee004f485.png) \[root@server nginx\]# mkdir /test/{100,129,200} -pv #创建文件 ![](https://i-blog.csdnimg.cn/direct/e86ca72222bf4b8fb9286e7357eb71d4.png) \[root@server nginx\]# echo this is 129 \> /test/129/index.html \[root@server nginx\]# echo this is 100 \> /test/100/index.html \[root@server nginx\]# echo this is 200 \> /test/200/index.html #根据配置在主机创建数据文件 \[root@server nginx\]# systemctl restart nginx #重启 验证结果 ![](https://i-blog.csdnimg.cn/direct/7e475e7c759a4d31b2280010e9875763.png)![](https://i-blog.csdnimg.cn/direct/eab1742c9e4e4cd68a1a715c13c53cc9.png)![](https://i-blog.csdnimg.cn/direct/3100257d698e440bba36fc2eb66287c7.png) ![](https://i-blog.csdnimg.cn/direct/1cb31ad6fbf048e085555e97a11f2e77.png)

相关推荐
我的golang之路果然有问题几秒前
云服务器部署Gin+gorm 项目 demo
运维·服务器·后端·学习·golang·gin
心随_风动21 分钟前
SUSE Linux 发行版全面解析:从开源先驱到企业级支柱
linux·运维·开源
christine-rr44 分钟前
征文投稿:如何写一份实用的技术文档?——以软件配置为例
运维·前端·网络·数据库·软件构建
Altairr1 小时前
Docker基础(二)
运维·docker·容器
笑醉踏歌行1 小时前
NVM,Node.Js 管理工具
运维·ubuntu·node.js
西北大程序猿2 小时前
单例模式与锁(死锁)
linux·开发语言·c++·单例模式
酷爱码2 小时前
在 Linux 中修改 Apache HTTP Server(httpd)默认端口的完整指南
linux·http·apache
happyh h h h p p p p2 小时前
部署DNS从服务器
运维·服务器·网络
jiunian_cn2 小时前
【Linux】Linux权限
linux·服务器·mysql
betazhou2 小时前
有没有 MariaDB 5.5.56 对应 MySQL CONNECTION_CONTROL 插件
linux·数据库·mysql·oracle·mariadb