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

相关推荐
likfishdn19 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染21 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean39 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=41 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二1 小时前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
一只小姜丝3321 小时前
解决各大浏览器中http地址无权限调用麦克风摄像头问题
网络·vue.js·网络协议·http
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
陆沙2 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
Tisfy5 小时前
LeetCode 1472.设计浏览器历史记录:一个数组完成模拟,单次操作均O(1)
服务器·leetcode·浏览器·memcached·题解·模拟·数组