Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Moving servers! :(

Discussion in 'General Discussion' started by dominet, Nov 5, 2002.

  1. dominet

    dominet Active Member

    Joined:
    Mar 23, 2002
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    301
    Moved servers to another datacenter. Whats the easiest way to change all the ips inside httpd.conf and all dns zones ips?
     
  2. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    316
    This is what I do if I am changing a handful of IPs:

    [b:ddf58cc138]For httpd.conf:[/b:ddf58cc138]

    # cd /usr/local/apache/conf
    # cp httpd.conf cp httpd.conf.backup [backup httpd.conf]
    # perl -p -i.bu -e &s/xx1.xx1.xx1.xx1/xx2.xx2.xx2.xx2/g;& *.conf [assuming httpd.conf is the only .conf file in that folder; repeat this step for each IP you want to change]
    # rm -Rf *.conf.bu

    xx1.xx1.xx1.xx1 = Old IP address
    xx2.xx2.xx2.xx2 = New IP address

    [b:ddf58cc138]For the zone files:[/b:ddf58cc138]

    # cd /var/named
    # cp -a ./ ../named-backup [backup the named folder]
    # perl -p -i.bu -e &s/xx1.xx1.xx1.xx1/xx2.xx2.xx2.xx2/g;& *.db [Repeat this step for each IP you want to change.]
    # rm -Rf *.db.bu

    It takes just a few seconds to change each IP.

    Norman
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice