Setting Default Domain Per IP Address On CentOS + Apache

We recently purchased a new server through GoDaddy with their “Simple Control Panel”.

My predicament is that I’ve 3 IP’s and 50+ domains on the box. There is no “preview domain” feature allowing me to see a development setup on the box before switching over the DNS so the whole world can see if there is problems with the migration.

If I have IP address 12.123.12.123 which points to my server and automatically brings up “domain1.com” and I would rather it bring up “domain2.com” when you visit the IP - how is this accompished? I looked in httpd.conf and couldn’t find what I was looking for.

In PLESK this is easy as going to the IP addresses tab - clicking the “hosted domains” link under the appropriate IP and then checking the “default domain” radio box.

Any help is appreciated.

Thanks

Use your hosts file (e.g on windows, edit /windows/system32/drivers/etc/hosts)
to resolve the domain to the IP.

Once you’ve set that (remember to remove the entry later) as long as the server has a virtual host set up in apache for the domain, you’ll be able to preview it.

EastCoast - thanks for the comment but I’m working on CentOS (Linux). Sorry I didn’t specify before.

The hosts file I’m referring to is on the desktop, not the server.