First off, thanks for any help anyone can provide. I'm definitely stuck on this one and can't seem to figure it out myself.
I've got a bit of a unique (at least I think so!) situation that I'm hoping someone can shed some light on. After suffering a massive failure during a hosting company move, I decided to take my online webserver destiny into my own hands. I've got two idential systems, both running Red Hat Enterprise Linux ES release 4 (Nahant Update 5) and Plesk 8.2.0 with all of my domains on them. The drive from the first system was DD'd to the second system, so they are identical in every way. One is at my new hosting company, and I have one in-house as a backup.
Here's my issue:
On my primary box, I've got it set to copy all of the files nightly and update them on my backup server. This all works great to keeps my backup server up to date as an exact clone. The only problem lies in the IP address routing.
On my primary online box, I've got sites running on the following IP addresses (just for example, not the "true IP's"):
74.123.123.111
74.123.123.222
The network connection to my backup box actually has the IP's of:
192.168.123.245
192.168.123.246
These are virtual sites on the IP's. So, if I go to access my primary box at my hosting company, I can type in
www.example.com and it translates to the right IP on the box and makes the connection.
If I go to access it on my in-house "backup" server, it doesn't work (I've added
www.example.com 192.168.123.245 to my windows hosts file for this test) - I do see the "default" page for the IP itself though. So, I am able to access the web server, but the address translation doesn't take place properly to get me to the right virtual site on the internal IP.)
I know that I can go into the Plesk panel and change each and every sites IP address to the 192.168.123.245, but that's not a good solution since I've got hundreds of sites and each night box is being overwritten again with the "fresh" data including the server companies IP addresses.
Is there any way that anyone knows of where I can do something perhaps with the ROUTE command or other system I can automated with a perl script to make it so that on the backup system, anyone that goes to
www.example.com (or whatever domain) on 192.168.123.245, it will translate and forward it to the what the in-house box thinks is 74.123.123.111.
Hopefully this makes sense what I'm looking to do. Again, I'm not sure if I can do this with the ROUTE command, or the IP TABLES, or even if it's possible. Any suggestions will be greatly appreciated!
Here's my current ROUTE table (192.168.123.254 is the gateway that this backup box is plugged into):
192.168.123.0 * 255.255.255.0 U 0 0 0 eth0
192.168.123.0 * 255.255.255.0 U 0 0 0 eth1
10.100.0.0 * 255.255.0.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.123.254 0.0.0.0 UG 0 0 0 eth0