Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 192.168.110.9.
Address 192.168.110.9
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 192.168.110.9.
Address 192.168.110.9
Port 80     Server Name stage.sidev
Document Root /home/admin/www/stage

I am connecting from windows xp with my hosts file like this:

127.0.0.1       localhost
127.0.0.1       dev.local
192.168.110.9       sidev
192.168.110.9   stage.sidev
192.168.110.9   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

1 Answer 1

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

 
discard

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.