http——配置nginx服务通过ip访问多网站

关防火墙

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测试本地

测试网页

相关推荐
取经蜗牛1 小时前
Ubuntu 国内镜像源配置指南(多版本常用镜像地址都有)
linux·运维·ubuntu
tedcloud1231 小时前
RTK部署教程:构建稳定的AI Workflow环境
服务器·javascript·人工智能·typescript·ocr
实心儿儿2 小时前
Linux —— 线程控制(1)
linux·运维·服务器
筠筠喵呜喵2 小时前
Linux软件开发性能优化
linux·c++·性能优化
Bruce_kaizy3 小时前
c++ linux环境编程——文件io介绍以及open 、write 、read 三剑客深度详解
linux·服务器·c++·ubuntu·操作系统·文件io
亦良Cool3 小时前
VMware虚拟机ubuntu瘦身,解决虚拟机越用越大
linux·运维·ubuntu
星辰&与海4 小时前
KVM + QEMU虚拟化方案
linux·运维
宋浮檀s5 小时前
应急响应——恶意流量&攻击行为识别
linux·运维·网络·网络安全·应急响应
REDcker5 小时前
Linux OverlayFS详解
java·linux·运维
Royzst5 小时前
xml知识点
java·服务器·前端