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

相关推荐
风酥糖22 分钟前
在Termux中部署一个简单的服务导航页
linux·服务器·安卓
释怀不想释怀42 分钟前
硬盘分区:fdisk
linux·运维·服务器
时空无限1 小时前
ubuntu 22.04 如何使用命令查看配置防火墙规则
服务器·网络·ubuntu
黄昏回响2 小时前
计算机系统基础知识(九):软件篇之网络协议详解
网络·网络协议·面试·改行学it
vvw&2 小时前
如何在 Linux 中安装和使用 nftables
linux·运维·服务器·ubuntu
桌面运维家2 小时前
KVM虚拟机:Neutron网络故障诊断与修复实战
服务器·网络·php
zl_dfq2 小时前
计算机网络 之 【http协议】(简易HTTP服务器实现逻辑)
服务器·计算机网络·http
天启HTTP3 小时前
多线程环境下,动态IP怎么分配最合理
java·服务器·网络
serve the people3 小时前
ACME 协议流程与AllinSSL 的关系(二)
网络协议·https·ssl
serve the people3 小时前
ACME 协议流程与AllinSSL 的关系(三)
服务器·网络·https