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

相关推荐
DC_BLOG3 分钟前
Linux-GlusterFS进阶分布式卷
linux·运维·服务器·分布式
yourkin66612 分钟前
TCP...
服务器·网络·tcp/ip
cookies_s_s37 分钟前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
诶尔法Alpha2 小时前
Linux上使用dify构建RAG
linux·运维·服务器
哑巴语天雨2 小时前
前端面试-网络协议篇
websocket·网络协议·http·面试·https
熬夜苦读学习2 小时前
Linux文件系统
linux·运维·服务器·开发语言·后端
荔枝荷包蛋6663 小时前
【网络】高级IO——Reactor版TCP服务器
运维·服务器
ktkiko113 小时前
Websocket——心跳检测
网络·websocket·网络协议
GGGGGGGGGGGGGG.4 小时前
hapxory-ACL基础介绍及案例
运维·服务器·网络
黑牛先生4 小时前
【Linux】匿名管道
linux·运维·服务器