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

In httpd.conf


DocumentRoot /usr/share/web
<Directory /usr/share/web>
// usual stuff from documentation

Include httpd-vhost is uncommented

in httpd-vhost.conf

NameVirtualHost *

<VirtualHost *>
  DocumentRoot "/usr/share/web/a"

<VirtualHost *>
  DocumentRoot "/usr/share/web/b"
  ServerAlias site

in /etc/hosts localhost

if I goto, I get served the page from /usr/share/web


share|improve this question

migrated from Sep 8 '12 at 19:16

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

In httpd.conf, you're specifically listening on port 80, but your virtual hosts are not specifying a port.

Change to the following:

NameVirtualHost *:80

and in each of your VirtualHost containers:

<VirtualHost *:80>

Also, you're defining the same ServerName in httpd.conf and httpd-vhost.conf -- I recommend changing the one in httpd.conf to something else.

share|improve this answer

Your Answer


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