How to create a sub-server

This tutorial will cover how to create a sub-server, allowing for a second domain to be setup within a given Virtual Server account.

It assumes you have first logged into Virtualmin.

  1. Choose the domain for which you would like to add the sub-server. You can do that by selecting the domain name from the drop-down box on the top-left.

  2. Click Create Virtual Server.

  3. Click Sub-server.

  4. Enter the Domain Name and Description for the Sub-server.

  5. Click Create Server.

Configure sub-servers template

If you want to create a sub-server accessible via http://subserver.yourdomainnamehere.com make sure that your sub-servers template is configure appropriately. Otherwise your new sub-server won't answer. Read more at: https://www.virtualmin.com/node/9546

Search for the comment posted on June 26, 2009 and titled "Solution - Edit sub-server template".

Posted by Francewhoa on Fri, 2009-06-26 21:29
not working for me

tried the solution - but not working for me. Still not reachable via internet. Where I probably made a mistake, while setting it up or during the configuration?

Posted by Malta-Support on Fri, 2015-05-22 10:45
try this...

i have experienced that problem too, but now its done.

1. Do you have domain? i assume you have "example.com", and your "example.com" is can be accessed through the internet.

2. The problem is "blog.example.com" can't be accessed through the internet? if this is your problem, try this
- ping your "example.com" = you will get reply, it means your site is up
- ping your "blog.example.com" = are you get reply? *(1)(2)

*(1) okay i assume you didn't get reply or timeout, so what you have to do is Manage your DNS by pointing "blog" A "ip address", the ip address is the same ip on "example.com" more less like this (see below)
-----------------------------------------
example.com A 104.xxx.xxx.19
www A 104.xxx.xxx.19
blog A 104.xxx.xxx.19
-----------------------------------------
(this is from DNS Management where you buy your domain, NOT FROM Virtualmin BIND DNS Server)
(after you create blog A 104.xxx.xxx.19, it not istantly created, you must wait 5-30 Minutes, usually i just wait around 10-15 minutes, so wait until times up, and do ping again to blog.example.com)

*(2) now i assume you get reply from blog.example.com , so what you have to do is
- (Make sure or change) Go to Virtualmin on Left Panel > System Setting > Server Template > Click "Setting for Subserver" on the right panel. In "Edit template section: " (at top) scroll down and Change to BIND DNS Domain, click change, scroll down, find "Add sub-domain DNS records to parent domain?" make sure choose "Yes" and click save.

- (Make sure or change) In Virtualmin on left panel make sure to manage "example.com" NOT "blog.example.com" and Go to WEBMIN (Click webmin on top of left panel) click on expand Server > Apache Webserver on the right panel, make sure "blog.example.com" is listed there (see servername column) if not listed, Click Create New Virtual Host, Choose "Specific ip Address" = (your ip) , Document Root = find your document root (dont know where it is? see below)
------------------------------------------------------------------
root
-- home
---- example.com / example
--------- etc
--------- public_html / www
--------- tmp
--------- domains
-------------- blog.example.com
------------------- etc
------------------- public_html / www (this is your "document root")
------------------- tmp
------------------- log
------------------------------------------------------------------
/root/home/example.com/domain/blog.example.com/public_html <-- more less like this the structure

on "servername" dont choose automatic, type blog.example.com, after that click "Create Now"
then Click "Apply Change" (on top right) > Stop Apache > then Start Apache (like restart apache)

- (Change) Go to BIND DNS Server, on Existing DNZ Zone section (on right panel), tick on example.com, click "Add record to selected" then on "Record type to add" = Address, "New record name" = blog, "New record value" = (your ip address), "Create even if record already exists?" tick "No" (by default is NO) then click "Add record" - if there are already exist, it will not created, so dont worry.

I Hope that can solved your problem so far, but if your problem still not solved, post again here, we search another solution (if you don't mind visit angelimus.blogspot.com, i have created Tutorial Sub-Server with Virtualmin and it works perfectly).

Posted by angelimus.blogs... on Thu, 2015-06-11 22:47
More Details

@Francewhoa: thanks

For those who face same issue: - VIRTUALMIN > SYSTEM SETTINGS > SERVER TEMPLATES - BIND DNS DOMAIN: ADD SUB-DOMAIN DNS RECORDS TO PARENT DOMAIN? = YES

I think Virtualmin should change this to Yes by default (or Default valus should be Yes, because there're Yes, No and Default).

Posted by kotakomputer on Fri, 2012-11-16 13:10