<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>
+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>
+
+<P>For example, suppose that both <SAMP>www.domain.tld</SAMP> and
+<SAMP>www.otherdomain.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
<VirtualHost 111.22.33.44>
ServerName www.domain.tld
- DocumentRoot /web/domain
+ DocumentRoot /www/domain
</VirtualHost>
-</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.
+ <VirtualHost 111.22.33.44>
+ ServerName www.otherdomain.tld
+ DocumentRoot /www/otherdomain
+ </VirtualHost>
+</PRE>
<P>Of course, any additional directives can (and should) be placed
into the <CODE><VirtualHost></CODE> section. To make this work,
-all that is needed is to make sure that the name
-<SAMP>www.domain.tld</SAMP> points to the IP address
-<SAMP>111.22.33.44</SAMP></P>
+all that is needed is to make sure that the names
+<SAMP>www.domain.tld</SAMP> and <SAMP>www.otherdomain.tld</SAMP>
+are pointing to the IP address <SAMP>111.22.33.44</SAMP></P>
<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 <VirtualHost>s. The "main server" will <STRONG>never</STRONG>
-be served from the specified IP address.
+by matching <VirtualHost>s. The "main server" will
+<STRONG>never</STRONG> 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
+<EM>every</EM> server (hostname) you want to maintain on your server.
<P>Additionally, many servers may wish to be accessible by more than
one name. For example, the example server might want to be accessible
<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>
+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>
+
+<P>For example, suppose that both <SAMP>www.domain.tld</SAMP> and
+<SAMP>www.otherdomain.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
<VirtualHost 111.22.33.44>
ServerName www.domain.tld
- DocumentRoot /web/domain
+ DocumentRoot /www/domain
</VirtualHost>
-</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.
+ <VirtualHost 111.22.33.44>
+ ServerName www.otherdomain.tld
+ DocumentRoot /www/otherdomain
+ </VirtualHost>
+</PRE>
<P>Of course, any additional directives can (and should) be placed
into the <CODE><VirtualHost></CODE> section. To make this work,
-all that is needed is to make sure that the name
-<SAMP>www.domain.tld</SAMP> points to the IP address
-<SAMP>111.22.33.44</SAMP></P>
+all that is needed is to make sure that the names
+<SAMP>www.domain.tld</SAMP> and <SAMP>www.otherdomain.tld</SAMP>
+are pointing to the IP address <SAMP>111.22.33.44</SAMP></P>
<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 <VirtualHost>s. The "main server" will <STRONG>never</STRONG>
-be served from the specified IP address.
+by matching <VirtualHost>s. The "main server" will
+<STRONG>never</STRONG> 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
+<EM>every</EM> server (hostname) you want to maintain on your server.
<P>Additionally, many servers may wish to be accessible by more than
one name. For example, the example server might want to be accessible