How to create Subdomains (like cpanel): sub.domain.com?

SYSTEM INFORMATION
OS type and version CentOS latest
Webmin version latest (GPL)
Virtualmin version latest (GPL)

How to create a subdomain (like mainstream web host terminology such as cpanel)?
FORMAT: sub.domain.com

Example subdomain:
test.mydomain.com

I know that Virtualmin calls things differently so please just tell me how to create the above.

Thank you.

just create it as either a top level of sub server as you want
set everything that is arrowed

A subdomain is just a name. You can name any virtual server or sub-server with a subdomain name in Virtualmin.

what is difference with the sub domain option indicated above ? (top arrow) if it is an option surly it must do something different ?

not sure I understand your question.
without using the subdomain option you get “website.com”

with a subdomain you get “house.website.com”
these are two separate websites

cpanel et el has a button to press to create a subdomain I pointed out the correct button to press using vmin which is the add subdomain button I guess

I don’t know how you’re seeing the Sub-domain option. It was disabled more than a decade ago.

In the beginning, we added it to make migrating from cPanel easier, but it’s such a weird/broken way to configure Apache virtual hosts (it puts content into a subdirectory of /home/domain/public_html, which is a potentially dangerous and definitely confusing thing to do).

Most users, who have not enabled the sub-domain feature by editing the Virtualmin config will not see it (I don’t think you can even enable it in the GUI, I think you have to modify the config file in a text editor, and it is not recommended).

1 Like

been using vmin for a long time perhaps this is just a setting that was not removed by vmin on an update some time ago

Yeah, if your Virtualmin configuration has been backed up and restored from many years ago. Subdomains came and went very, very, early in the story. I guess it probably also gets enabled automatically if you restore a domain that has subdomains, just so there continues to be UI support for managing them.

Anyway, I think they were gone in the default install by 2008 or 2009. It was a mistake to add them, honestly, and I wish we’d never done it. It’s a confusing entity for anyone who isn’t coming from cPanel, and conflates a name with functionality. You don’t need a “subdomain” virtual host type to name something with a subdomain name. There is nothing special about a subdomain that would make it necessary to have a special type of website for it (and putting the site content into a subdirectory of the parent domain is just such a weird choice).

one supplier, years ago, had a feature where by a subdomain could be accessed via any sub folder of root, which back in the day having docs.domain.com pointing to the docs directory was cool … note I am talking last century which may not be pertinent today

Its sub-server and you can use any domain name, its doesn’t need to be attached to website.com. There is no sub-domain option. You just use the server name house.website.com

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.