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

相关推荐
minji...36 分钟前
Linux 基础IO(一) (C语言文件接口、系统调用文件调用接口open,write,close、文件fd)
linux·运维·服务器·网络·数据结构·c++
码龄3年 审核中44 分钟前
Linux record 04
linux·运维·服务器
RisunJan1 小时前
Linux命令-ftptop命令(实时监控 ProFTPD 服务器连接状态)
linux·运维·服务器
虾..1 小时前
Linux 文件描述符,重定向及缓冲区理解
linux·运维·服务器
真正的醒悟1 小时前
202503-经验之道
服务器·网络·php
db_cy_20622 小时前
Git对服务器配置文件进行版本控制
运维·服务器·git
qq_251616192 小时前
ubuntu nginx文件服务器
linux·服务器·网络
晚风吹长发2 小时前
初步了解Linux中文件描述符-fd
linux·运维·服务器·c++·开发·文件
微风◝2 小时前
AlmaLinux9配置本地镜像仓库
linux·运维·服务器
云计算练习生2 小时前
渗透测试行业术语—— 网络攻击方式与漏洞利用
服务器·网络·安全·渗透测试术语·网络安全术语