1. This e-mail may constitute proprietary material, confidential and privileged information. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please promptly delete this e-mail and any attachments and all copies and you must not disclose, copy, retain, circulate or in any other way use or rely on this information.
2. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices.
3. The contents of this email are those of the individual and do not necessarily represent the views of the company.
4. The company does not conclude contracts by email and all negotiations are subject to contract.
5. The company accepts no responsibility once an e-mail and any attachments is sent.

Configuring Virtual Hosting
It is possible to support virtual hosts under Tomcat Ver3.1, in fact the
virtual host configuration is very similar to configuring for multiple JVM
(as explained in the previous section) and the reason is simple; in Tomcat
3.1 each virtual host is implemented by a different Tomcat process.

With the current (Ver3.1) Tomcat, virtual hosting awareness is provided by
the web server (Apache/Netscape.). The web server virtual hosting support is
used by the Tomcat adapter to redirect requests belonging to a certain
virtual host to the JVM(s) containing the contexts of this virtual host.
This means that if (for example) we have two virtual hosts (vhost1 and
vhost2), we will have two JVMs: one running the contexts of vhost1 and the
other running the contexts of vhost2. These JVMs are not aware of each
others existence, in fact, they are not aware of the concept of virtual
hosting. All the virtual hosting logic is inside the web-server adapter. To
make things clearer, lets look at the following sample Apache-Tomcat
configuration file:

As can be seen, steps 1,2 and 3 define two Apache virtual hosts and for each
of them, mount the /examples context to a certain ajpv12 URL. Each such
ajpv12 URL points to a JVM that contains the virtual host. The configuration
of the two JVMs is very similar to the one demonstrated in the previous
section, we will need again to use two different server.xml files (one for
each virtual host process) and we will need to start the Tomcat processes
with the -f command line option. After doing that we will be able to
approach Apache, each time with a different host name, and the adapter will
redirect us to the appropriate JVM.

The need for improved virtual host support
Having each virtual host implemented by a different JVM is a huge
scalability problem. The next versions of Tomcat will make it possible to
support several virtual hosts within the same Tomcat JVM.