apache虚拟主机类型有两种
1、基于名称的虚拟主机
 2、基于地址或IP地址的虚拟主机
基于名称的虚拟主机

 
 
## httpd-vhosts.conf  添加如下代码,
## 同时要在httpd.conf中追加监听89端口  Listen 89
## 修改apache 文件要 在bin路径下面的cmd  录入 httpd -t  检测 代码 是否正确  出现 Syntax OK  就语法正确
## 要配置hosts 解析  C:\Windows\System32\drivers\etc
<VirtualHost *:89>   
    DocumentRoot "F:/WebSite/heatmap"
    ServerName  www.zenws12.com
    <Directory "F:/WebSite/heatmap">
  	Options -Indexes +FollowSymlinks
  	AllowOverride All
  	Require all granted
     </Directory>
</VirtualHost>
<VirtualHost *:89>   
    DocumentRoot  F:/WebSite/eMIS/UI
    ServerName  www.aresw.com
   <Directory "F:/WebSite/eMIS/UI">
	  Options -Indexes +FollowSymlinks
	  AllowOverride All
 	 Require all granted
    </Directory>
</VirtualHost>
基于地址或IP地址的虚拟主机
要设置基于IP的虚拟主机,需要在服务器上配置多个IP地址。因此,vhost apache的数量取决于服务器上配置的IP地址数量。如果您的服务器有10个IP地址,则可以创建10个基于IP的虚拟主机。
##  同时要在httpd.conf中追加监听89端口 Listen 192.168.0.100:89
## httpd-vhosts.conf  添加如下代码,
<VirtualHost 192.168.1.200:89>   
    DocumentRoot  F:/WebSite/eMIS/UI
    ServerName  www.ares02.com
   <Directory "F:/WebSite/eMIS/UI">
	  Options -Indexes +FollowSymlinks
	  AllowOverride All
 	 Require all granted
    </Directory>
</VirtualHost>
<VirtualHost 192.168.1.100:89>   
    DocumentRoot  F:/WebSite/eMIS/UI
    ServerName  www.ares01.com
   <Directory "F:/WebSite/eMIS/UI">
	  Options -Indexes +FollowSymlinks
	  AllowOverride All
 	 Require all granted
    </Directory>
</VirtualHost>
在不同的IP地址(例如内部和外部地址)上提供相同的内容

在不同端口上运行不同的站点

<VirtualHost 127.0.0.1:89>   
    DocumentRoot "F:/WebSite/heatmap"
    ServerName  www.zen.com
    <Directory "F:/WebSite/heatmap">
  	Options -Indexes +FollowSymlinks
  	AllowOverride All
  	Require all granted
     </Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:90>   
    DocumentRoot  F:/WebSite/eMIS/UI
    ServerName  www.zen.com
   <Directory "F:/WebSite/eMIS/UI">
	  Options -Indexes +FollowSymlinks
	  AllowOverride All
 	 Require all granted
    </Directory>
</VirtualHost>
主服务设定
对于未在其中一个指令中指定的任何地址(例如localhost)的请求将转到主服务器(如果有)。
 能走主服务的 端口必须是 listen 中设定的,且 域名 是 VirtualHost指定的。主服务域名也会走主服务的
 
 
  DocumentRoot F:/WebSite/base
    ServerName  www.123456.com
    <Directory "F:/WebSite/base">
  	Options -Indexes +FollowSymlinks
  	AllowOverride All
  	Require all granted
     </Directory>
<VirtualHost 127.0.0.1:89>   
    DocumentRoot "F:/WebSite/heatmap"
    ServerName  www.zenws12.com
    <Directory "F:/WebSite/heatmap">
  	Options -Indexes +FollowSymlinks
  	AllowOverride All
  	Require all granted
     </Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:89>   
    DocumentRoot  F:/WebSite/eMIS/UI
    ServerName  www.aresw.com
   <Directory "F:/WebSite/eMIS/UI">
	  Options -Indexes +FollowSymlinks
	  AllowOverride All
 	 Require all granted
    </Directory>
</VirtualHost>









![[ICASSP 2019] 差分隐私压缩 K 均值](https://img-blog.csdnimg.cn/397bfed15be5413d87970dc020b03bef.png)








