Assign Multiple IP Addresses on One Account
- Written by Vanessa Vasile
- Published in Apache, Hacks, Networking
- 9 Comments
- Permalink
By default, cPanel supports the usage of one dedicated IP per account. However, you can get around this by editing just a few files on the server. Here are the steps:
1. Edit /var/cpanel/userdata/$user/$subdomain.$maindomain for each subdomain (for addon domains you’ll usually edit the file for the subdomain associated with the addondomain) and change the ip value to a ‘dedicated’ ip.
2. Delete the associated .cache file for the file you just edited
3. Run /scripts/rebuildhttpdconf
4. Edit the dns zone for the subdomain (which will likely be attached to the parent domain) and update the a-record to point to that IP as well. Then syncronize the zone out to the DNS cluster, if one exists:
/scripts/dnscluster synczone <parentdomain>
5. Edit /etc/domainips and add an entry for that sudomain to point to the IP and run /scripts/rebuildippool to make sure the IP is marked as taken.
9 Comments
Hey, Thanks for the post. I can’t seem to get the last step to work. I have added the entry for the domain and ip address but it dosn’t show the address as taken. Any Suggestions?
Did you rebuild httpd.conf? Try also /scripts/rebuildippool to update the ip pool
I did this and cPanel shows the addresses are being used, but when I ping the web address, it still comes back to the original IP.
This depends on if you got shared or vps hosting? Cause i have shared hosting and i’ve studying how to have mupltiple ip on one cpanel.
Thanks for reply
I ran into the issue of it saying:
/scripts/rebuildhttpconf
Wasn’t a file.
After a little research, I saw other places saying to do “httpd” not “http”:
/scripts/rebuildhttpdconf
And it worked.
Just as a heads up, there is a typo. Script:
/scripts/rebuildhttpconf
should be:
/scripts/rebuildhttpdconf
(notice the D in httpDconf)
Fixed – thanks for pointing it out
5) to restart apache “/etc/init.d/httpd restart”
thanks!
Pingback: Installing A Wildcard SSL Certificate :: The cPanel Admin