0

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?

1
  • 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... Nov 25, 2010 at 11:52

1 Answer 1

1

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .