views:

39

answers:

0

Hey,

I am trying to set up several virtual hosts in my apache httpd.config file. However it seems that if I change them round, they all inherit the DocumentRoot value from the first one.

My VirtualHosts are as follows:

<VirtualHost customerApp_Global:427>
 ServerName customerApp_Global
 DocumentRoot "C:/wamp/www/customerApp_v2"
 DirectoryIndex index.php index.html index.html index.htm index.shtml
 <Directory C:/wamp/www/customerApp_v2>
    AllowOverride All
 </Directory>
</VirtualHost>

<VirtualHost naturaleigh:427>
 ServerName naturaleigh
 DocumentRoot "C:/wamp/www/naturaleigh"
 DirectoryIndex index.php index.html index.html index.htm index.shtml
 <Directory C:/wamp/www/naturaleigh>
    AllowOverride All
 </Directory>
</VirtualHost>

<VirtualHost customerApp:427>
 ServerName customerApp
 DocumentRoot "C:/wamp/www/customerApp"
 DirectoryIndex index.php index.html index.html index.htm index.shtml
 <Directory C:/wamp/www/customerApp>
    AllowOverride All
 </Directory>
</VirtualHost>

...and my HOSTS file:

127.0.0.1       naturaleigh
127.0.0.1   customerApp
127.0.0.1   customerApp_Global

I have been led to believe, by multiple sites, that this is all I really need to do. Can someone please advise me on why the 2nd and 3rd hosts are inheriting and what I can do to resolve the issue? At least I assume they are inheriting - all I can tell you is that they all display the exact same thing, even though CustomerApp, CustomerApp_V2 and Naturaleigh are all completely different apps, and whichever one is first affects what is displayed for the other two (i.e. if Naturaleigh is first then it is that app which the other two load). Thanks in advance.

Regards,

Richard

PS If this is more of a networking issue then my apologies - please say so and I will post it on SuperUser.