What is the proper way to update a server once the public and private IP have been changed? This is a common scenario when restoring a snapshot (or upgrading an instance) on AWS Lightsail. The snapshot restores to a new instance where a new public IP AND private IP are given to the system. A static IP can be migrated over to the new instance, but that still leaves the new private IP in a NAT configuration needing to be updated.
My current steps I've learned from trial and error consist of:
1. Changing the public IP in "Basic WHM Setup" to the correct public IP
2. Running /scripts/build_cpnat
3. Running /scripts/rebuildhttpdconf
4. Running /scripts/restartsrv_apache
5. Then going to "Manage AutoSSL" and running “Run AutoSSL For All Users”
But even then, i'm not always successful in getting it to load the sites properly. Last night I did those steps, even tried the IP Migration Wizard and got into an even weirder situation. Where on the Accounts List page, it showed the right IP. But on the IP Migration Wizard it showed the old private IP. And if I tried to change an individual account's IP it said it was already changed to the new public IP. Eventually I ran through as many internal DNS/IP files I could find ( /var/cpanel/cpnat, /etc/hosts, /etc/ips.dnsmaster, /var/cpanel/mainip, /etc/userdatadomains ) to verify it was correct and updated. I tried /scripts/rebuildippool, /scripts/cleandns, and /scripts/fixvaliases with no luck. Eventually running /usr/local/cpanel/scripts/updateuserdomains fixed the IP Migration Wizard screen. And yet, the sites still wouldn't load.
So here I am, asking what is the recommended procedure to get a cPanel server running CentOS 7, to change it's private and public IP addresses and get the sites running as quickly as possible. Thanks
My current steps I've learned from trial and error consist of:
1. Changing the public IP in "Basic WHM Setup" to the correct public IP
2. Running /scripts/build_cpnat
3. Running /scripts/rebuildhttpdconf
4. Running /scripts/restartsrv_apache
5. Then going to "Manage AutoSSL" and running “Run AutoSSL For All Users”
But even then, i'm not always successful in getting it to load the sites properly. Last night I did those steps, even tried the IP Migration Wizard and got into an even weirder situation. Where on the Accounts List page, it showed the right IP. But on the IP Migration Wizard it showed the old private IP. And if I tried to change an individual account's IP it said it was already changed to the new public IP. Eventually I ran through as many internal DNS/IP files I could find ( /var/cpanel/cpnat, /etc/hosts, /etc/ips.dnsmaster, /var/cpanel/mainip, /etc/userdatadomains ) to verify it was correct and updated. I tried /scripts/rebuildippool, /scripts/cleandns, and /scripts/fixvaliases with no luck. Eventually running /usr/local/cpanel/scripts/updateuserdomains fixed the IP Migration Wizard screen. And yet, the sites still wouldn't load.
So here I am, asking what is the recommended procedure to get a cPanel server running CentOS 7, to change it's private and public IP addresses and get the sites running as quickly as possible. Thanks