Renumbering IPs on a Cpanel server

bert

Well-Known Member
Aug 21, 2001
602
0
316
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.
 

cbingham

Active Member
Aug 14, 2001
31
0
306
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....
 

bert

Well-Known Member
Aug 21, 2001
602
0
316
Yes indeed. No one appears to want to give us pointers here :(
 

feanor

Well-Known Member
Aug 13, 2001
836
0
316
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
 

bert

Well-Known Member
Aug 21, 2001
602
0
316
Thanks very much feanor. I guess you are the only good samaritan aroud here, with the exception of Nick, of course ;)
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
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.
 

bert

Well-Known Member
Aug 21, 2001
602
0
316
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
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
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?
 

bert

Well-Known Member
Aug 21, 2001
602
0
316
Yes indeed. The DNS records I changed manually. ;)
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
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.
 

bert

Well-Known Member
Aug 21, 2001
602
0
316
Cool :p