-1

I have to migrate all sites from a server to another. The actual apache2 server configuration is a virtual host for each site and this is working. My problem is that I want to migrate all sites to the new machine, test that everything is working then change dns. So by now I have only a machine with a public IP no domain associated, how can I configure apache2 to run multiple server on a machine like this?

1 Answers1

0

If all the virtual hosts are without SSL, you could connect the server with nc or telnet and test

HEAD / HTTP/1.1
Host: example.com

(or even GET) for every host needed and see whether you got the correct response. I'm using this since I find it easiest, but probably most would like to experience this with a browser.

To be able to test with a web browser you could add there hostnames to your local configuration hosts file. Just add a line for every hostname you want to test, e.g.

192.168.0.1      example.com
192.168.0.1      example.net
192.168.0.1      example.org

The location of the hosts file varies and you must flush dns cache afterwards.

  • Linux & similar: /etc/hosts
  • Windows: C:\Windows\System32\drivers\etc\hosts & restart dnsclient service after
  • Mac OS X: edit /private/etc/hosts & reload with dscacheutil -flushcache
Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129