Received: (qmail 22428 invoked by uid 2012); 17 Dec 1998 18:34:55 -0000 Message-Id: <19981217183455.22427.qmail@hyperreal.org> Date: 17 Dec 1998 18:34:55 -0000 From: Joshua Slive Reply-To: slive+apachebugs@finance.commerce.ubc.ca To: apbugs@hyperreal.org Subject: Suggested change for name-based vhost docs X-Send-Pr-Version: 3.2 >Number: 3549 >Category: documentation >Synopsis: Suggested change for name-based vhost docs >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: change-request >Submitter-Id: apache >Arrival-Date: Thu Dec 17 10:40:01 PST 1998 >Last-Modified: Fri Dec 18 15:54:29 PST 1998 >Originator: slive+apachebugs@finance.commerce.ubc.ca >Organization: >Release: 1.3.3 >Environment: Docs >Description: The name based vhost docs seem to be the source of much confusion, at least on usenet. Two things which could be cleared up: 1. It is confusing to have an example of name based vhosts with only one section, since any working configuration would need at least two. This seems to trip people up. 2. Although most people find the part where it says "The 'main server' will never serve any requests", they can't figure out what to do about it. Being a little more explicit might help. >How-To-Repeat: >Fix: *** name-based-old.html Thu Dec 17 10:00:31 1998 --- name-based.html Thu Dec 17 10:28:33 1998 *************** *** 46,54 ****

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:

      NameVirtualHost 111.22.33.44
  
--- 46,62 ----
  

Using non-IP Virtual Hosts

Using the new virtual hosts is quite easy, and superficially looks ! 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.other.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
  
***************
*** 56,69 ****
      ServerName www.domain.tld
      DocumentRoot /web/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. -

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 --- 64,76 ---- ServerName www.domain.tld DocumentRoot /web/domain </VirtualHost> + + <VirtualHost 111.22.33.44> + ServerName www.other.tld + DocumentRoot /web/other + </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 *************** *** 73,79 ****

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.

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

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. To ! continue serving requests to this server, it should be given its own ! <VirtualHost> section which should be listed first ! in the configuration file.

Additionally, many servers may wish to be accessible by more than one name. For example, the example server might want to be accessible >Audit-Trail: State-Changed-From-To: open-analyzed State-Changed-By: lars State-Changed-When: Thu Dec 17 14:57:19 PST 1998 State-Changed-Why: I'll take a closer look at the patch... Responsible-Changed-From-To: apache-lars Responsible-Changed-By: lars Responsible-Changed-When: Thu Dec 17 14:57:19 PST 1998 Responsible-Changed-Why: State-Changed-From-To: analyzed-closed State-Changed-By: lars State-Changed-When: Fri Dec 18 15:54:25 PST 1998 State-Changed-Why: Based on your patch some changes have been made to the virtual host documentation. The Apache site will be updated within the next few days. Thanks. Responsible-Changed-From-To: lars-apache Responsible-Changed-By: lars Responsible-Changed-When: Fri Dec 18 15:54:25 PST 1998 Responsible-Changed-Why: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]