Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

From "Apache Cookbook," are my annotations correct?

Assumptions: DNS is configured properly for

ServerName          // where Tomcat is running
<VirtualHost>     // loads up
                              // the content at C:/.../TheSmiths
    DocumentRoot "C:/Apache/Sites/TheSmiths"
    ServerName // loads up
                              // the content at C:/.../JustJohnSmith
    DocumentRoot "C:/Apache/Sites/JustJohnSmith"

If I type in just "," then the first virtual host will be hit, which is

share|improve this question
up vote 2 down vote accepted

From the Apache documentation:

If no matching ServerName or ServerAlias is found in the set of virtual hosts containing the most specific matching IP address and port combination, then the first listed virtual host that matches that will be used.

This means that if you point your browser at (and do not otherwise provide a Host: header), that requests will be served by the virtual host for, since this is the first VirtualHost listed in the configuration.

share|improve this answer

Usually Apache hits the default site, apart from virtual hosts. But, if you don't have your default site enable, then yes, it will serve the first VirtualHost it finds.

Since NameVirtualHosts are Name driven, that means that Apache will match the hostname requested with ServerName to hit the proper site.

share|improve this answer

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.