多IP访问网站

1.创建挂载点

mount /dev/sr0 /mnt

vim /etc/yum.repos.d/base.repo

BaseOS

name=BaseOS

baseurl=file:///mnt/BaseOS

gpgcheck=0

Appstream

name=AppStream

baseurl=file:///mnt/AppStream

gpgcheck=0

2.关闭防火墙等 systemctl stop firewalld

setenforce 0

3.下载nginx软件 dnf install nginx -y

4.多IP配置 nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.92.128/24 ipv4.gateway 192.168.92.2 ipv4.dns 114.114.114.114 +ipv4.addresses 192.168.92.130/24

重启 nmcli connection up ens160

5.配置文件 vim /etc/nginx/conf.d/test_ip.conf

server {

listen 192.168.92.128:80;

root /www/ip/128;

location / { #配置/==/www/ip/100下的资源文件

}

}

server {

listen 192.168.92.130:80;

root /www/ip/130;

location / { #配置/==/www/ip/100下的资源文件

index index.html;

}

}

6.创建目录并编入信息 mkdir /www/ip/{128,130} -pv

echo this is 128 > /www/ip/128/index.html

echo this is 130 > /www/ip/130/index.html

7.重启nginx systemctl restart nginx

8.成功访问

相关推荐
I · T · LUCKYBOOM2 小时前
30.Firewalld-Linux
linux·运维·安全
沙滩小绵羊2 小时前
Linux常见命令
linux·运维·服务器
驰羽2 小时前
NAT模式下VMware的虚拟机DNS解析失败的问题解决
linux·网络·dns
菜鸡00013 小时前
安装G2O
linux
誰能久伴不乏3 小时前
epoll 学习踩坑:`fcntl` 设置非阻塞到底用 `F_SETFL` 还是 `F_SETFD`?
linux·服务器·网络·c++·tcp/ip
阿巴~阿巴~4 小时前
告别命令行:Navicat可视化操作数据库(附安装使用教程)
服务器·数据库·mysql·navicat·可视化操作数据库
TG:@yunlaoda360 云老大4 小时前
华为云国际站代理商跨境容灾是如何实现的?
服务器·数据库·华为云
来鸟 鸣间4 小时前
MIPI D-PHY 理解
linux·音视频·sensor·mipi
么么...4 小时前
在 Ubuntu 上安装 Docker 并部署 MySQL 容器
linux·运维·经验分享·笔记·mysql·ubuntu·docker
云川之下4 小时前
【网络】华为交换机S3700与S5700详解
服务器·网络·华为