name-based.html revision 85939515009c2c78e391236bf825ded8609f6a1a
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe BGCOLOR="#FFFFFF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe TEXT="#000000"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LINK="#0000FF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe VLINK="#000080"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ALINK="#FF0000"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<!--#include virtual="header.html" -->
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<H1 ALIGN="CENTER">Apache name-based Virtual Host Support</H1>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<A HREF="ip-based.html">IP-based Virtual Host Support</A>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<P>While the approach with IP-based virtual hosts works very well,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweit is not the most elegant solution, because a dedicated IP address
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweis needed for every virtual host and it is hard to implement on some
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowemachines. The <CODE>HTTP/1.1</CODE> protocol contains a method for the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweserver to identify what name it is being addressed as. Apache 1.1 and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelater support this approach as well as the traditional
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweIP-address-per-hostname method.</P>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<P>The benefits of using the new name-based virtual host support is a
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowepractically unlimited number of servers, ease of configuration and use, and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowerequires no additional hardware or software.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThe main disadvantage is that the client must support this part of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweprotocol. The latest versions of most browsers do, but there are still
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweold browsers in use who do not. This can cause problems, although a possible
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowesolution is addressed below.</P>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe<P>Using the new virtual hosts is quite easy, and superficially looks
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelike the old method. You simply add to one of the Apache configuration
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowefiles (most likely <CODE>httpd.conf</CODE> or <CODE>srm.conf</CODE>)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowecode similar to the following:</P>
ServerName www.domain.tld
familiar with typing "www" or "www.foobar" then you will need to add
ServerName www.domain.tld
<!--#include virtual="footer.html" -->