C:WINDOWSsystem32driversetchosts
在这个文件中 最下面添加。
- 127.0.0.1 localhost.com
- 127.0.0.1 cho.com
- 127.0.0.1 devwo.com
- 127.0.0.1 phpmyadmin.com
信息来自:http://blog.sina.com.cn/s/blog_7347580d0100w88d.html
D:wampinapacheApache2.2.17confextrahttpd-vhosts.conf
添加与hosts 相应的 映射
- #
- # Virtual Hosts
- #
- # If you want to maintain multiple domains/hostnames on your
- # machine you can setup VirtualHost containers for them. Mostconfigurations
- # use only name-based virtual hosts so the server doesn't need toworry about
- # IP addresses. This is indicated by the asterisks in thedirectives below.
- #
- # Please see the documentation at
- #<URL:http://httpd.apache.org/docs/2.2/vhosts/>
- # for further details before you try to setup virtual hosts.
- #
- # You may use the command line option '-S' to verify your virtualhost
- # configuration.
- #
- # Use name-based virtual hosting.
- #
- NameVirtualHost *:80
- #
- # VirtualHost example:
- # Almost any Apache directive may go into a VirtualHostcontainer.
- # The first VirtualHost section is used for all requests that donot
- # match a ServerName or ServerAlias in any<VirtualHost> block.
- #
- <VirtualHost *:80>
- ServerAdminwebmaster@dummy-host.hleclerc-PC.ingenidev
- DocumentRoot"C:/Dev/Projets/WampServer2-64b/install_files_wampserver2/bin/apache/Apache2.2.17/docs/dummy-host.hleclerc-PC.ingenidev"
- ServerNamedummy-host.hleclerc-PC.ingenidev
- ServerAliaswww.dummy-host.hleclerc-PC.ingenidev
- ErrorLog"logs/dummy-host.hleclerc-PC.ingenidev-error.log"
- CustomLog"logs/dummy-host.hleclerc-PC.ingenidev-access.log" common
- </VirtualHost>
- <VirtualHost *:80>
- ServerAdminwebmaster@dummy-host2.hleclerc-PC.ingenidev
- DocumentRoot"C:/Dev/Projets/WampServer2-64b/install_files_wampserver2/bin/apache/Apache2.2.17/docs/dummy-host2.hleclerc-PC.ingenidev"
- ServerNamedummy-host2.hleclerc-PC.ingenidev
- ErrorLog"logs/dummy-host2.hleclerc-PC.ingenidev-error.log"
- CustomLog"logs/dummy-host2.hleclerc-PC.ingenidev-access.log" common
- </VirtualHost>
- /*-----------------------------*/
- <VirtualHost *:80>
- Options None
- ServerAdmin cho.com
- DocumentRoot E:PHPPHPProjectinpiao
- ServerName cho.com
- ErrorLog logs/phpmyadmin.com-error_log
- CustomLog logs/phpmyadmin.com-access_log common
- php_admin_value open_basedir "E:PHPPHPProjectinpiao"
- </VirtualHost>
- <VirtualHost *:80>
- Options None
- ServerAdmin devwo.com
- DocumentRoot E:PHPPHPProjectdevwo
- ServerName devwo.com
- ErrorLog logs/phpmyadmin.com-error_log
- CustomLog logs/phpmyadmin.com-access_log common
- php_admin_value open_basedir "E:PHPPHPProjectdevwo"
- </VirtualHost>
- <VirtualHost *:80>
- Options None
- ServerAdmin localhost.com
- DocumentRoot E:PHPPHPProject
- ServerName localhost.com
- ErrorLog logs/phpmyadmin.com-error_log
- CustomLog logs/phpmyadmin.com-access_log common
- php_admin_value open_basedir "E:PHPPHPProject"
- </VirtualHost>
- <VirtualHost *:80>
- Options None
- ServerAdmin phpmyadmin.com
- DocumentRoot D:wampappsphpmyadmin3.3.9
- ServerName phpmyadmin.com
- ErrorLog logs/phpmyadmin.com-error_log
- CustomLog logs/phpmyadmin.com-access_log common
- php_admin_value open_basedir "D:wampappsphpmyadmin3.3.9"
- </VirtualHost>
最后在 confhttpd.conf 中 开启
# Virtual hosts
Include conf/extra/httpd-vhosts.conf