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

相关推荐
色的归属感44 分钟前
一款功能强大的手机使用情况监控工具
websocket·网络协议·tcp/ip·http·网络安全·https·udp
iOS技术狂热者1 小时前
【Android开发基础】手机传感器信息的获取
websocket·网络协议·tcp/ip·http·网络安全·https·udp
@hdd6 小时前
Qt实现HTTP GET/POST/PUT/DELETE请求
qt·http
swift开发pk OC开发8 小时前
如何轻松查看安卓手机内存,让手机更流畅
websocket·网络协议·tcp/ip·http·网络安全·https·udp
itachi-uchiha9 小时前
关于UDP端口扫描概述
网络·网络协议·udp
学习至死qaq9 小时前
windows字体在linux访问异常
linux·运维·服务器
swift开发pk OC开发10 小时前
flutter框架中文文档,android智能手机编程答案
websocket·网络协议·tcp/ip·http·网络安全·https·udp
haoranyyy10 小时前
mac环境中Nginx安装使用 反向代理
linux·服务器·nginx
JCBP_10 小时前
数据结构3
服务器·c语言·数据结构·vscode
安顾里11 小时前
TCP、HTTP、HTTPS、DNS的原理
tcp/ip·http·https