Why is so hard to setup a Sub-Domain in Virtualmin? Sub Domain redirecting to Domain automatically!

8 posts / 0 new
Last post
#1 Mon, 07/03/2017 - 00:23

Why is so hard to setup a Sub-Domain in Virtualmin? Sub Domain redirecting to Domain automatically!

I've just run out of options, tried every single topic answer related with Sub-Domains on Virtualmin but im not able to setup it correctly.

I've created my sub domain such as: boards.domain.com so it SHOWS my forum content from User/public_html/Board

But it's impossible! It keeps me redirecting itself to main domain lol with that subdomain on web url.... This due to being using cloudflare pointing www.boards to my server's ip.

Am i having some error or something? With cPanel i would simply add the folder path to the sub domain and voila...

Even if i try to go into his direct folder (nginx) im getting HTTP ERROR 500 from domain.com/Board/public_html/index.php (Sub Server)

Mon, 07/03/2017 - 05:07
unborn's picture

Hi, creating subdomain with virtualmin is very easy:

  1. go to virtualmin and select domain
  2. click on create virtual server
  3. there on click on menu on top of the page sub-server
  4. fill name for subdomain aka boards (virtualmin will fill full subdomain name for you automatically aka boards.domain.com)
  5. review what options server should have aka mysql etc. and hit create button

It takes less then 10 seconds. Also please note that subdomains are stored outside of /public_html/ folder. You can found all subdomains for that domain.com in /home/server-user/domains/ folder which is to my opinion much better then folder in /public_html/ folder.

the subdomain would become available asap after sub server is created in case you manage your dns-es on your own. If you not manage your own dns-es, you just add subdomain to your domain registar panel and point it to your server IP. Same is for cloudflare I think, you just need to do extra step on their platform to let cloudflare know that there is subdomain.

Configuring/troubleshooting Debian servers is always great fun

Mon, 07/03/2017 - 05:17

I've made all that exactly as you said before creating my topic and my domain redirects me to my homepage....

Mon, 07/03/2017 - 21:23
unborn's picture

hi, sorry to hear that you still have trouble with that... I would check apache logs also have look on dns and apache conf files for that domain. whats the distro you running on?

Configuring/troubleshooting Debian servers is always great fun

Mon, 07/03/2017 - 22:09

Hi DreamStage,

It is actually really easy, as unborn explained. But if you add a sub-domain you also has to add that "sub" in your DNS record otherwise it wont work. We use nameservers and DNS record administration that is provided by the same company that also hosts our dedicated servers. I don't know how your NS and DNS is set up but I think that could be your problem.

And also, as unborn pointed out, the sub domains are stored outside the domains public_html, if they are stored under domains public_html they are just sub-folders.

I think your sub "board.domain.com" should be found in /home/domain(.com)/domains/board.domain.com/public_html/


Tue, 07/04/2017 - 01:03
Joe's picture

This is a "the wrong site shows up" kind of problem. There's a FAQ for that: https://www.virtualmin.com/documentation/web/troubleshooting#toc-the-wro...

It's usually that there's some sites with IP:80 VirtualHost definitions and others with *:80. That'll cause difficult to predict responses from Apache.

Oh, wait, actually...I see you're using nginx, which has a wholly different way of handling virtual hosts, and so this isn't the problem documented by the item I linked to. That might be DNS-related. If you want to open a private support ticket in the issue tracker with the actual hostnames and IP addresses, we can probably sort it out pretty quickly.


Check out the forum guidelines!

Tue, 07/04/2017 - 22:40


Mon, 07/10/2017 - 17:44

what was the problem? dns record pointing?

Topic locked