1前提条件

systemctl stop firewalled 关闭防火墙
setenforce 0 关闭selinux
2
nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.145.128/24 +ipv4.addresses 192.168.145.100/24 ipv4.gateway 192.168.145.0 ipv4.dns 114.114.114.114创建两个ip地址配置网关dns
nmcli connection up ens160激活网卡配置
3配置文件


server{
listen 192.168.145.128:80; 设置监听IP地址,端口号
#server_name 设置域名
root /test/128; 设置根目录
location / {
index index.html;
}
}
4创建文件
[r
oot@localhost ~]# mkdir /test/{128,100} -pv 创建对应文件
mkdir: created directory '/test'
mkdir: created directory '/test/128'
mkdir: created directory '/test/100'
[root@localhost ~]# echo this is 128 > /test/128/index.html 文件中写入网页内容信息
[root@localhost ~]# echo this is 100 > /test/100/index.html
[root@localhost ~]# systemctl restart nginx 重启nginx服务
5客户端测试



9686




被折叠的 条评论
为什么被折叠?



