> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: Friday, March 11, 2011 10:14 AM
> To: Tomcat Users List
> Subject: Re: Typical setting for <Host name="????" />
>

> You can call it DefaultHost if you like. The only requirement is that
> the defaultHost specified in the Engine must be the name of a Host
> element contained by that Engine.

<snip>

> Tomcat matches the Host header in the HTTP request to the host name.
> Any that don't match get sent to the default host.

Ah, that makes things crystal clear.  I was confused by trying to read the docs 
for the name attribute of the Host element too literally:

"Network name of this virtual host, as registered in your Domain Name Service 
server. Regardless of the case used to specify the hostname, Tomcat will 
convert it to lower case internally. One of the Hosts nested within an Engine 
MUST have a name that matches the defaultHost setting for that Engine. See Host 
Name Aliases for information on how to assign more than one network name to the 
same virtual host."

And the introduction for the element as well:

"The Host element represents a virtual host, which is an association of a 
network name for a server (such as "www.mycompany.com" with the particular 
server on which Catalina is running. In order to be effective, this name must 
be registered in the Domain Name Service (DNS) server that manages the Internet 
domain you belong to - contact your Network Administrator for more information."

Clearly what is there is correct, since it takes some extra effort to embed a 
Host header into the HTTP request if you don't have a DNS entry (messing with 
/etc/hosts would be one way).  But that last bit of info for how Tomcat 
actually makes use of the header would be handy in the docs (I know - patches 
welcome :))

Is there any measurable performance optimization of using the name of the host 
that is expected to be in the request?  I would guess not, even for a very high 
volume site, but haven't looked at the code.

--Jason
This message and the information contained herein is proprietary and 
confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to