View Single Post

  #4 (permalink)  
Old 07-22-2007
sean dreilinger
 
Posts: n/a
Default Re: How to Re-direct to a Different Web Server

hi Ross:

Ross wrote:
> I have a existing Apache web server for my company www.company.com with the
> IP of 100.100.100.100.
> Now, I am planning to move it from an ISP to another, so it's IP address has
> to be changed, and it would be 200.200.200.200.
> To zero the downtime, I'd like to set up a new server at the new ISP with
> the new IP, and keep the old server at the current ISP for a while and
> forward its access to http://200.200.200.200.
> The question is how to set up the forwarding/redirection on the current
> Apache, and it won't change the address in the browser's address field?


if i understand what you're asking, success depends as much on what you do with
your DNS configuration as your apache setup. to switch from ISP.old to ISP.new
with a minimum of disruption, try this:

1. reduce the dns refresh time on the company.com zone and ttl on the
www.company.com resource record to 5 minutes. if your existing ttl/refresh is 8
hours, you need to do this at least 8 hours before the move. i would do it well
in advance so that you don't have to worry about it.

2. prepare your website at ISP.new and configure apache to recognize and accept
traffic for www.company.com

3. once the DNS ttl has propagated (hours or days after you've set it to 5
minutes), change the IP address of www.company.com in DNS from ISP.old to
ISP.new. most traffic will switch and start landing at ISP.new within 5 minutes.

4. you can now safely assume that traffic arriving at ISP.old is ignoring DNS.
after examining the nature of the traffic, you can drop it altogether (just turn
off the old server if the traffic looks like robot noise), or if the remaining
traffic looks legitimate, you can set the apache at ISP.old to redirect any/all
traffic to ISP.new. in httpd.conf at ISP.old:

RedirectMatch permanent ^/(.*)$ http://www.company.com/$1

which would hopefully force clients who have cached your IP to do a fresh
lookup. if you really want to keep all of your bot traffic and whatever else is
not properly respecting your DNS entry, you can redirect any/all traffic to the
IP of your machine at ISP.new, like this:

RedirectMatch permanent ^/(.*)$ http://200.200.200.200/$1

i doubt this will net you any human traffic of value, it will just increase
robot noise on your new server.

5. restore your dns refresh/ttl to a more reasonable duration, allowing clients
to cache your zone information for hours or days.

--sean

--
sean dreilinger - http://durak.org/sean/