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

相关推荐
一只鹿鹿鹿2 小时前
智算算力、AI-芯片与产品解析(PPT文件)
大数据·运维·网络·人工智能·物联网·1024程序员节
开源必胜2 小时前
Socket、异步非阻塞 I/O 与 NGINX、Netty 模型
网络·tcp/ip·nginx
沫璃染墨3 小时前
从零入门计算机网络系列(十一):HTTP协议进阶——从重定向原理到GET/POST与Fiddler抓包
linux·服务器·开发语言·网络·c++·tcp/ip·html
Kobebryant-Manba3 小时前
C/S和B/S结构
运维·服务器
蓝祁子yoky3 小时前
Qt学习日记 Day13:网络编程(一)-TCP基础与Socket实战
网络·qt·学习
箓维4 小时前
TCP Socket的进阶实现
网络·笔记·tcp/ip
AI_Lab014 小时前
宝塔用了两年,有没有必要换成轻量方案?
linux·运维·服务器
by209994 小时前
Linux GDB 调试与 CGDB 使用
linux·运维·服务器·经验分享
小羊没烦恼!4 小时前
关于分布式锁原理的一些学习与思考-redis分布式锁,zookeeper分布式锁
java·服务器·网络·学习·负载均衡
小Ti客栈5 小时前
Netty 零拷贝原理与实战
运维·服务器·网络