您的当前位置:首页正文

Apache服务器——基于IP的虚拟主机

来源:要发发知识网

1 安装

2 配置网卡

ifconfig ens33     192.168.43.182

ifconfig ens33:2  192.168.43.192

ifconfig ens33:3  192.168.43.202

网络设置

3 配置网页

mkdir -p

cd

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

5 启动与测试

测试1

192.168.43.182

测试2

192.168.43.192

测试3

192.168.43.202