In managing servers you always come across something that is not the way you want it. The admin before me used 1 IP address per domain, which would be fine, if there was a need for that. The reason behind that was to reduce competitor spying, but having 30 sites on their own IP address that aren’t doing anything is pointless.
Using CPanel it is not easy to take a site that has a dedicated IP and move it to a Reseller account and use the new IP address. Sure you can reassign it to a new Reseller, but the IP is a different matter. I found that I had to do a combination of CPanel commands, and then some manual (shell) stuff.
I am assuming that you are familiar with editing server config files and do not offer command line suggestions on how to do that.
If you are not familiar with shell commands, GET SOMEONE ELSE TO DO IT – I’M NOT RESPONSIBLE FOR YOUR SERVER.
Lets assume that we are moving domainum.com from a dedicated site and Ip to a Reseller account under primary.com
Step 1
Make sure that primary.com is a reseller.
Home >> Account Functions >> Modify an Account
Make sure that primary.com has a dedicated IP, remember or write down this IP you will be using it multiple times in the next few minutes.
Home >> Resellers >> Manage Reseller’s main/Shared IP
Select the IP and Save.
Also make sure that they can modify DNS entries for its reseller accounts:
Home >> Resellers >> Edit reseller privileges & nameservers
Step 2
Restrict IP’s to primary.com. This may not be needed, but since we are forcing domains to a specific account lets make sure they should be there.
Home >> Resellers >> Manage reseller’s main/shared IP
and check that primary.com has the IP delegated:
Home >> Resellers >> Manage reseller’s IP Delegation
Step 3
Change the ownership of domainium.com to primary.com:
Home >> Resellers >> Change ownership of an account
Step 4
Login to CPanel of primary.com:
https://www.primary.com:2083/
and select domainium.com from the drop down. Then select the Advanced DNS Zone Editor icon.
Edit the IP address to match primary.com.
Step 5
Log on to server and check:
/etc/domainips
for an instance of domainium.com, if there is one delete it or comment it out.
Step 6
Edit the apache config file httpd.conf:
/usr/local/apache/conf/httpd.conf
Look for the VirtualHost listing for domainium.com and change the IP address to that of primary.com.
Step 7
Check your work:
/usr/local/apache/bin/apachectl configtest
If there are no issues, restart Apache:
/usr/local/apache/bin/apachectl restart
Step 8
Modify the IP references for domainium.com in:
/etc/userdatadomains
and /etc/proftpd.conf (this depends on your config)
Step 9
Update CPanel so it doesn’t overwrite your changes:
/usr/local/cpanel/bin/apache_conf_distiller –update
and then
/scripts/rebuildhttpdconf
If everything worked comment below.