Featured Posts

Tips to Reduce Your Customer Support Costs When hosting websites, whether as a mainstream hosting provider, a hobby, or to supplement another service, it's your job to make sure your customers have access to technical support in case they need...

Read more

Roundcube: MySQL or SQLite? cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I've come to the conclusion that SQLite is definitely...

Read more

Simple Bash Script to Fix Account Permissions This is a simple bash script I wrote to fix the permissions and ownership of files within a cpanel account. To use, simply copy the script your server, chmod 755, and pass the usernames as arguments: ./fixperms...

Read more

Re-Installing Auxiliary cPanel Software Cpanel has a lot of supporting software that you may be using on your server. In case something goes amiss, here is a list of scripts that reinstall cpanel-provided software on your system. For most all...

Read more

10 Free Monitoring Solutions to Consider Server and network monitoring can be crucial to a host's success. I mean, how embarrassing is it when your customers are aware of downtime before you are? You don't have to pay big bucks or spend loads...

Read more

The cPanel Admin Rss

How to Assign an IP To Multiple cPanel Accounts

Posted by Vanessa | Tagged under , | Posted on February 17, 2010

1

Cpanel 11.25 introduces a new feature to allow you to set a reseller’s shared IP to be different from that of the server’s shared IP. This feature can be activated in WHM > Reseller Center > Manage reseller’s shared/main IP.  While this will allow you to have multiple accounts on the same IP, those accounts have to be owned by the reseller and will all be using the same IP. What if you have a dedicated IP that you want a couple accounts to share?  There’s currently no built-in cPanel functionality to do this, but you can alter a couple files to make it happen.

This walkthrough is for changing the IP of a domain/account to one that is already taken by another account. If you’re simply changing the site’s IP to one that is free, use the WHM > Change Site’s IP Address function instead.

Change the DNS

You can edit the DNS zone in WHM > Edit DNS Zone, or edit /var/named/yourdomain.com.db directly to point the domain to the desired IP on the server. Make sure to increment the serial number, then run /scripts/dnscluster synczone yourdomain.com  to sync it up to your nameservers. If you’re using external DNS, you’ll obviously need to point the domain in those nameservers instead.

Edit the cPanel Files

You need to change instances of the old IP to the new IP in the following locations, replacing $user with the username of the account, and $domain with the domain you are changing the IP for.

/var/cpanel/users/$user

/var/cpanel/userdata/$user/$domain

Now, add the IP to /etc/domainips in the same format as the others:

xxx.xxx.xxx.xxx: $domain

Build the Configs

Now rebuild the Apache config:

/scripts/rebuildhttpdconf

service httpd restart

That site should now be using the IP you specified. Keep in mind that if your ISP is caching the old IP, your default server page will show up instead of your website, until the IP change is propagated. This can take 4-24 hours.

*This technique is also used to assign multiple IPs to addon domains of a cPanel account. Follow the same procedure, only edit the config files for the domains you are changing.

Liking this article? Share it and spread the word!
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

Comments (1)

[...] How to Assign an IP To Multiple cPanel Accounts :: The cPanel Admin __________________ http://www.thecpaneladmin.com http://www.v-nessa.net [...]

Write a comment