Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 3326 invoked by uid 6000); 18 Dec 1998 23:49:47 -0000 Received: (qmail 3319 invoked by alias); 18 Dec 1998 23:49:46 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 3317 invoked by uid 220); 18 Dec 1998 23:49:45 -0000 Date: 18 Dec 1998 23:49:45 -0000 Message-ID: <19981218234945.3316.qmail@hyperreal.org> From: lars@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/htdocs/manual/vhosts name-based.html Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org lars 98/12/18 15:49:45 Modified: htdocs/manual/vhosts name-based.html Log: Some updates/modifications (based on the patch from the PR). PR: 3549 Submitted by: Joshua Slive Revision Changes Path 1.9 +30 -15 apache-1.3/htdocs/manual/vhosts/name-based.html Index: name-based.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/vhosts/name-based.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- name-based.html 1998/09/17 12:33:12 1.8 +++ name-based.html 1998/12/18 23:49:44 1.9 @@ -40,34 +40,49 @@

Using non-IP Virtual Hosts

Using the new virtual hosts is quite easy, and superficially looks -like the old method. You simply add to one of the Apache configuration -files (most likely httpd.conf or srm.conf) -code similar to the following:

+like the old method. The notable difference between IP-based and +name-based virtual host configuration is the +NameVirtualHost +directive which specifies an IP address that should be used as a +target for name-based virtual hosts.

+ +

For example, suppose that both www.domain.tld and +www.otherdomain.tld point at the IP address +111.22.33.44. Then you simply add to one of the Apache +configuration files (most likely httpd.conf or +srm.conf) code similar to the following:

+ + +
       NameVirtualHost 111.22.33.44
   
       <VirtualHost 111.22.33.44>
       ServerName www.domain.tld
  -    DocumentRoot /web/domain
  +    DocumentRoot /www/domain
       </VirtualHost>
  -
-

The notable difference between IP-based and name-based virtual host -configuration is the -NameVirtualHost -directive which specifies an IP address that should be used as a target for -name-based virtual hosts. + <VirtualHost 111.22.33.44> + ServerName www.otherdomain.tld + DocumentRoot /www/otherdomain + </VirtualHost> +

Of course, any additional directives can (and should) be placed into the <VirtualHost> section. To make this work, -all that is needed is to make sure that the name -www.domain.tld points to the IP address -111.22.33.44

+all that is needed is to make sure that the names +www.domain.tld and www.otherdomain.tld +are pointing to the IP address 111.22.33.44

Note: When you specify an IP address in a NameVirtualHost directive then requests to that IP address will only ever be served -by matching <VirtualHost>s. The "main server" will never -be served from the specified IP address. +by matching <VirtualHost>s. The "main server" will +never be served from the specified IP address. +If you start to use virtual hosts you should stop to use the "main server" +as an independent server and rather use it as a place for +configuration directives that are common for all your virtual hosts. +In other words, you should add a <VirtualHost> section for +every server (hostname) you want to maintain on your server.

Additionally, many servers may wish to be accessible by more than one name. For example, the example server might want to be accessible