http作业

1.关闭防火墙

复制代码
[root@localhost ~]# systemctl stop firewalld   #关闭防火墙
[root@localhost ~]# setenforce  0

2.下载nginx包

复制代码
[root@localhost ~]# mount   /dev/sr0   /mnt #挂载目录
[root@localhost ~]# yum install nginx  -y  #下载nginx包

3.增加多条端口

复制代码
[root@localhost ~]# nmcli connection modify ens160  ipv4.method manual ipv4.addresses 192.168.92.10/24  ipv4.gateway 192.168.88.2 ipv4.dns 192.168.88.2  +ipv4.addresses 192.168.88.20/24  +ipv4.addresses 192.168.88.30/24  #当前主机添加多地址

4.期货网卡

复制代码
[root@localhost ~]# nmcli connection up ens160 #激活网卡

5.自定义nginx配置文件

复制代码
[root@localhost ~]# vim  /etc/nginx/conf.d/test_ip.conf  #自定义nginx配置文件
server {
	listen 192.168.88.10:80;
	root /test/10;
	location / {
        index  index.html;
	}
}
server {
	listen 192.168.88.20:80;
	root /test/20;
	location / { 
	    index  index.html;
	}
}
server {
        listen 192.168.88.30:80;
        root /test/30;
        location / {
            index  index.html;
        }
}
复制代码
[root@localhost ~]# mkdir /test/{10,20,30} -pv
mkdir: created directory '/test'
mkdir: created directory '/test/10'
mkdir: created directory '/test/20'
mkdir: created directory '/test/30'
[root@localhost ~]# echo this is 250 > /test/10/index.html
[root@localhost ~]# echo this is 250 > /test/20/index.html
[root@localhost ~]# echo this is 250 > /test/30/index.html

7.测试

相关推荐
萧行之14 小时前
Docker部署Loki+Grafana+Vector实现全服务器日志监控(含N8N/SSH/Fail2ban监控)
服务器·docker·grafana
learning-striving14 小时前
Ubuntu26.04下载安装教程
运维·服务器·vmware·虚拟机
AIwenIPgeolocation14 小时前
IP地址数据服务:赋能游戏行业体验优化与精细化运营
网络协议·tcp/ip·游戏
Joseph Cooper15 小时前
Linux regmap 子系统实战:在驱动中 dump PMIC 寄存器定位供电问题
linux·运维·服务器
TechWayfarer15 小时前
2026年IP归属地查询平台选型指南:金融风控、异地登录、离线库全场景实测
网络·网络协议·tcp/ip
Rust研习社15 小时前
Rust + PostgreSQL 极简技术栈应用开发
开发语言·数据库·后端·http·postgresql·rust
信徒_15 小时前
技术选型 RPC 框架
网络·网络协议·rpc
暴力求解16 小时前
Linux---保存信号
linux·运维·服务器·开发语言·操作系统
2401_8734794016 小时前
深度解析IP查询工具与普通IP库的核心区别:选型指南与业务场景对照
网络协议·tcp/ip·php
bqq1986102616 小时前
Ubuntu vs CentOS
linux·服务器