cPanel Hosts should automatically figure out private and public IPs on cloud environments
cPanel and WHM has been being deployed succesfully on Cloud environments like AWS where it has a 1:1 NAT configuration for quite some time, however it is not without "some assembly required" after you've got a spawnable image template saved.
As of now, there are two files that must be modified manually or via other script the user supplies (cloud config on AWS) to 'fix' invalid configurations on templates you've saved for valid cPanel installations.
This is due to these files having the saved configuration for the machine you made the template with. Any subsequently created cPanel accounts, of course, will then have invalid shared IP records.
Now, in any configuration where the license check works, your NAT Public IP should correspond to the IP cPanel has on record as the licensed IP. As such, when one runs /scripts/mainipcheck, you'll see a warning about an 'invalid configuration' even though it correctly detected your NAT IP and the Private IP bound to the networking device.
It would be nice if:
- This script actually offered to fix this for you to save time.
- Some tweak setting like 'Automatically check and fix NAT & Main IP configuration issues on boot' existed that you could just set on the cPanel host you intend to turn into a template for your cloud environment then have it automatically fix this for you on boot (optionally? notifying the server admin about this).