Apache 设置多个虚拟服务器

#Listen 12.34.56.78:80
Listen 8888
Listen 127.0.0.1:8082

 

DocumentRoot "D:/Php/test1"


<VirtualHost 127.0.0.1:8082>
  ServerAdmin webmaster@host.example.com
#  DocumentRoot "D:/Php/test1"
DocumentRoot "D:/Php/test2"
  ServerName host.example.com
  ErrorLog logs/host.example.com-error_log
  TransferLog logs/host.example.com-access_log
   <Directory />
      Options FollowSymLinks
   AllowOverride None
      Order allow,deny
      Allow from all
 </Directory>
</VirtualHost>

如此

http://localhost:8888 ==》 "D:/Php/test1"

http://localhost:8082 ==》 "D:/Php/test2"

 

posted @ 2013-12-30 16:52  Felix Liang  阅读(239)  评论(0编辑  收藏  举报