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.

Changing the server IPs

Discussion in 'cPanel Developers' started by welo, Sep 20, 2007.

  1. welo

    welo Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Here's one I haven't encountered before: Changing the IP block of a box midstream, and with a new subnet mask. Kinda been plodding around here piecing together info from a few non-related threads (like here). Any advice?
     
  2. tprice42

    tprice42 Active Member

    Joined:
    Sep 10, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    I had to do this about a year ago and while it might look like a daunting task it's not too bad really.

    * Get the new IP block assigned and allocate it on the server is the first step.
    * Change the default IP address in 'Basic cPanel/WHM Setup' in WHM
    * Then edit your /usr/local/apache/etc/httpd.conf and change all the <VirtualHost $old ip address$> to <VirtualHost *>. This will mean that the websites hosted on your server will respond to any ip address on the machine, restart apache and check to make sure everything is still working. If not then check the 'NameVirtualHost $old ip address$:80' line in your httpd.conf, it might have to be changed to 'NameVirtualHost *:80'
    * Then change the DNS records for all hosts, keep an eye out for hosts that don't use your local DNS server because you'll need to get your clients to change those manually. Remember to update your serial numbers and restart named when finished.
    * Wait till all your dns records migrate out to the internet (generally within 24H but it's probably safer to wait for up to a week as some ISP's ignore DNS refresh times) and then change your /usr/local/apache/etc/httpd.conf and make all the <VirtualHost *> entries to <VirtualHost $new ip address$>

    You should be done after that and the best thing is that it's risk free if you're thorough and check everything as you go.

    $old ip address$ and $new ip address$ are old references to your old and new ip address, it is not actually written like that in the files.
     
  3. welo

    welo Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the response. Thinking back, this did happen to me several years ago when I had to swap out IP blocks on a new box because the previous holder was running porn or warez sites or something and the IPs were blacklisted by everybody. It's just a little tough to remember what I did.

    This was sent to me by a guy at my NOC, but it's several years old and mostly concerns moving from one box to another:

    ==================================
    Cpanel Migration Instructions
    ---------------------------------------
    #1: Add the new ips to your server. Menu --> IP Functions --> Add a New IP Address
    #2: Verify they are pinging
    #3: Change your private name server ips to the new ips of the server (This is done at your domain registrar)
    #4: Wait 48 hours.
    #5: Back to WHM. Change main shared ip to new ip address. Menu --> Server Setup --> Edit Setup. Main Shared Virtual Host IP: (put in new even numbered base ip)
    #6: Contact VN support to have your base ip moved on the server. Please include the original email that was sent out and the root password on the system.
    #7: Once you get an email back from support and the ip transition has been complete, it's time to start moving websites. Back to WHM. Menu --> Account Functions --> List Accounts. Click on the little icon next to the ip. You will want to change the drop down to the new ip address. (Either new main shared or dedicated ip.)

    ALT#7: An alternative to #7 is using this migration util. It is NOT in production yet, but you can try it out. Menu --> IP Functions --> IP Migration Wizard (RC2)

    Once all this is done, verify your sites are working and that should be it. If you waited the 48hours in step #4, all the websites should be showing up.

    #8: Verify that old ips are not on system anymore. Menu --> IP Functions --> Show or Delete Current IP Addresses.
    ==================================
     
  4. welo

    welo Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Well, looks like I got it working, with one curiosity: I took your advice and adjusted httpd.conf to
    Code:
    <VirtualHost *>
    for all site entries, and by the time I was done adding A entries and restarting everything they all looked like
    Code:
    <VirtualHost $new_ip_address$ *>
    (with the asterisk on the end). Now if I go back in and remove all those asterisks and restart Apache & BIND, there's one site that just won't work. I get that blue cPanel splash screen. Not sure what that's about but if I leave the asterisks in it works fine.
     
Loading...

Share This Page