linux http服务基于IP详解

1.1 基于Ip 多主机
创建ip

1.1.1 加ip
Nmcli connection modify ens33 +ipv4.addresses 192.168.142.126/24
Nmcli connection modify ens33 +ipv4.addresses 192.168.142.127/24

nmcli connection modify ens33 ipv4.method manual

Nmcli connection modify ens33 connection.autoconnect yes

Nmcli connection up ens33

1.1.2编辑子配置文件/etc/httpd/conf.d/vhost.conflinux http服务基于IP详解
1.1.3:创建目录:/www/126 、/www/127
[[email protected] ~]# mkdir /www/{126,127} –p

1.1.4:编辑内容到/www/html/126/index.html
[[email protected] ~]# echo 126 > /www/126/index.html
[[email protected] ~]# echo 127 > /www/127/index.html

1.1.5:重启服务
[[email protected] ~]# systemctl restart httpd
[ [email protected] ~]# systemctl status httpd

1.1.6:访问ip

linux http服务基于IP详解!linux http服务基于IP详解