虚拟主机设置

阅读更多

Apache

1. 修改host

   
  1. 127.0 . 0.1        www. 1 .com 
  2. 127.0 . 0.1        www. 2 .com  



2. 配置httpd.conf

  1. NameVirtualHost 127.0.0.1  
  2. < VirtualHost  127.0.0.1 >   
  3.     ServerAdmin [email protected]  
  4.     DocumentRoot WWW/vir1  
  5.     ServerName www.1.com  
  6.     ErrorLog logs/dummy-host.example.com-error_log  
  7.     CustomLog logs/dummy-host.example.com-access_log common  
  8. < / VirtualHost >   
  9. < VirtualHost  127.0.0.1 >   
  10.     ServerAdmin [email protected]  
  11.     DocumentRoot WWW/vir2  
  12.     ServerName www.2.com  
  13.     ErrorLog logs/dummy-host.example.com-error_log  
  14.     CustomLog logs/dummy-host.example.com-access_log common  
  15. < / VirtualHost >   



Tomcat

1. 修改host

  1. 127.0 . 0.1        www. 1 .com  
  2. 127.0 . 0.1        www. 2 .com  



2. 配置server.xml

 
  1. < Host   name = "www.1.com"   appBase = "webapps"   unpackWARs = "true"   autoDeploy = "true"   xmlValidation = "false"   xmlNamespaceAware = "false" >   
  2.            < Context   path = ""   docBase = "vir1"   debug = "0"   reloadable = "true"   />   
  3. < / Host >   
  4. < Host   name = "www.2.com"   appBase = "webapps"   unpackWARs = "true"   autoDeploy = "true"   xmlValidation = "false"   xmlNamespaceAware = "false" >   
  5.            < Context   path = ""   docBase = "vir2"   debug = "0"   reloadable = "true"   />   
  6. < / Host >   



continue……

你可能感兴趣的:(Tomcat,Access,Apache,XML)