在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.
  1. Step 1
  2. ======
  3.  
  4. In the file: C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf
  5. Find: NameVirtualHost *:80 Replace with: NameVirtualHost *
  6.  
  7. In the file: C:\wamp\bin\apache\Apache2.2.11\conf\httpd . conf
  8. Find: #Include conf/extra/httpd-vhosts.conf and delete the #
  9.  
  10. Step 2
  11. ======
  12. Location: C:\Windows\System32\drivers\etc\hosts
  13.  
  14. For Each Website you will need to insert the following: 127.0.0.1 www.domain.dev
  15.  
  16. 127.0.0.1 represents the IP for your localhost.
  17.  
  18.  
  19. Step 3
  20. ======
  21. Location: C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf
  22.  
  23. For Each Website add the following:
  24.  
  25. <VirtualHost *>
  26. ServerName www.domain.dev
  27. DocumentRoot "C:/wamp/www/domain.com/"
  28. </VirtualHost>
  29.  
  30. Remove those 2 dummy virtual hosts and add:
  31.  
  32. <VirtualHost *:80>
  33. ServerName localhost
  34. DocumentRoot C:/wamp/www/
  35. </VirtualHost>
  36.  
  37. Also add this if you want others on the network to access your local machine:
  38.  
  39. <VirtualHost *:80>
  40. ServerName 192.168.1.??
  41. DocumentRoot C:/wamp/www/
  42. </VirtualHost>

以上是关于在WAMP中配置多个域以进行本地开发的主要内容,如果未能解决你的问题,请参考以下文章

在本地开发带有全栈 (WAMP) 的 React

无法在本地 wamp 服务器上运行我的 Magento 文件进行测试

关于wamp服务器文件的配置

PHP开发Apache服务器配置

为啥php每次在测试环境(WAMP)中生成相同的会话ID?

本地主机上的 Symfony 资产(Wamp)