多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.成功访问

相关推荐
utf8mb4安全女神2 分钟前
如果复制windows 内容到 Linux,带入不可见特殊符,怎么解决
linux·运维·服务器
fei_sun14 分钟前
网卡、网关、网桥、交换机、路由器
linux·服务器·网络
2601_9615934237 分钟前
Mac 虚拟机跑 Linux 选哪个?CentOS 8 稳定版适配方案
linux·macos·centos
ljs6482739511 小时前
智慧商城(Smart Mall):基于 Spring Boot + Vue 3 的现代化电商平台实战
linux·vue.js·spring boot·后端
run21professional1 小时前
系统包管理器和语言级包管理器的区别,及其源配置
linux
阿成学长_Cain1 小时前
Linux grpck命令超全详解|校验组文件完整性、修复/etc/group错误实战
linux·运维·服务器·网络
进击切图仔1 小时前
基于千问的白盒蒸馏 SOP
运维·服务器·人工智能·python·效率
量子罐头1 小时前
光润通发布LYSH-LAN-V1.0家庭版智能安全路由器 主打国密级硬件加密
网络·安全·智能路由器
杖雍皓1 小时前
没有服务器如何构建现代 Web 应用:平台选型与组合策略
运维·服务器·前端·react.js·github·netlify·vercel
指尖的爷1 小时前
Ubuntu 24.04 彻底关闭自动更新(桌面+服务器通用)
服务器·数据库·ubuntu