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.测试

相关推荐
映翰通朱工18 小时前
工业4G网关无公网IP远程运维实战(内网终端异地访问方案)
运维·服务器·网络·安全·智能路由器
洪晓露18 小时前
将 rke2 集群证书延长至 10 年
运维·服务器·数据库
IP老炮不瞎唠19 小时前
Python 价格监控如何实现?思路与实用方法分享
运维·服务器·网络
睡不醒男孩03082319 小时前
CLup 6.x 版本中针对StarRocks 存算一体集群的完整操作手册
java·服务器·网络·clup
Tokai_Teio_119 小时前
第四届黄河流域 misc
运维·服务器
what_201820 小时前
Linux 磁盘 (查看、划分、inode)
linux·运维·服务器
A_humble_scholar21 小时前
Linux(七)调度器:从硬件矛盾到进程切换的底层逻辑
linux·服务器·网络
上海云盾-小余1 天前
源站隐藏实战:规避裸 IP 被直接攻击的完整方案
数据库·网络协议·tcp/ip
C语言小火车1 天前
嵌入式Linux应用开发技术栈完全指南
linux·运维·服务器
johnny2331 天前
WebDAV概述、原理、拓展:SMB、ZeroByte
网络协议