Posted By

Meander365 on 11/07/10


Tagged

apache local Development virtual host wamp VirtualHost


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Eystein


Configuring Multiple Domains within WAMP for Local Development


 / Published in: Apache
 

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

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>

Report this snippet  

You need to login to post a comment.