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

相关推荐
DO your like19 分钟前
手机热点搭建个人局域网
服务器·智能手机·智能路由器
野生技术架构师31 分钟前
原来可以搭建一个HTTP服务
网络·网络协议·http
咕噜企业分发小米1 小时前
直播云服务器安全防护有哪些最新的技术趋势?
运维·服务器·安全
空城雀1 小时前
python精通连续剧第一集:简单计算器
服务器·前端·python
秋风未动蝉已先觉1 小时前
CentOs服务器 systemctl执行权限授权给普通权限work用户
linux·服务器
程序员zgh1 小时前
Linux 系统调用
linux·运维·服务器·c语言·c++·系统安全
P-ShineBeam1 小时前
八卡A100服务器坏卡引发 CUDA initialization: cudaGetDeviceCount()异常
运维·服务器·人工智能·语言模型
Xの哲學2 小时前
Linux io_uring 深度剖析: 重新定义高性能I/O的架构革命
linux·服务器·网络·算法·边缘计算
cly12 小时前
Ansible自动化(十四):Roles(角色)
服务器·自动化·ansible
Nobody__12 小时前
解决多台服务器 UID/GID 做对齐后,文件系统元数据未更新的情况
运维·服务器