How does a shared plan host multiple domains?

Artashes

Administrator
Staff member
Something I've wondered about and something that I've never used myself.

When someone advertises 2 or more domains as part of a shared hosting plan, how are these domains actually hosted under the same plan? What I am interested in specifically is does each domain get its own cPanel/FTP access or are they piled up under the main domain that a client chooses as "root" and they are presented in the form of folders inside "public_html" folder?
 
One domain will be root and the other will have it's own folder with ftp access (for outside persons) or the owner (if he owns both) can login through the root domain and mess around with both sites.

If I understood your question correctly.
 
One domain will be root and the other will have it's own folder with ftp access

So that domain-folder will be under root domain's file structure? Inside "public_html" folder?

So that's basically same as addon domain setup then. :thumbup:
 
these days i cant understand why anyone uses addon domains when a reseller account is just as cheap as a shared account
 
DirectAdmin is a little different. The domain structure is:-

/home/<user>/domain/<domain_name>/public_html/<your_files>

So there is no root domain as such.
You could create a separate FTP user for each domain and resell it, we've seen this over the years, but as @easyhostmedia says reseller accounts are so cheap it's the better option.
(Also, who wants to have to create and destroy emails accounts continually)

With CloudLinux resources and Linux permissions in general, it's never a good idea to host multiple customers in the same account.
They run as the same user and so if one domain is compromised, that domain can often access the others, having said that open_basedir should still be honoured, so it still takes a little skill on the hackers part.
We know how resources can be stolen by a single account, in this case a single domain. Even cloudlinux cannot stop that.

Back to DirectAdmin, whilst there is no "root" domain, their is the concept of the "default" domain. This has a symlink between /home/<user>/public_html and /home/<user>/domain/<your_default_domain>/public_html so that you can access your domain using http://<servername>/~<user>.
This was historically done so customers could share a servers SSL certificate.
(Rarely taken up these days as you can get an SSL certificate for $10 or less from enom or free from startssl and DirectAdmin and cPanel both support SNI so you don't need a dedicated IP anymore.)
 
Last edited:
(Rarely taken up these days as you can get an SSL certificate for $10 or less from enom or free from startssl and DirectAdmin and cPanel both support SNI so you don't need a dedicated IP anymore.)

this is true, but i have seen issues with SNI and cpanel.

if like me you have a wildcard SSL for your servers, so that the servers run under https://<hostname> and a user purchases an SSL for their site without a dedicated IP so https://<yourdomain> then when you type in a browser https://<yourdomain> you get the SSL error message as it reads the servers SSL and says no ssl for the domain https://<yourdomain> and the only way round this is by using a dedicated IP
 
So there is no root domain as such.
You could create a separate FTP user for each domain and resell it,

but as its a shared plan then you will find in the hosts TOS that if you sell it you can see your account suspended and/or terminated as shared plans are for your own use and not to be resold
 
In cpanel, an add-on domain is really a subdomain of the account's domain. The add-on domain name is merely an alias for the subdomain with a subdomain's directory structure (a subfolder of the main site). There is no separate cpanel for each add-on domain, they are all managed in parent site's cpanel (they are subdomains afterall) . You can create mail for the add-on domains, but cpanel makes no real distinction between add-on domains and the account domain.

Thus if you create an addon domain in folder /domain2

Main domain - domain1.com
Addon domin - domain2.com
Cpanel creates subdomain domain2.domain1.com
domain2.com points to domain2.domain1.com
A valid and working url for domain2's site - http://domain1.com/domain2 !

Its obvious now that there is no technical difference between subdomains or add-on domains

Add-on domains in cpanel presents a security issue because the the first site's ftp account can access all the add-on domain's sites (there are tweaks to get around that, one needs whm or server access). In that sense Windows with all the panels I know of creates s more secure environment because an add-on domain has separate directory structure and panel as if it were just the only domain.
 
Last edited:
In cpanel, an add-on domain is really a subdomain of the account's domain. The add-on domain name is merely an alias for the subdomain.

to a point yes.

only different is that
1) A subdomain will be set at me.mydomain.com
2) An addon domain means you have to register a new domain name and then add this to the main account as an addon domain, but this would just create a subfolder like a subdomain s0 of you added the domain testtome.com all it would do is create subdomain testtome.mydomain.com which your domain testtome.com would point too.

but what would be the point you may as well set it up as a standalone shared account
 
The moral of the story here, if you want to resell services spend the extra few dollars and buy the reseller account.

You will save on admin, as your customers can do most things themselves, and there is much better security separation.
 
Whats flawed about it

/home/<user>/domains/<domainname>/public_html

It just makes every domain in the same way.
This way you cannot access the other domains by using http://maindomain.com/<addon-domain.com-directory>

DirectAdmin is better and more secure in this manner.
 
well that's a flawed system, i don't like DA, so they better make this an opt in/out system

The idea of keeping a domain isolated from other domains is flawed?

I always thought the idea of having addon domains under a primary domain was flawed. Then you can never delete the primary domain even if you no longer want it and its expired. One of the reasons I don't use Cpanel is because their addon domain concept is stupid.
 
Whats flawed about it

/home/<user>/domains/<domainname>/public_html

It just makes every domain in the same way.
This way you cannot access the other domains by using http://maindomain.com/<addon-domain.com-directory>

DirectAdmin is better and more secure in this manner.

If someone wants to use another domain then they should have a separate account for it and not place it in the same account as another domain (addon domain).

cpanel like forcing things onto all their users because only 98 of their clientbase say they want it.

why fix something that is not broken.

if some of their users want something like this then make it a feature that can be turned on or off
 
If someone wants to use another domain then they should have a separate account for it and not place it in the same account as another domain (addon domain).

Why create a new account for every site one wants to host? The cpanel architecture is flawed and their add-on domain feature is just a subdomain hack. But for some reason you think that is best. So be it

All other control panels I have used create new domains/sites equally whether each site is on the same customer account or on many customer accounts. As a matter of fact, if you were to create sites manually that is exactly what you should do. That's best practice.
.
.
.
 
Last edited:
Back
Top