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 am attempting to set up a local WAMP server and I am running into a problem with mapping domains to directories. When I just do one directory it works fine, but once I add another it doesn't work. This is what I have in my vhosts file.

NameVirtualHost *:80

<Directory "D:\server ">
  Order Deny,Allow
  Allow from all

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.


   DocumentRoot "d:\server\ctlife"
   ServerName site1.local

   DocumentRoot "d:\server\phpmyadmin"
   ServerName site2.local

And then in my hosts file I have put in this site1.local site2.local

If i take out site2.local in both files everything works fine, but doesn't seem to recognize the other one. I have followed a bunch of tutes on this and can't figure out what I am doing wrong.

share|improve this question

migrated from Jun 26 '10 at 11:29

This question came from our site for professional and enthusiast programmers.

You have 2 NameVirtualHost, try removing the 2nd one or the 1st and maybe it is conflicting... ALSO you have a space at <Directory "D:\server "> could you try remove it... i know it may not be the problem but might be interfering with apache. – Prix Jun 26 '10 at 2:23
oh sheesh.... thanks. – pfunc Jun 26 '10 at 2:25
Did that worked ? by the way what is in your error_log file from apache – Prix Jun 26 '10 at 2:31

I prefer to have a full NameVirtualHost statement with IP and port, such as


I would try that and remove the duplicate/overlapping NameVirtualHost statements. Also adjust your VirtualHosts to include IP:Port like:


Should do the trick. Good luck! :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.