You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Joshua Slive <sl...@finance.commerce.ubc.ca> on 1998/12/17 19:34:55 UTC

documentation/3549: Suggested change for name-based vhost docs

>Number:         3549
>Category:       documentation
>Synopsis:       Suggested change for name-based vhost docs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Thu Dec 17 10:40:01 PST 1998
>Last-Modified:
>Originator:     slive+apachebugs@finance.commerce.ubc.ca
>Organization:
apache
>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
<VirtualHost> 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 ****
  <H2>Using non-IP Virtual Hosts</H2>
  
  <P>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 <CODE>httpd.conf</CODE> or <CODE>srm.conf</CODE>)
! code similar to the following:</P>
  <PRE>
      NameVirtualHost 111.22.33.44
  
--- 46,62 ----
  <H2>Using non-IP Virtual Hosts</H2>
  
  <P>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 <A
! HREF="../mod/core.html#namevirtualhost"><CODE>NameVirtualHost</CODE></A>
! directive which specifies an IP address that should be used as a
! target for name-based virtual hosts.
! 
! <P>For example, suppose that both <SAMP>www.domain.tld</SAMP> and
! <SAMP>www.other.tld</SAMP> point at the IP address
! <SAMP>111.22.33.44</SAMP>.  Then you simply add to one of the Apache
! configuration files (most likely <CODE>httpd.conf</CODE> or
! <CODE>srm.conf</CODE>) code similar to the following:</P>
  <PRE>
      NameVirtualHost 111.22.33.44
  
***************
*** 56,69 ****
      ServerName www.domain.tld
      DocumentRoot /web/domain
      &lt;/VirtualHost&gt;
  </PRE>
  
- <P>The notable difference between IP-based and name-based virtual host
- configuration is the
- <A HREF="../mod/core.html#namevirtualhost"><CODE>NameVirtualHost</CODE></A>
- directive which specifies an IP address that should be used as a target for
- name-based virtual hosts.
- 
  <P>Of course, any additional directives can (and should) be placed
  into the <CODE>&lt;VirtualHost&gt;</CODE> 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
      &lt;/VirtualHost&gt;
+ 
+     &lt;VirtualHost 111.22.33.44&gt;
+     ServerName www.other.tld
+     DocumentRoot /web/other
+     &lt;/VirtualHost&gt;
  </PRE>
  
  <P>Of course, any additional directives can (and should) be placed
  into the <CODE>&lt;VirtualHost&gt;</CODE> section. To make this work,
  all that is needed is to make sure that the name
***************
*** 73,79 ****
  <P>Note: When you specify an IP address in a <CODE>NameVirtualHost</CODE>
  directive then requests to that IP address will only ever be served
  by matching &lt;VirtualHost&gt;s.  The "main server" will <STRONG>never</STRONG>
! be served from the specified IP address.
  
  <P>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 ----
  <P>Note: When you specify an IP address in a <CODE>NameVirtualHost</CODE>
  directive then requests to that IP address will only ever be served
  by matching &lt;VirtualHost&gt;s.  The "main server" will <STRONG>never</STRONG>
! be served from the specified IP address.  To
! continue serving requests to this server, it should be given its own
! <CODE>&lt;VirtualHost&gt;</CODE> section which should be listed first
! in the configuration file.
  
  <P>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:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> 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!         ]