Versions Compared

Key

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

...

This article used the simple HelloWorld application as a reference, this application is covered in the Quick start - Apache Geronimo for the impatient section.

Configure local host or DNS

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 based operating systems would normally have an /etc/hosts.

...

Make sure your system can resolve these names.

Define Virtual host

Now you need to define those virtual hosts in Geronimo's config.xml so it can recognize them. This section provides two different virtual hosts definitions, that is creating two new HostGBean (TomcatVirtualHost1 and TomcatVirtualHost2) in the Geronimo configuration, one of those will have multiple host names aliases. The goal of this example is to have an application listening on a single virtual host ( this will be virtualhost1.com ) and another application listening on a different virtual host ( this will be virtualhost2.com ) with two additional aliases ( this will be virtualhost3.com and virtualhost4.com ).

...

Note: Some tags in the config.xml shown above are presented in multiple lines for displaying purposes only.

Declare the virtual host in the deployment plan

As mentioned before, for this example we are using the HelloWorld sample application covered in the Quick start - Apache Geronimo for the impatient section. Since this is a Web application, the deployment plan that we are modifying is the geronimo-web.xml. If you use a different type of application you may need to modify a different deployment plan, for example geronimo-application.xml.

...

You now have two applications ready to be deployed to two different virtual hosts.

Deploy the application

At this point you have configured Geronimo to use two different Virtual Hosts, one of them is also configured to listen under additional aliases. All you need to do now is to deploy the applications and test them. To deploy the applications type the following commands from the <geronimo_home>\bin directory:

...