Apache服務器——基于IP的虛擬主機

1 安裝

yum install -y httpd

2 配置網卡

ifconfig ens33? ? ?192.168.43.182

ifconfig ens33:2? 192.168.43.192

ifconfig ens33:3? 192.168.43.202


網絡設置

3 配置網頁

mkdir -p /home/www

cd /home/www

mkdir html{1,2,3}

echo "192.168.43.182" >html1/index.html

echo "192.168.43.192" >html2/index.html

echo "192.168.43.202" >html3/index.html


網頁配置

4 主配置文件

vim /etc/httpd/conf/httpd.conf


vim /etc/httpd/conf/httpd.conf

5 啟動與測試

systemctl start httpd

測試1

192.168.43.182

測試2


192.168.43.192

測試3


192.168.43.202
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容