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.

Renumbering IPs on a Cpanel server

Discussion in 'General Discussion' started by bert, Feb 15, 2002.

  1. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    We need to renumber all the IPs on 2 Cpanel servers. One of them is our primary DNS server.

    Any suggestions on how to do it? Will changing the IP for eth0 and then changing the IPs for the account in /etc/httpd/conf/httpd.conf and in /etc/proftpd/proftpd.conf do the trick? Is there anything else I need to know?

    Thanks very much, your comments, recommendations, etc are highly appreciated.
     
  2. cbingham

    cbingham Active Member

    Joined:
    Aug 14, 2001
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Vancouver, BC, Canada
    Same Question

    I asked the same question the other day and didn't get much of a response.

    EVERYONE: This is an important matter. We need your help. Please respond with any information you have.

    Thanks in advance....
     
  3. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Yes indeed. No one appears to want to give us pointers here :(
     
  4. feanor

    feanor Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    836
    Likes Received:
    0
    Trophy Points:
    16
    You should be able to script this-
    Have something crunch /etc/proftpd.conf , /etc/httpd/conf/httpd.conf , /var/named , and... hmmm, those are the only areas that I can think of that are connecting to services that bank on IPs in their configuration....
    get a script that opens those files, does a search/replace against a flat text file of your incoming (new) IPs, and swaps the old for the new.

    You'll need to pay attention to /etc/hosts , your cpanel licensing config because eth0 will be changing.... otherwise, I think you nearly have everything covered.


    Make sure your base hostname is still resolving correctly to the base IP (eth0), whatever it is changing to!

    g00d luck
     
  5. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Thanks very much feanor. I guess you are the only good samaritan aroud here, with the exception of Nick, of course ;)
     
  6. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Bert, did you have to change anything else in addition to what Feanor suggested when you had to renumber your IPs? I'll be doing the same early next week and I'd appreciate your input.
     
  7. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Ni moronhead. Just follow these steps and you will be fine guaranteed :p


    1. Change /etc/ips to the new IPs. The new eth0 address should not be included in this file.

    2. Change eth0 to new system IP, subnet and router address.

    4. Change IPs in /etc/httpd/conf/httpd.conf

    5. Change IPs in /etc/proftpd.conf

    6. Run the following commands:
    /scripts/updatedomainips
    /scripts/updateuserdomains
    /scripts/ftpupdate
    /scripts/rebuildipaddrpool

    7. Edit /etc/wwwacct.conf to switch the old eth0 for the new

    8. Change IP inside of /etc/hosts

    9. Adjust /etc/resolv.conf

    10. Run /usr/local/cpanel/cpkeyclt

    11. Restart all services or reboot
     
  8. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Thanks, that's extremely helpful. I had a sneaky feeling that there was more to renumbering IPs than just replacing them in httpd and proftpd.

    Did you have to change the IPs in the DNS records manually?
     
  9. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Yes indeed. The DNS records I changed manually. ;)
     
  10. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Bert, thanks again.

    I'll try to write a script to replace the IPs in /var/named and httpd.conf as Feanor suggested. If the script works correctly I'll post it on here if needed.
     
  11. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Cool :p
     
Loading...

Share This Page