Skip to main content

How to set up BES Tomcat Virtual Host?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: BES-AppServer
  • Product Version: 5.2.x
  • Product Component: Tomcat Webcontainer
  • Platform/OS Version: Windows and Unix
  • JDK/Compiler Version: 1.3.1 and 1.4.1

How to set up BES Tomcat Virtual Host?

Following the Tomcat documentation at apache.org will not work because there are configuration differences in BES Tomcat.

Resolution:

This article explains the differences in configuration between a stand alone Tomcat and BES affecting how wars are configured to deploy to a particular server and how the default context is set for a particular virtual host.

A virtual host is an association of a network name. (such as www.mycompany.com) with the particular server on which Catalina is running.

The <host> element in server.xml represents a virtual host

Prior to setup :

  • The virtual host name must be registered in the Domain Name Service (DNS).
  • A virtual host can defined locally by adding the virtual host name to a computer's hosts file as an alias. (e.g. 127.0.0.1 localhost www.mycompany.com)

Define a virtual host in tomcat's server.xml:

<host name="www.mycompany.com" debug="0" appBase="wars" unpackWARs="false">
</host>


The "appBase" attribute is used in stand alone Tomcat to specify the webapps directory for a virtual host. In BES 5.2 all web applications (wars) for all defined virtual host are deployed to the partition root "wars" directory.

The "appBase" attribute in BES is ignored, instead deploying a web application to a specific server is defined in the application's "web-borland.xml" using <web-deploy-path> attribute. "web-deploy-path" can be configured using the deployment descriptor editor or manually.
E.g.

<web-deploy-path>
  <service>HTTP</service>
  <engine>HTTP</engine>
  <host>www.mycompany.com</host>
</web-deploy-path>

The context attribute in Tomcat specifies which deployed application will be the default context for a virtual host. In BES this is also determined in the web application's "web-borland.xml". The context property can be configured in the deployment descriptor editor or manually. If it is desired to have a particular web application be the root context of the virtual host, set the context for the web application to !ROOT!
E.g.

<context-root>!ROOT!</context-root>

 


#AppServer
#VisiBroker
#Security
#tomcat