自定義多個ip地址訪問
1.下載httpd協議:dnf install httpd -y
2.編輯vhost.conf?
cd /etc/httpd
cd /conf.d
<directory /www>
allowoverride none
require all granted
</directory>
<virtualhost 192.168.244.130:80>
documentroot /www
servername 192.168.244.130
</virtualhost>
<virtualhost 192.168.244.131:80>
documentroot /www/131
servername 192.168.244.131
</virtualhost>
<virtualhost 192.168.244.132:80>
documentroot /www/132
servername 192.168.244.132
</virtualhost>
3.重啟服務:systemctl restart httpd
4.關閉防火墻:systemctl stop firewalld
? ? ? ? ? ? ? ? ? ? ? ? setenforce 0
5.部署網頁
mkdir /www/{131,132}
echo 131 > /www/131/index.html
echo 132 > /www/132/index.html
6.配置靜態ip并增加ip
nmcli connection modify ens160 ipv4.addresses 192.168.244.130/24
nmcli connection modify ens160 ipv4.gateway?192.168.244.2
nmcli connection modify ens160? ipv4.method manual
nmcli connection modify ens160 connection.autoconnect? yes
nmcli connection up ens160
nmcli?connection modify ens160 +ipv4.addresses 192.168.244.131/24
nmcli connection modify ens160 +ipv4.addresses 192.168.244.132/24
nmcli connection up ens160
7.ip訪問瀏覽器并查看 驗證是否成功