How to change the WHM/cPanel main IP address [cPanel/WHM: List Account shows the incorrect IP]

If you can't change the ip for some user account in usual way (WHM->List account -> Ichange sites IP address.)

This issue can occur after migration for example. We assume that  httpd.conf contains actual IP's. So it's only "display"  issue.



The best way to set  IP  is using WHM feature "Change IP" under corresponding cpanel account. Just expand account features:

WHM Change cpanel account

Just select proper IP from the list.

If you have  changed the main WHM/cPanel server IP and can;t find this under the IP lists. You need to set this new IP in the main WHM server settings:
Go to Server Configuration-> Basic cPanel & WHM Setup  and set new ip in the IP address filed " The IP address (only one address) that will be used for setting up shared IP virtual hosts.":
WHM MAIN IP


That's all. For sure you can restart httpd service with "service httpd restart" from SSH, but usually it's not necessary.

-------------------------

Alternatively you can check /edit the config files on the serever. or use commands to set ip like described below.
Here is the conf files you should check and change the IP on actual:

 /var/cpanel/users/<username>   // change under the "IP=" line

 /var/cpanel/mainip 

/etc/userdatadomains

 

After you have checked all files and made changes where it was neccessary you should update database cache. Run next commands:

/scripts/updatedomainips
/scripts/updateuserdatacache
/scripts/updateuserdomains
/scripts/update_db_cache

 

Also you need to check the <VirtualHost> directive in Apache httpd.conf file and set correct IP's there.
Note that cPanel could rewrite the httpd.conf so your changes will be lost . do not edit this files if you not sure.

Was this answer helpful?

 Print this Article

Also Read

cPanel/WHM: error "Sorry, you are not allowed to add any more than (0) parked domains!"

If you face the next issue with cPanel: "Sorry, you are not allowed to add any more than (0)...

Virtualmin

Virtualmin is a Webmin module for managing multiple virtual hosts through a single interface,...

mySQL (phpMyAdmin) error : This table does not contain a unique column

If you face this error in phpMyAdmin and you can't change/edit the table fields. If you sure you...

DirectAdmin License update \ip change

DirectAdmin will not be running, as the license file will be invalid. Get the new license file...

Vesta panel

Vesta is a Simple & Clever Web Hosting Control Panel. All the details can be found at the...

Powered by WHMCompleteSolution