Assigned dedicated IP to subdomain

You might want to assign dedicated IP to your subdomain for some reason such as apply SSL to your subdomain.

If you are using cPanel and wish to set dedicated IP to your subdomain, you will find no else where to do that.

However, this could still be able to fix as this article.

Scenario,
– You have domain domain.com and subdomain blog.domain.com.
– You wish to set dedicated IP for blog.domain.com which originally 100.100.100.100 and result as blog.domain.com resolve to 10.0.0.1.

1. Log into SSH, go to the folder of /var/cpanel/userdata,
cd /var/cpanel/userdata
2. Select the cPanel username folder such as mickgenie.
cd /var/cpanel/userdata/mickgenie
3. You will now see the following file,
domain.com
domain.com.cache
blog.domain.com
blog.domain.com.cache
main
main.cache

4. Open the file named blog.domain.com,
vi blog.domain.com
5. You should find the content as below,
ip: 100.100.100.100
6. Change it to detail as below,
ip: 10.0.0.1
7. Now, you have done but you will need to rebuilt the Apache,
/usr/local/cpanel/scripts/rebuildhttpdconf
8. Restart the Apache services,
/usr/local/cpanel/scripts/restartsrv_apache

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: