> -----Original Message----- > From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] > Sent: Wednesday, May 26, 2010 10:23 AM > To: Tomcat Users List > Subject: RE: Tomcat 6.0 always uses default host in multi-host config > > > From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] > > Subject: RE: Tomcat 6.0 always uses default host in multi-host config > > > > When you have a config like the OP, where each host > > is defined by name, not IP, in the server.xml, there > > is obviously some resolution of IP to name that has > > to take place. > > No, there isn't. The HTTP host header is already a name, so it's a > simple string match. The only additional work is when useIPVHosts is > true - the IP address has to be retrieved from the TCP/IP stack and > converted to a string first. >
That was what I was saying. Please read in context of the thread. The topic is about what happens when useIPVHosts=true. So it seems we are in agreement here. Of course, with the it set to true, isn't the host header string ignored? Isn't that the point? If the HHS is not ignored, why? > > There is nothing that Tomcat has to rely on outside the > > server.xml to properly route the traffic. > > True regardless of the configuration. > > > Anything that "magically" does something is a trick, even > > if it's a specifically coded trick. > > I still don't see why you think anything magic is going on; it all > seems very straightforward to me. > > > As you can see, there is nothing about how it > > determines the host<->IP mapping. > > Because there isn't any. > > > I'm not saying it isn't an advantage, but given the drawback > > of having traffic route inappropriately if your name resolution > > is not perfect, is it that great? > > Again, there's *no name resolution* going on - anywhere. HTTP requests > come in with a host header, and that's what is normally used to > determine which <Host> to give the message to. When you set > useIPVHosts to true, you defeat this mechanism, as documented. I'm not debating that! The entire discussion is about what happens with useIPVHosts set to true! Please comment on the topic or get off the thread! > > > 1) Set useIPVHosts to true in all <Connectors>. > > I have yet to see a valid reason to do that. The simplest, least > overhead configuration is a single <Connector> for each port, and let > the HTTP host header do the routing. You can set up the defaultHost to > be one that simply returns an error if the client fails to send in a > valid HTTP host header. You can also set aliases for expected synonyms > of the <Host> name. Please go back to the OP. He had a valid reason: needing multiple/different SSL certs based on IP, and wanting to route to a specific host based on that link. My config was an alternate for achieving his desired functionality without the use of the useIPVHosts parameter. But I can see how using it might mean less typing when setting up the server.xml. I'm just trying to get some clarification on the "expected" use of the parameter. (I like the comment about overhead. Now you're agreeing with me on something you dinged me for two posts before.) > > > 3) Otherwise it will make a call to the system resolver, > > passing the IP address to lookup and expecting a hostname > > in return. > > Nope, doesn't happen. > > > Or really, should we do what we'd do in Apache and set up > > the <Host> elements with name="ip address" instead of a > > text-based name, and not really worry about the text-based > > name at all - eliminating the need for any <alias> entries. > > No, because that eliminates the very common usage case of having > multiple domains point to the same IP address; you want to be able to > differentiate based on the URI of the request, not the IP address it > happens to arrive on. > > - Chuck OK, now I'm confused. ;-) It seems that on the one hand, you are saying that with useIPVHosts=true, the IP address determines how to process, but that the host header string also controls. Remember, this discussion all started with trying to figure out how useIPVHosts is supposed to work. Please provide a detailed description of how Tomcat function with useIPVHosts set to "true", or provide a link which does. Jeff (not the OP) ******************************* NOTICE ********************************* This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org