Configuring Multiple Domains within WAMP for Local Development


/ Published in: Apache
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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>

URL: http://www.kintek.com.au/web-design-blog/configuring-multiple-domains-within-wamp-for-local-development/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.