Add virtual server with a sub domain shop.xyz.com but resolve to default host

when i access my domain shop.xyz.com, it is opening my default virtual host, not the virtualserver that i have added.
i can see the access log being generated for the default virtual host under
/var/log/virtualmin

SYSTEM INFORMATION
**OS type and version: ubuntu 20.04
Webmin version: 1.981
**Virtualmin version:**6.17

guys, im seriously considering to migrate from cpanel to virtualmin pro, but with this basic functionality not working, it is difficult for me to decide on any switch

Your configuration is wrong.

shop.xyz.com is running through the following nameservers:

NS-1418.AWSDNS-49.ORG
NS-1664.AWSDNS-16.CO.UK
NS-32.AWSDNS-04.COM
NS-796.AWSDNS-35.NET

gen.xyz is running through Cloudflare:
gina.ns.cloudflare.com
lee.ns.cloudflare.com

So odds are your DNS is non-existent so it defaults to the only site it can reach, which is the gen.xyz.com.

In my personal experience, if you’re going to use Cloudflare, run EVERYTHING through Cloudflare. Don’t mix and match the two.

Did you create a virtual server for the subdomain? Is the domain name shown in the virtual server dropdown list?

hi shop.xyz.com is an example, not the actual domain. but thank you for checking :slight_smile:
yes i created virtual server with the subdomain itself, so i did not add the root level domain xyz.com as virtual server. is this the issue?

yes it is showing the virtual server list as shop.xyz.com

It’s impossible to say because you’re not telling us anything at all. If you’re that worried about somebody knowing about your website, there’s really not going to be anything anybody can do to help you.

Basically what you’re doing is saying, “my car doesn’t work” . There’s so many different things it could be that without actually seeing it to examine it, it’s going to be impossible to tell.

Even posting your apache error logs would be a step in the right direction.

there are no errors in apache error log,
the access logs is showing access to default site access log

the reason i do not provide actual domains is because im testing this via hardcoding my own /etc/hosts to this server, because the actual domain is currently hosted on another server. iam testing virtualmin.

this is the default site: s12.mercstudio.com

this is the subdomain virtual server ive setup:

this is the curl the url for the shop:

/var/log/virtualmin
root@vmi673390:/var/log/virtualmin# tail -f *_log 

What’s in .htaccess?

hi RJM, i have not setup any site yet, so it should be virtualmin default page, but it access log shows its opening s12

There’s a dotfile in the root of the domain called .htaccess . It’s used for all sorts of thing related to how Apache processes requests. What does that file contain?

Richard

You do not have Apache SSL site selected on the subdomain. You also don’t have an SSL certificate on the main domain either. That’s why it’s doing it.

Hi Gomez,

this is fully http issue

Hi RJM,

no, there is no hidden .htaccess on the public_html
Screenshot from 2021-09-29 22-57-04

btw this is a fresh setup of virtualmin on ubuntu, i wonder what happened

no ht access even on root

disable default website web and ssl and renable it fixed it

1 Like

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