Cloning to new AWS Instance - IP Problem...

JohnnyBgood

Member
Feb 6, 2015
20
0
51
cPanel Access Level
Root Administrator
Hi all,

I got my centos 7 - WHM server all set up - its running great, so i take an AIM / A clone of my server. Let's say the ip address is 1234

When i put the clone onto a new IP address: 5678

The clone is messed up - it still thinks it is on 1234. I changed Home » Server Configuration » Basic WebHost Manager IP address.

and the IP address in the DNS records - but this does not seem to be enough.

I can access whm at 5678:2087 - But going to http://5678 does not show the site - it shows the whm message about configuration problems.

Thanks so much for any help!

I want to end up with 2 whm setups running - identical in their setup, on different IP addresses.
 

JohnnyBgood

Member
Feb 6, 2015
20
0
51
cPanel Access Level
Root Administrator
Hi, i did the following:

1. Home » IP Functions » IP Migration Wizard
2. Home » Server Configuration » Basic WebHost Manager
3. Home » DNS Functions » DNS Zone Manager
4. ifconfig -a (Result is fine - it was updated by aws i asume)

In my whm - everything looks fine, i cannot see any reference to the old IP, the cpanel licence is valid.

The issue is when I go to the http://5678 - i get the SORRY! /cgi-sys/defaultwebpage.cgi

The only other thing i see, is in: Home » SSL/TLS » Manage SSL Hosts, On the working server - it says " Is Primary Website on IP Address? " YES, and on the clone, it says: " Is Primary Website on IP Address?" NO

But everywhere I look - the new IP is found (including the new internal IP for the instance)

Thanks again for any help!
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
630
205
343
cPanel Access Level
DataCenter Provider
Everything you described sounds like the correct steps. I'd suggest just opening a cPanel support ticket. That will more than likely be a lot quicker resolution than we we can offer here.
 
  • Like
Reactions: JohnnyBgood

JohnnyBgood

Member
Feb 6, 2015
20
0
51
cPanel Access Level
Root Administrator
Thanks! The ticket number was #94104525 and Anthony managed to resolved the issue for me.

He couldn’t find the reason for the problem, but he did give me the steps he took to fix the issue.

For anyone else that may have this issue in the future, these are the steps:

What I did is run the following steps to re-migrate the internal IP and make sure that it was configured properly.

  1. Run IP Migration Wizard
  2. Use the internal IP in the "new IPs" box
  3. Click Continue
  4. Confirm that "Old IP" is the incorrect external IP that Apache is configured for, and that "New IP" is the correct internal one it should be using
  5. Click Continue
  6. Click Continue on the "modify your servers’ configuration files" page
  7. The wizard should now have output that the Apache and cPanel config files were updated correctly, however DO NOT click continue on this page as it will modify the DNS if you do.
  8. Since the cPanel configuration is now correct, we can rebuild Apache with /scripts/rebuildhttpdconf to use the internal IP in Apache
  9. Now we need to abort the IP Migration Wizard as it will otherwise try to continue from where you left off
  10. To fully abort, ensure the following files are removed from the system:
  • /var/cpanel/ipmigrate
  • /var/cpanel/useripmigratemap
  • /var/cpanel/ipmigscrip
  • /var/cpanel/ipmigratelock
  • /var/cpanel/postipmigrate


Completely beyond what I would have ever thought to try! I’ve got to try and repeat the process now to setup our 3rd instance for our 3 servers to use aws elastic load balancing.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
630
205
343
cPanel Access Level
DataCenter Provider
And now that you have given all the details, it makes more sense. I've only dealt with LightSail instances (but I assume all of Amazon is like this) and the VPS's appeared to only have private IP's with some sort of NAT or firewall in front of them.
 
  • Like
Reactions: JohnnyBgood

jaxtheking

Registered
Nov 21, 2019
3
0
1
Belfast
cPanel Access Level
Root Administrator
I just followed the procedure here and I can confirm it worked perfectly.
Upon inspection, I did find the old private IP still showed in the following files:
  • etc/hosts
  • etc/ips.dnsmaster
  • var/cpanel/cpnat (the IP was also incorrect in the 'Show or Delete Current IP Addresses' table in WHM)
I believe ips.dnsmaster is no longer being used.
I run /scripts/build_cpnat to correct the cpnat file and manually edited the hosts file.

Was this necessary? Everything seemed to work already, but I'd appreciate your advice.
 

jaxtheking

Registered
Nov 21, 2019
3
0
1
Belfast
cPanel Access Level
Root Administrator
If I may make one remark... with the rise in popularity of hosting cPanel on Amazon Lightsail, I'm ready to bet quite a lot of people is or has struggled with this task.
Never mind adding a feature to WHM which handles this task but at least it'd be great to see an article on the cPanel Support microsite which quickly details the steps to fix the internal IP after cloning an AWS instance.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,418
1,000
313
cPanel Access Level
Root Administrator
The problem with that is that we don't have control over the AWS side of things, so we wouldn't get a notification if the process changes, nor do we have a way to confirm the process would work for all users and environments.
 
Thread starter Similar threads Forum Replies Date
S Installation & Updates 5
N Installation & Updates 1