Return-Path: Delivered-To: apmail-httpd-docs-archive@httpd.apache.org Received: (qmail 14843 invoked by uid 500); 27 Oct 2001 23:31:57 -0000 Mailing-List: contact docs-help@httpd.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: docs@httpd.apache.org Delivered-To: mailing list docs@httpd.apache.org Received: (qmail 14824 invoked by uid 500); 27 Oct 2001 23:31:57 -0000 Delivered-To: apmail-apache-docs@apache.org Delivered-To: apmail-httpd-docs-1.3-cvs@apache.org Date: 27 Oct 2001 22:21:10 -0000 Message-ID: <20011027222110.45788.qmail@icarus.apache.org> From: slive@apache.org To: httpd-docs-1.3-cvs@apache.org Subject: cvs commit: httpd-docs-1.3/htdocs/manual/vhosts name-based.html.en X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N slive 01/10/27 15:21:09 Modified: htdocs/manual/vhosts name-based.html.en Log: Fix some broken links, change to the simplest possible example, and add a couple notes to give hints to people running servers behind port-forwarding firewalls. Revision Changes Path 1.18 +19 -16 httpd-docs-1.3/htdocs/manual/vhosts/name-based.html.en Index: name-based.html.en =================================================================== RCS file: /home/cvs/httpd-docs-1.3/htdocs/manual/vhosts/name-based.html.en,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -b -u -r1.17 -r1.18 --- name-based.html.en 2001/10/22 20:15:26 1.17 +++ name-based.html.en 2001/10/27 22:21:09 1.18 @@ -72,12 +72,12 @@ Related Directives

-DocumentRoot
-NameVirtualHost
-ServerAlias
-ServerName
-ServerPath
-VirtualHost
+DocumentRoot
+NameVirtualHost
+ServerAlias
+ServerName
+ServerPath
+VirtualHost

To use name-based virtual hosting, you must designate the IP @@ -89,7 +89,9 @@ NameVirtualHost. Note that mentioning an IP address in a NameVirtualHost directive does not automatically make the server listen to that IP address. See Setting -which addresses and ports Apache uses for more details. +which addresses and ports Apache uses for more details. In addition, +any IP address specified here must be associated with a network interface +on the server.

The next step is to create a <VirtualHost> block for @@ -104,26 +106,27 @@ show where in the filesystem the content for that host lives.

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 the following +www.otherdomain.tld point at an IP address +that the server is listening to. Then you simply add the following to httpd.conf:

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

In the simplest case, the IP address 111.22.44.33 can be -replaced by * to match all IP addresses for your server.

+

You can alternatively specify an explicit IP address in place of +the * in both the NameVirtualHost and +<VirtualHost> directives.

Many servers want to be accessible by more than one name. This is possible with the ServerName or ServerAlias. You must first have your DNS server -properly configured to map those names to the IP address in the -NameVirtualHost directive.

+properly configured to map those names to an IP address associated +with your server.

Finally, you can fine-tune the configuration of the virtual hosts by placing other directives inside the --------------------------------------------------------------------- To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org For additional commands, e-mail: docs-help@httpd.apache.org