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

测试网页

相关推荐
weixin_307779132 分钟前
Hive集群之间迁移的Linux Shell脚本
大数据·linux·hive·bash·迁移学习
漫步企鹅36 分钟前
【蓝牙】Linux Qt4查看已经配对的蓝牙信息
linux·qt·蓝牙·配对
cui_win1 小时前
【网络】Linux 内核优化实战 - net.core.flow_limit_table_len
linux·运维·网络
梦在深巷、1 小时前
MySQL/MariaDB数据库主从复制之基于二进制日志的方式
linux·数据库·mysql·mariadb
冰橙子id1 小时前
linux系统安全
linux·安全·系统安全
stark张宇1 小时前
VMware 虚拟机装 Linux Centos 7.9 保姆级教程(附资源包)
linux·后端
Johny_Zhao2 小时前
Ubuntu系统安装部署Pandawiki智能知识库
linux·mysql·网络安全·信息安全·云计算·shell·yum源·系统运维·itsm·pandawiki
悲伤小伞2 小时前
linux_git的使用
linux·c语言·c++·git
CRMEB定制开发2 小时前
【实战】CRMEB Pro 企业版安装教程(附 Nginx 反向代理配置 + 常见问题解决)
nginx·商城系统·微信商城·crmeb
cv高级工程师YKY3 小时前
SRE - - PV、UV、VV、IP详解及区别
大数据·服务器·uv