Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to point to the staging virtual host, for the live I want and to point to the live one etc., and then for *(everythingelse) needs to point to the development server.

Anyone have any idea?! I posted a couple times on StackOverflow to no avail.

EDIT: I only have 1 server! Just to be clear. I can purchase 2 more IP's if necessary however.

share|improve this question
up vote 0 down vote accepted

First set your DNS so that you have an A record for "" (blank), "www" and "staging" which point to the live server's IP address. Next, set another A record for "*" (ask your provider how to do a wildcard if that doesn't work) pointing to your development server.

Next, in your Apache configuration on the live server, put a ServerName of with ServerAlias pointing to the live DocumentRoot, and put a second VirtualHost in place with the ServerName

Finally, on your development server, put the ServerName to be whatever you want (eg. and the ServerAlias to *" - you could also just use the default DocumentRoot if you want it to match anything that ends up at that server.

share|improve this answer
Do we need multiple IP addresses? Is there anyway to do all of this on one IP? – Walker Aug 11 '10 at 14:41
From you question it sounded as though you had at least two servers. You can do all of this on one IP address providing you don't have more than one SSL certificate. – James L Aug 11 '10 at 15:29
Sorry about that, I made an edit to the original question. I can purchase more IP's (I'm on RackspaceCloud) to run the dev / staging server if necessary - or, how would you solve the problem with one IP? – Walker Aug 11 '10 at 15:38
Just wildcard your DNS so that everything on that domain points to your server, then use Apache NameVirtualHosts to split the requests. – James L Aug 11 '10 at 15:40
Thanks for the help, we're trying to work it out now! – Walker Aug 11 '10 at 18:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.