All subdomains forwarding to main site


#1

Hi all. First off I’m new to the Bytemark setup so please accept my apologies if this is a stupid question …

I’ve inherited a site running on Bytemark vm hosting and I’d like to set up a staging version of the site for making changes and general tinkering. The main lives in /srv/www.domain.com but a wildcard dns entry is in place causing all subdomains to show the main site.

Having read the relevant documentation I didn’t think this would be in an issue; I thought I would simply need to create a new folder tree as follows:

/srv/staging.domain.com/public/htdocs … and put the content for my staging site in there. The system would then automatically create the relevant DNS config to override the wildcard so that any requests for staging.domain.com would go to the staging site, with all remaining traffic still going to the main site.

This simply didn’t work. All subdomains still send all traffic to the main site. I’ve tried creating full folder trees for 3 different subdomains on the main domain and also a subdomain on a completely different domain that I also own (and that also points to that vm) …

staging.domain.com
stage.domain.com
test.domain.com
test.myotherdomain.com

None of them work; I’m absolutely baffled :sad:

Any suggestions would be most welcome; I’ve read and re-read the DNS and setup sections of the docs and cant see what I’m doing wrong. It seems too simple to expect the system to figure it out for me but thats certainly what the manual implies.

Many thanks in advance for your help!


#2

The DNS side of things is separate from the website side. You need to set up your DNS to point to the machine where you are hosting. If you have wildcards in the DNS already pointing to your server, then you don’t need to do any more with the DNS.

You then need to set up a ‘name based virtual server’ (assuming Apache), for each of your staging domains.

If you have some kind of tree structure with your staging sites within it, you ‘just’ need to set the ‘document root’ for each site to the appropriate branch of the tree.

Unless I’ve misunderstood …