Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This article shows how to configure Virtual Hosts in Apache Geronimo with Tomcat. By default, when you deploy and start an application in Geronimo, that application will be listeting listening on every available host name. By configuring a virtual host you can make an application to listen on a specific host name or IP. The configuration steps described in this article are also valid then you are sharing a single IP among several host names.

To configure a virtal virtual host is Geronimo you basically need to:

...

To make this configuration work you need to ensure that Geronimo can resolve the virtual host name you are about to define. Depending on your network configuration you can add an entry to you DNS, an alias to the Geronimo server IP. Alternatively you can add an entry to the local host table, each operating system has it's own way to define a local host table. For example Windows will have %SystemRoot%\system32\drivers\etc\hosts, Unix UNIX based operating systems would normally have an /etc/hosts.

...

Open the config.xml file located in the <geronimo_home>/var directory and look for the following line <module name="geronimo/tomcat/1.1/car">. This is the beginning of the Tomcat configuration module, all the additional virtual host configuration will be done immediatly immediately after this line.

To define the first HostGBean TomcatVirtualHost_1 add the following lines right after <module name="geronimo/tomcat/1.1/car">.

...

We will use the same application in both cases but will differenciate differentiate one deployment from the other by giving it a different artifactId, this way we avoid modifying the code but still can identify each deployment.

...