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

相关推荐
汤愈韬10 小时前
ACL概述、ACL原理、基本ACL应用及配置
网络·网络协议·网络安全
小二李12 小时前
第11章 nestjs服务端开发:登录鉴权
运维·服务器
i建模13 小时前
如何在Arch Linux中重设忘记的root密码
linux·运维·服务器
何中应16 小时前
vmware的linux虚拟机如何设置以命令行方式启动
linux·运维·服务器
haluhalu.16 小时前
Linux网络编程------网络基础
网络·网络协议
坐怀不乱杯魂16 小时前
Linux网络 - HTTP协议
网络·网络协议·http
野犬寒鸦16 小时前
从零起步学习并发编程 || 第一章:初步认识进程与线程
java·服务器·后端·学习
百炼成神 LV@菜哥17 小时前
Kylin Linux V10 aarch64 安装启动 TigerVNC-Server
linux·服务器·kylin
m0_7373025817 小时前
百度智能云边缘云服务器,端云协同赋能全域智能场景
服务器
Anastasiozzzz17 小时前
LeetCode Hot100 295. 数据流的中位数 MedianFinder
java·服务器·前端