Introduction
We highly recommend consulting with your network or system administrator prior to making any changes, as failing to configure the interface correctly can result in an unreachable server. Ensure that you have console or other out-of-band access to the server before attempting to make any of these changes. cPanel Support is unable to assist with making any of these changes.
cPanel utilizes the IP address assigned to the network interface. cPanel has no supported way to reconfigure the network interface from with WHM or via the API. We strongly encourage you to reach out to your system administrator or network team to assist with making changes to the network configuration. To change the primary IP, you must be familiar with running commands on the command line and using a command-line text editor.
Procedure
- Log into WHM as the 'root' user.
- Navigate to "Home / Server Configuration / Basic WebHost Manager Setup."
- Change the IP address set for "The IP address (only one address) that will be used for setting up shared IP virtual hosts" to the new IP address.
- Access the server's command line as the 'root' user via the server's remote console or out-of-band SSH.
- Edit the server's network configuration to replace the old network configuration with the new network configuration.
Please note that the specific file or files to be updated depend on the OS the server is running and the network service running on the server. - Run the
/scripts/mainipcheck
script to update the main cPanel IP address. - Run the
/scripts/fixetchosts
script to update the /etc/hosts file. - Restart the network service.
Please note that the specific command to restart the network service depends on the OS the server is running and the network service running on the server. - Run the
/scripts/build_cpnat
script if your server is configured for NAT. - You will likely get disconnected at this time and will need to log in again via the new IP address.
- Run the
/scripts/restartsrv_ipaliases
script if your server has additional IP addresses added through the "Home / IP Functions / Add a New IP Address" interface in WHM. - Run the
ifconfig
command and verify that the correct information is shown. - Once the new IP is correct in your network configuration, make sure your license is updated to continue using WHM:
How do I transfer my cPanel/WHM license to another IP address? - Verify you can log in to WHM.
- Review the following article to ensure all other services and websites are brought up to speed on the new IP:
What to do after the cPanel license IP has changed
It is important to note that if you have previously installed mod_remoteip to show original IP addresses to your Apache logs due to proxy connections, you will need to adjust your Apache configuration to match the new server IP by following the instructions below:
Restoring visitors IP with mod_remoteip
Comments
0 comments
Article is closed for comments.