WampServer虚拟主机配置

我现在用的是WampServer2.0i版本

在“httpd.conf”文件的最下端添加
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
    ServerAdmin  riathinker@gmail.com

    DocumentRoot d:/wamp/www/
    ServerName localhost
</VirtualHost>

<VirtualHost ladderschool.com>
    ServerAdmin riathinker@gmail.com

  ServerAlias http://www.ladderschool.com/
    DocumentRoot d:/wamp/www/ladderschool
    ServerName ladderschool.com
    <Directory "d:/wamp/www/ladderschool/">
      AllowOverride all
      Order Allow,Deny
      Allow from 127.0.0.1
    </Directory>
</VirtualHost>

<VirtualHost demo.com>

  ServerAlias http://www.demo.com/
    ServerAdmin  riathinker@gmail.com

    DocumentRoot d:/wamp/www/wordpress
    ServerName demo.com
    <Directory "d:/wamp/www/wordpress/">
      AllowOverride all
      Order Allow,Deny
      Allow from 127.0.0.1
    </Directory>
</VirtualHost>

就可以完成多个虚拟主机的配置

posted @ 2009-11-06 18:00  zhych  阅读(1382)  评论(0编辑  收藏  举报