Parkdomain on Addon domain in cPanel And create mail accounts for that Parkdomain
March 1, 2009 | In: Cpanel
Hello guys,
You might have come across the requirement of parking a domain on an addon domain.
Please note this can be done only via backend and you need root access to the server.
Suppose.
main domain : maindomain.com
addondomain: addondomain.com
the domain needed to be Parked on “addondomain.com” : parkdomain.com
Case One.
You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”.
Case Two.
You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”. Also, you need to create mail account for the domain “parkdomain.com” via cPanel interface.
Steps for Case One.
For parking a domain on to an Addon domain. Assuming the case of parkdomain.com” to be parked on addon domain “addondomain.com”.
Take a backup of Apache conf fine.
cp -pr /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.confback
Open the file /usr/local/apache/conf/httpd.conf in vi editor or pico
fine the Virtual host entry for the “ServerAlias addondomain.com”
The entry looks like
ServerAlias addondomain.com www.addondomain.com
Edit this line as
ServerAlias addondomain.com www.addondomain.com parkdomain.com www.parkdomain.com
Restart Apache
/etc/rc.d/init.d/httpd restart
Now add the zone entries via WHM.
DNS Functions > Add a new DNS zone
domain name : parkdomain.com
IP: The IP should be the IP entry in the Vitualhost where “ServerAlias addondomain.com www.addondomain.com parkdomain.com www.parkdomain.com” resides.
Once it has propagated you park domain will start working. Please note that your parkdomain.com will be shown under the Addondomains section in Cpanel.
Steps for Case Two
You need the domain “parkdomain.com” to be parked on addon domain “addondomain.com”. Also, you need to create mail account for the domain “parkdomain.com” via cPanel interface.
Perform the Case one.
Now what is left is the need for creating mail accounts with the “parkdomain.com” via cPanel interface.
Please take the backup of all the files you edit.
find the username of the account
grep addondomain.com /etc/userdomains
It shows
addondomain.com: username
open using your text editor.
/var/cpanel/users/username
find the variable
DNS
It will be like
DNS=
DNS1=
DNS2=
If you have two entries already
DNS=
DNS1=
Add
DNS2=parkdomain.com
Save the file and exit.
Next get in to the directory /var/cpanel/userdata/username
You will find a file name addondomain.maindomain.com . Open this file
Find the directive “serveralias: addondomain.com www.addondomain.com www.addondomain.maindomain.com”
Now edit this line to
serveralias: addondomain.com www.addondomain.com www.addondomain.maindomain.com parkdomain.com www.parkdomain.com
Next
Open the file
/etc/userdomains
Add a new entry
parkdomain.com: username
Open the file
/etc/localdomains
Add a new entry
parkdomain.com
You are about to finish.
Now execute the script
/scripts/updateuserdomains.
You should be able to view the parkdomain.com in your
cPanel > Mails > Add/remove mail accounts.




