apache 单个ip配置多个发布目录多个域名

1.找到apache 配置文件 httpd.conf

搜索   Include conf/extra/httpd-vhosts.conf  去掉前面的注释;

注释不注释都可以 DocumentRoot  "D:www"

2.编辑 extra/httpd-vhosts.conf 文件

新添

<VirtualHost *:80>
DocumentRoot "D:wwwaaa"
ServerName  www.aaa.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:wwwbb"
ServerName   www.bbb.com
</VirtualHost>
3.编辑hosts文件  C:WindowsSystem32driversetc(默认是隐藏)

新添

127.0.0.1  www.aaa.com

127.0.0.1  www.bbb.com

重启apache  完成