Mobile app version of vmapp.org
Login or Join
Si4351233

: Adding subdomain to another cPanel account I have several cPanel accounts on my server (running Cloudlinux 5). I managed them using WHM. My current situation (replacing the real domain with example.com):

@Si4351233

Posted in: #AddOnDomain #Cpanel #Subdomain #Whm

I have several cPanel accounts on my server (running Cloudlinux 5). I managed them using WHM.

My current situation (replacing the real domain with example.com):

Account A has an addon domain example.com.

Account B's primary domain is sub.example.com.

I want to add another sub domain sub2.example.com to Account B, so that it points to Account B's document root.

Now cPanel doesn't allow me to do so. It says example.com is owned by another user, which should be Account A, I guess.

Is there any way to point sub2.example.com to Account B's document root? I'm not asking for redirection from sub2.example.com to sub.example.com. The url sub2.example.com should not change.

What I have tried:


Add DNS record: sub2 IN CNAME sub.example.com.
Add sub2.example.com file to /var/cpanel/userdata/AccountB.


sub2.example.com just loads the server IP's default document root.

Any help is appreciated.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Si4351233

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kevin317

When cPanel adds a subdomain, it's a subdomain of the domain listed on the account. So, if account B has a primary domain of sub1.example.com, then it could only add domains like sub2.sub1.example.com. Somehow, you would want to be either making it into its own cPanel account, or adding it to the account with the primary domain example.com.

If you tried adding it to the userdata file, did you also /scripts/rebuildhttpdconf and restart Apache? If you're showing the default IP, then Apache doesn't have a VirtualHost entry for that hostname and IP. You could probably hack it like that, though it isn't ideal.

If you must have the subdomains on account B, and the main site on account A, I would recommend changing the A to some other subdomain. I don't think that it could be example.com, thought that would be ideal. Maybe www1.example.com. Then, change B to example.com, with all the subdomains added there, and make example.com redirect to the subdomain which you are using for A.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme