Multiple shared IPs in WHM
Ever wondered how to set up multiple shared IPs in WHM? Here is how.
You can’t add multiple shared IPs in WHM GUI, but it’s possible to do so via SSH (login as root).
First, you need to create a /var/cpanel/mainips/ directory, if it doesn’t exist:
mkdir /var/cpanel/mainips/
Then, create a /var/cpanel/mainips/root file, with the following content:
1.2.3.4 3.4.5.6
Basically, each line is an additional shared IP in WHM. That’s it!
Thanks, this actually saved me a ton of time and effort.
I’ve been searching for a way to do this for hours now.
This is a neat trick! The IP address did show up and allow me to select it but once I hit the “Change” button it gave me:
Sorry, IP is in use by another domain name and is not a shared ip.
After about an hour of searching online, this solved the problem. The secondary IP was locked and reserved as if it was dedicated to another domain, but it was assigned to nothing. I took your advice, made that IP one of the “shared” ones, rebuilt (/scripts/rebuildhttpdconf), assigned the domain to that IP, then deleted that new mainips/ folder, rebuilt again, and the domain is now dedicated to the second IP!
Thanks!