Assign A IP Address
===================
Once logged into your server via SSH with root privilege open to the /var/cpanel/userdata directory.
# cd /var/cpanel/userdata/domain/
open the subdomain file by any text editor vi, vim, nano, remove the existing IP and add to dedicated IP address, ip: 1.2.3.4
# vi linuxfaq.domain.com
documentroot: /home/domain/public_html/linuxfaq
group: domain
hascgi: 0
homedir: /home/domain
ip: 1.2.3.4
ipv6: ~
no_cache_update: 0
owner: root
phpopenbasedirprotect: 1
serveradmin:
webmaster@linuxfaq.domain.com
serveralias:
www.linuxfaq.domain.com
servername: linuxfaq.domain.com
usecanonicalname: 'Off'
user: domain
userdirprotect: ''
step 2: Rebuild and restart Apache
After changes the file rebuild and restart Apache,
# /scripts/rebuildhttpdconf
info [rebuildhttpdconf] Missing owner for domain host3.domain.com, force lookup to root
Built /usr/local/apache/conf/httpd.conf OK
Step 3: Reserve IP Address for subdomain:
Open the domainips name
# vim /etc/domainips
#domainips v1
1.2.3.4: linuxfaq.domain.com
step4: Rebuild IP Pool
To execute below script assign free ip's
#/scripts/rebuildippool
The system has 1 free IP.
step5: DNS configuration
Open a main domain named db file and Set the A record,
# vim /var/named/domain.com.db
linuxfaq 3600 IN A 1.2.3.4
www.linuxfaq 3600 IN A 1.2.3.4
Verify the named zone,
# /usr/sbin/named-checkzone domain.com /var/named/domain.com.db
zone domain.com/IN: loaded serial 2014100302
OK
Restart named service
# /etc/init.d/named restart