Testing a webserver relocation

When transferring a website from one service provider to another, you definitely want to test the new installation before changing the DNS records; e. g., you have example.com living at the IP address 12.34.56.78, and set up a new webserver at 98.76.54.32; now you want to test the new webserver, which possibly uses VirtualHosts, and therefore needs the domainname example.com in the HTTP-request. So, while leaving the DNS record at its old value (so that the rest of the world doesn’t see your new server after you have tested it), you convince your local computer that example.com lives at the new address. On Unixy systems, this is no problem: just add a new entry to the /etc/hosts file, and you are ready to go.

I was wondering if this also works on a Mac, with its fancy DirectoryService daemon; turns out, it does. Just add the line 98.76.54.32 example.com to your local /etc/hosts, and you are ready to test.

This is the nice thing about MacOS X – beneath its polished surface, there is still a raw Unix, and it knows how to behave.

About Daniel Tiggemann

Software-developer living in Cologne, Germany. Was once a physicist, specialized in computer simulations and parallel programming. Now more into JavaScript, web frontend development, and especially mobile computing.
This entry was posted in Apple. Bookmark the permalink.

790 Responses to Testing a webserver relocation

  1. Pingback: this site

  2. Pingback: paczki dla dzieci

  3. Pingback: paczki dla dzieci

  4. Pingback: this site

  5. Pingback: this site

  6. Pingback: musicas para ouvir

  7. Pingback: make money online

  8. Pingback: CHLAMYDIA SYMPTOMS

  9. Pingback: The River rancho mirage

  10. Pingback: click here

  11. Pingback: make money from internet

  12. Pingback: click

  13. Pingback: Amazing Reptiles

  14. Pingback: ogrzewanie

  15. Pingback: ogrzewanie

  16. Pingback: ogrzewanie

  17. Pingback: herbata

  18. Pingback: herbata

  19. Pingback: ogrzewanie

  20. Pingback: herbata

  21. Pingback: ogrzewanie

  22. Pingback: trade forex online

  23. Pingback: cialis

  24. Pingback: viagra

  25. Pingback: viagra

  26. Pingback: buy cialis

  27. Pingback: valium

  28. Pingback: viagra

  29. Pingback: cheap viagra

  30. Pingback: cialis

  31. Pingback: Viagra Online Without Prescription

  32. Pingback: dj imprezy łuków

  33. Pingback: ceny paliw

  34. Pingback: adipex

  35. Pingback: klonopin

  36. Pingback: viagra online without prescription

  37. Pingback: levitra

  38. Pingback: cheap cialis

  39. Pingback: buy cialis

  40. Pingback: cialis online