The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using IP forwarding to transfer websites to avoid downtime

Discussion in 'General Discussion' started by opaque, Jan 20, 2006.

  1. opaque

    opaque Registered

    Joined:
    Mar 12, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    The senior tech of my host when asked to transfer websites without downtime, he does it beutifully using some IPforward method altering some settings in ipalisases or iptables.

    The only criteria is, the domain to be transfered must have dedicated IP.

    If anyone has any idea how this is done, please share it..
     
  2. elliotcooper

    elliotcooper Well-Known Member
    PartnerNOC

    Joined:
    May 18, 2005
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    By far the easiest method that I have found for setting up IP forwarding is to use a package called rinetd. This will only forward TCP packets and you have to list every port that you want forwarding in the conf file but it is *way* easier than using IP tables.

    First you need to install rinetd on the old server that you want to do the forwarding. This should be available via your package manager like yum . Once you have installed you need to edit the conf file e.g.:

    nano -w /etc/rinetd.conf

    The format for setting this up is super easy, say the IP on the old server is 1.1.1.1 and the IP that you want to forward to is 2.2.2.2 and you want to forward requests on port 80 then the config line would look like:

    1.1.1.1 80 2.2.2.2 80

    if you also want to add 110 and 25 then extend it to:

    1.1.1.1 80 2.2.2.2 80
    1.1.1.1 110 2.2.2.2 110
    1.1.1.1 25 2.2.2.2 25

    You can add as many as you need. When your done adding config just run:

    /etc/init.d/rinetd restart

    and your good to go. Any requests to the specified ports on the old IP will get forwarded to the specified port on the new IP address.
     
  3. AdminWAY

    AdminWAY Member

    Joined:
    Feb 15, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I have found simply forwarding the IP via named works fine, haven't had a problem with that at all.
     
  4. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    You dont need any skills to avoid downtime for any site transfer, if you have full controls on it.
    The easiest way is to first transfer the site on to the new server and check it by http://IP_address/~username & just go and change the NameServer for that domain, having your site working on both the servers

    Now people to whom your is DNS is propagated will see the site on new server and to those unpropagated will see the site on the old server. And finnally when DNS propagate all over you can remove it from old server.... insn't that easy.
     
  5. elliotcooper

    elliotcooper Well-Known Member
    PartnerNOC

    Joined:
    May 18, 2005
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Leaving two instances of the site live is OK as long the site is not generating any data i.e. live databases, forums etc, you don't mind collecting mail from two locations for a while, you can set up two accounts with your secure payment provider, your not serving DNS from it etc etc etc. If it is doing anything more than serving some static content then I wold not reccomend leaving two instances live.
     
  6. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    In this case you can just change the A record in the DNS of the old server to point to the new server..
    and thanks elliotcooper, as I completely missed that.
     
  7. elliotcooper

    elliotcooper Well-Known Member
    PartnerNOC

    Joined:
    May 18, 2005
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    I'm not sure why updating a DNS record on the old server will help at all. If it is an authorative nameserver then you simple get the same caching problem that generated this problem in the first place. If it is not an authorative nameserver then it will make absolutely no difference to the fact that mail/web etc requests are ending up at the old server. The requests will get served as normal and lead to the duplicated site problems. If you need these erroneous requests forwarded to the new server then you should see my origional post....
     
  8. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    set TIME TO LIVE (TTL) to 60 seconds before the migration !!!

    The best method is use RINETD... immediately traffic is rerouted, while DNS propergation is taking place to the new server.

    That way you wont have 2 servers with inconsistent data

    :)
     
  9. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Nice idea. Only caveat seems to be (other than elliotcooper's mention of being for TCP only) that rinetd won't forward ftp traffic.
     
Loading...

Share This Page