domain name / hostname server setup advice for single domain

They have: 2 posts

Joined: Dec 2009

Hi

I'm setting up two servers to go in racks for hosting a web project - live server and staging server - but not sure what the best set-up is in terms of hostnames and domain names for the actual servers, being as the two servers are only ever dealing with one web app (one domain) and a corresponding staging area.

What would a typical set-up be?

Can I use a registered domain name e.g. mydomain.com, and set it up so that the servers have hostnames
server1.mydomain.com
and
server2.mydomain.com

and then set up an account mywebapp.com on one server, and mystaging.com on the other?

Or is there a better way?

Thanks.

They have: 121 posts

Joined: Dec 2008

Sounds like a reasonable approach to me. You're looking at DNS configuration to make it happen.

Assuming:
your domain = 'example.com'
'server1' is on IP 192.168.1.100 "production"
'server2' is on IP 192.168.1.200 "development"

You'll want an 'A' Records:
A server1.example.com. 192.168.1.100
A server2.example.com. 192.168.1.200

Then you can 'CNAME' (Cannonical Name / Alias) the rest:
www CNAME server1.example.com.
dev CNAME server2.example.com.
svn CNAME server2.example.com.
... etc.

If another domain name comes along, e.g. example2.com
It will have it's own configuration, and can be set up in the same / similar way to the above, and all will work...

Cheers,
Shaggy

They have: 2 posts

Joined: Dec 2009

Hey, thanks a tonne for that - really helpful.

so a set up like that would give
www.example.com as a live site, running on server 1
svn.example.com and dev.example.com running on server 2

?

Just checking im understanding that right.

Thanks.

They have: 121 posts

Joined: Dec 2008

Yes, that's how things would resolve if set up as above.

Cheers,
Shaggy.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.