tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Virtual Hosting Questions
Date Wed, 17 Nov 2004 19:03:04 GMT


>1. In development, the clients and tomcat will be on an intranet. I
>to use the hosts files of the client and tomcat boxes to map domain
>names to IP addresses, thereby preempting invocation of DNS, and thus
>exposure of our product-specific domain names to the Internet at-large,
>until the site is deployed publicly.
>Question 1: Is this hosts-file approach feasible? Does tomcat care HOW
>domain names
>are mapped to IP addresses?

It's more of a Java networking question that Tomcat question.  I'm not
sure how java's InetAddress class likes hosts files: my guess is they're

>Question 2: Why is the host named localhost? From the documentation, I

Localhost is just the default name.  You can substitute any string in
there, and have as many Hosts as you want inside the Engine, but the
Host name must be unique within the Engine.

>expected that only URL's of the form http://localhost:8080/... would be
>handled by this virtual host, but it seems to handle any URL's that map
>to the IP and port of the real host that tomcat serves.

The name of the Host in server.xml is used primarily by Tomcat for
internal management.  It doesn't have that much to do with the host name
in the browser's URL.

>Question 3: How would one configure a 'local' virtual host, i.e. a host
>visible only on the box that runs tomcat?

That's not a Host configuration question.  It's a Connector
configuration issue.  What you would do is define an Engine with a
Connector that only listens on a specific IP address (that of the box
running Tomcat), and define your Host inside that Engine instead of the
default or open Engine.


This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message