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 have a simple test setup using xampp at home, and I am getting really weird behavior when I attempt to set up multiple virtual hosts on this box. Here is my vhosts file:

 NameVirtualHost *:80
 <VirtualHost *:80>
  ServerAdmin me@me.me
  ServerName foo
  DocumentRoot "D:\wamp\xampp\htdocs\foo"
  ErrorLog logs/foo-error_log
  CustomLog logs/foo-access_log common
    <Directory "D:\wamp\xampp\htdocs\foo">
      Options Indexes FollowSymLinks Includes execCGI
      AllowOverride All
      Order Allow,Deny
      Allow From All
    </Directory>
 </VirtualHost>

 <VirtualHost *:80>
    ServerAdmin me@me.me
    ServerName bar
    DocumentRoot "D:\wamp\xampp\htdocs\bar"
    ErrorLog logs/bar-error_log
    CustomLog logs/bar-access_log common
    <Directory "D:\wamp\xampp\htdocs\bar">
      Options Indexes FollowSymLinks Includes execCGI
      AllowOverride All
      Order Allow,Deny
      Allow From All
    </Directory>
  </VirtualHost>

When I attempt to run visit the first site, it works as expected.

When I attempt to run the second site, I get a weird hybrid mishmash of both sites. It's the weirdest thing.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

firstly you need to specify the tld in servername, i.e. foo.com or www.foo.com.

On the other hand... have you setup your hosts file in order to resolve foo.com or www.foo.com? If no, go to windows->system32->drivers->etc->hosts and add a line like this: 127.0.0.1 www.foo.com

share|improve this answer
    
thanks... it worked with one without a TLD, so I didn't think it was required. –  Chris Sobolewski Jan 11 '11 at 4:05

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.