Amazon Ec2 Fixing Cpanel IP after restore from snapshot

On an Amazon EC2 server running Cpanel, i had to restore from Snapshot as some data was missing. Once restored, i changed Elastic IP to new EC2 instance. But sites did not work. This is because Internal IP of EC2 instance got changed when you restore from snapshot.

In httpd.conf VirtualHosts where using old internal IP But this IP was no longer available in the server, new Internal IP was

Check if sites are still using old internal IP address

To change IP, you need to do the following

WHM >> Home >> Multi Account Functions >> Change Multiple Sites’ IP Addresses

1. Select all the accounts showing for the current ip
2. Select “Change IPs of Selected Accounts”
3. In the New Address dropdown, you would select the External IP for all the accounts
4. Select Change IPs

In Change Multiple Sites’ IP Addresses, drop down listed (Elastic IP Address) and I selected for all sites and is working fine now.

Now rebuild httpd.conf file with

See Cpanel Server Behind NAT (Amazon AWS), Cpanel Server