Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 using Xampp (Apace 2.2.20) on mac os lion for development. I have a number of CMS projects and i want to access them by going to cms1.localhost, cms2.localhost, cms3.localhost etc

Currently, with the setup I have below, all requests to the server are resolved by whichever virtual host i put first in the configuration, ie currently (/Applications/XAMPP/migration/trunk).

Can anyone please point me in the right direction please. I can't think what else to do in terms of debug etc so that help would be useful too. Thanks a lot.

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/migration/trunk"

<VirtualHost *:80>
ServerName rix.localhost
DocumentRoot "/Applications/XAMPP/projects/giving"

In /etc/hosts I have: localhost rix.localhost
share|improve this question
First, get rid of the tld's, eg. Make the second one just "rix" in both configs... test it like that. – Soviero Dec 1 '11 at 8:27
up vote 1 down vote accepted

Assuming that you've tried swapping around the two VirtualHost blocks and you get the corresponding site loading on localhost and rix.localhost, you're probably missing the NameVirtualHost *:80 directive.

Have a look in your Apache configs for that. If it's not there anywhere, add it somewhere in the main configuration area (ie, not in a VirtualHost block).

I like to set up logging each VirtualHost, so use ErrorLog and CustomLog Apache directives in each VirtualHost section. There's probably corresponding lines in the main configuration file too (outside VirtualHost sections), and that can be useful to look at.

When starting apache, errors like overlapping VirtualHosts get logged. I can't tell you where XAMMP would output those errors when it starts, but I would think it would log them somewhere. The XAMMP documentation would be a good start for that.

share|improve this answer
Thanks so much, that's exatly what it was - missing NameVirtualHost *:80. Thanks again.. – rix Dec 1 '11 at 9:34

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.