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'm trying to setup a dev version and a staging version of my php web app on a Ubuntu Linux 6.06.1 machine with Apache 2.0.55

I have my virtual hosts setup like so via webmin, but i always end up at the dev site and never stage when I try to browse to stage.sidev

Defines the default settings for all other virtual servers, and processes any unhandled requests.
Address Any
Port Any    Server Name sidev
Document Root Automatic

Virtual Server  Handles the name-based server dev.sidev on address
Port 80     Server Name dev.sidev
Document Root /var/www/dev

Virtual Server  Handles the name-based server sidev-svn on address *.
Address Any
Port 443    Server Name sidev-svn
Document Root Default

Virtual Server  Handles the name-based server stage.nplusidev on address
Port 80     Server Name stage.sidev
Document Root /home/admin/www/stage

I am connecting from windows xp with my hosts file like this:       localhost       dev.local       sidev   stage.sidev   dev.sidev

How am I supposed to configure my virtual hosts for this to work?

share|improve this question
Are the lines starting with "Virtual Server" meant to be comment lines with a # in front of them? Also presumably you have these inside <VirtualHost> sections... – David Fraser Nov 25 '10 at 11:52
up vote 1 down vote accepted

You need to use the NameVirtualHost directive to tell Apache to distinguish between sites based on name - see Name based virtual host support for a thorough explanation. (That will also guide you through checking that the <VirtualHost> directives not seen above are correct etc)

share|improve this answer

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.