在WAMP中配置多个域以进行本地开发
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在WAMP中配置多个域以进行本地开发相关的知识,希望对你有一定的参考价值。
Great for developing multiple sites under a wamp install. Removes the headache of paths and domains and changing them when deploying to their live environment.
Step 1 ====== In the file: C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf Find: NameVirtualHost *:80 Replace with: NameVirtualHost * In the file: C:\wamp\bin\apache\Apache2.2.11\conf\httpd . conf Find: #Include conf/extra/httpd-vhosts.conf and delete the # Step 2 ====== Location: C:\Windows\System32\drivers\etc\hosts For Each Website you will need to insert the following: 127.0.0.1 www.domain.dev 127.0.0.1 represents the IP for your localhost. Step 3 ====== Location: C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf For Each Website add the following: <VirtualHost *> ServerName www.domain.dev DocumentRoot "C:/wamp/www/domain.com/" </VirtualHost> Remove those 2 dummy virtual hosts and add: <VirtualHost *:80> ServerName localhost DocumentRoot C:/wamp/www/ </VirtualHost> Also add this if you want others on the network to access your local machine: <VirtualHost *:80> ServerName 192.168.1.?? DocumentRoot C:/wamp/www/ </VirtualHost>
以上是关于在WAMP中配置多个域以进行本地开发的主要内容,如果未能解决你的问题,请参考以下文章