• Loading...

Apache Tomcat

Discover with BMC ADDM
download

This product can be discovered by any edition of BMC Atrium Discovery and Dependency Mapping. Download our free Community Edition to try it out, or see what else it can discover!

What is this?
This is a product information page, containing details of the information that BMC Atrium Discovery gathers about a product and how it is obtained.
Product Name
Tomcat
Publisher Page

Apache Foundation

Category

Application Server Software Platforms

Release
TKU 2011-Aug-1
Change History

Apache Foundation Tomcat - Change History

Reports & Attributes

Apache Foundation Tomcat - Reports & Attributes

Publisher Link
Apache Foundation

Product Description

Apache Tomcat is an Application Server, otherwise known as a Web Container, developed at the Apache Software Foundation (ASF).

Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, providing an environment for Java code to run in cooperation with a web server, in addition it adds tools for configuration and management, which can also be configured by editing configuration files that are normally XML-formatted, and includes its own internal HTTP server.

Known Versions

  • 3.2
  • 3.3.x
  • 4.1.x
  • 5.0.x
  • 5.5.x
  • 6.0.x

Software Pattern Summary

Product Component OS Type Versioning Pattern Depth
Tomcat Unix Active, Path, Package Deep
Windows

Platforms Supported by the Pattern

The current pattern identifies an instance of Apache Tomcat Application Server running on both Unix/Linux and Microsoft Windows platforms.

Identification

Software Instance Triggers

Trigger Node Attribute Condition Argument
DiscoveredProcess cmd matches regex'\bjava([w]?\.exe)?$'
or
regex'(^|/)jsvc'
args regex'org\.apache\.catalina\.startup\.(?:Bootstrap|Tomcat|Main)'
or
cmd matches regex'(?i)\btomcat[1-9]?\.exe$'
or
regex'(?i)\btomcatservice\.exe$'
or
regex'(?i)\bjk_nt_service\.exe$'

The pattern will stop immediately if it encounters '-Dcom.sun.web.console.base' in the trigger process command line arguments indicating it has triggers off the Tomcat component within Sun Java Web Console.

Simple Identification Mappings

The following components/processes are identified using the combination of pattern definitions and simple identity mappings which map other known (but deemed less important in terms of application modeling) processes. For further details on the processes treated as primes, see Section Application Model Produced by Software Pattern.

Name Command
Apache Tomcat Servlet Engine regex'\bjava([w]?\.exe)?$', regex '^.*org\.apache\.catalina\.startup\.Bootstrap'
regex'\bjava([w]?\.exe)?$', regex '^.*org\.apache\.tomcat\.startup\.Tomcat'
regex'\bjava([w]?\.exe)?$', regex '^.*org\.apache\.tomcat\.startup\.Main'
regex'(^|/)jsvc', regex'(^|/)jsvc', regex '^.*org\.apache\.catalina\.startup\.Bootstrap'
regex'(^|/)jsvc', regex'(^|/)jsvc', regex '^.*org\.apache\.tomcat\.startup\.Tomcat'
regex'(^|/)jsvc', regex'(^|/)jsvc', regex '^.*org\.apache\.tomcat\.startup\.Main'
regex'(?i)\btomcat[1-9]?\.exe$'
regex'(?i)\btomcatservice\.exe$'
Jakarta NT Service Wrapper for Tomcat regex'(?i)\bjk_nt_service\.exe$'
Apache Tomcat Service Manager (Windows) regex'(?i)\btomcat[4-9]w\.exe$'

Versioning

Version information for the product is currently collected using one of three possible methods. We execute the methods in order based on their accuracy, depth and reliability.

Active Versioning

We have been able to identify two methods to actively version this product. The first provides a good level of reliability on all platforms, while the second is Unix only and may be successful on those platforms where the first method fails.

Common Functionality

Obtaining the arguments

The first step for both active versioning techniques is to try to identify the base installation directory. This is obtained by parsing the JAVA arguments. On UNIX these arguments can be obtained by looking at the trigger process arguments. For Windows the method of obtaining the arguments is more complicated and only attempted for Atrium Discovery version 8.1 and above

On Windows, the arguments of the Tomcat process are not included in the trigger process and must be obtained from the registry.
The pattern looks in the registry for all sub directories of HKEY_LOCAL_MACHINE\\SOFTWARE\\Apache Software Foundation\\Procrun 2.0 . If it can find a registry key of the form:

  • HKEY_LOCAL_MACHINE\\SOFTWARE\\Apache Software Foundation\\Procrun 2.0\\<directory name>\\Paramaters\\Log\\Path

    then the pattern will take the java arguments to be

  • HKEY_LOCAL_MACHINE\\SOFTWARE\\Apache Software Foundation\\Procrun 2.0\\<directory name>\\Paramaters\\Java\\Options

    If several registry keys match the first entry is used

Parsing the arguments.

The pattern attempts to obtain the following attributes from the JAVA arguments

  • Catalina_base, using regular expression: (?i)\-Dcatalina\.base="?(.+?)"?\s+"?-D
  • Catalina_home, using regular expression: (?i)\-Dcatalina\.home="?(.+?)"?\s+"?-D
  • Classpath, using regular expression: (?i)\s(?:-classpath|-cp) \"(.+?)\"\s
  • Alternative classpath regular expression: (?i)\s(?:-classpath|-cp) ([^ ]+)

Cross Platform Active Command

The cross platform active version method is to try and access the release notes of the identified Tomcat process.

If we have been able to extract the "catalina.base" directory from the processes arguments then we use the value found in the argument as the base directory. From there we attempt to open the RELEASE-NOTES.txt file that can be found in the webapps/ROOT directory.

Windows File: %catalina_base%\webapps\ROOT\RELEASE-NOTES.txt
Unix File: %catalina_base%/webapps/ROOT/RELEASE-NOTES.txt

Once we have opened the file we then parse the content against a regex to extract the version information.

File Regex: (?i)Apache Tomcat Version\s+(\d(?:\.\d+)*)

We have found that this approach provides a version number upto 4 levels of depth.

Unix Active Versioning

The Unix specific version command requires knowing the installation directory of the Java VM running Tomcat, and we acquire this information using one of two methods.

First we try to extract the information by parsing the ouput of the 'env' command for JAVA_HOME environment variable.

Executed Command: env | grep JAVA_HOME

The output is parsed using the following regular expression:

Regex: "JAVA_HOME=(\S+)"

If we were unable to extract the JAVA_HOME value from the Environment then we will try to extract the installation path from the Tomcat process command line, if it is a standard java binary (i.e. not being run as java service).

Once we have acquired a valid value we will execute a script found in the Tomcat installation path with an argument value of 'version':

Executed Command: JAVA_HOME="%java_home%"; export JAVA_HOME; %catalina_home%/bin/catalina.sh version; unset JAVA_HOME

From the returned command we then extract the version number using the following regular expressions in order of preference:

cmd Regex: Server number:\s*(\d+(?:\.\d+)*)
cmd Regex: [vV]ersion:\s*Apache Tomcat/(\d+(?:\.\d+)*)

This approach usually returns a version between 3 to 4 levels of depth.

Path Versioning

If we are unable to acquire the version by using an active versioning method we will attempt to parse the process's command line to see if we can identify any installation patterns.

First we concatenate the process's command into a single value. This allows us to achieve a greater level of success as the process cmd may not contain a path.

Path Regex: (?i)tomcat[-/_ ]?(\d(?:[_\-\.]\d+)*)

If we acquire a version from the path then we normalise it to ensure that all versions are returned in a common format.

This usually returns a version between 2 to 4 levels of depth.

Package Versioning

If we are unable to extract the version information from either the Active Command or Path regex then we will attempt to query the package management system to identify a specific version.

We supply the package query with a set of regex's to be checked for.

Regex List

  • tomcat$
  • tomcat\d+$

This usually returns a version between 3 to 4 levels of depth.

Though this method is often successful it is no specific to an installation, and this may result in the version information for a Tomcat installation being inaccurate if there are multiple installations on the host.

Alternative Versioning Approach

Registry Versioning

From version 5.0 onwards Apache Tomcat on Windows has had information stored in the Registry. We have identified the following registry keys that returns the information:
Registry Keys

  • HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\5.0\Version
  • HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\5.5\version
  • HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\6.0\version

Risks

  1. Product version obtained by reading the registry is only used if no other method succeeds. i.e. if a matcher implements multiple versioning methods, and more than one succeeds, Registry versioning has the lowest precedence and may therefore be ignored
  2. Product version can be obtained through Registry only for Tomcat 5.0 and above - thus, if path regex versioning is completely replaced with Registry-based method, while depth of versions obtained is likely to increase, the overall coverage may decrease
  3. Tomcat is often bundled with other applications. This may lead to more than one instance of Tomcat being installed and running on a host. At present, there is no way to directly link the detected process with a value obtained from the Registry. This may lead to false positives.

It is our conclusion that this versioning approach could be used but only once an understanding of the customer environment exists and where the risks listed above have been evaluated and found to be low.

Due to these risks we have not included it in the versioning techniques in the pattern. In the future it would be a consideration.

Future Considerations

An additional Windows versioning technique that can be used is the Registry query. Once we are able to execute this query in a more controlled manner then we will add it to the pattern.

Application Model Produced by Software Pattern

Product Architecture

Tomcat Application server is a container for other application to be run in. It allows for the running of J2EE applications in a controlled web based environment.

As such it sits on top of a webserver and processes requests from the user to the Java application that is being hosted. From an external view there is no visibility of what application Tomcat is hosting, where this application resides or what its purpose is - all you see is Tomcat running on a host.

There is no indication that this product forks, has multiple threads or creates any child processes.

JMX attributes

Various JMX attributes are obtained by the pattern. This is only attempted for Atrium Discovery version 8.1 and above. The attributes are obtained by parsing the JAVA arguments using the following regular expressions:

Attribute Regular expression
jmx_enabledTrue iff -Dcom\.sun\.management\.jmxremote exists
jmx_port-Dcom.sun.management.jmxremote.port=(\d+)
jmx_ssl-Dcom\.sun\.management\.jmxremote\.ssl=(\w+)
jmx_authenticate-Dcom\.sun\.management\.jmxremote\.authenticate=(\w+)
jmx_ssl_need_client_auth-Dcom\.sun\.management\.jmxremote\.ssl\.need\.client\.auth=(\w+)

Software Pattern Model

The pattern triggers on any of the many forms that Tomcat can be run in, either on one of the specific binaries or java/class combinations. Once triggered we are sure that the process is a valid running Tomcat installation.

SI Depth

If catalina base has been discovered an instance based Software Instance is created, with a key based on catalina base, type and host key

If catalina home has been discovered a grouped Software Instance is created, with a key based on catalina home, type and host key

In all other cases a grouped Software Instance is created, with key based on trigger process, JAVA classpath, type and host key

Web Application Discovery

Apache Tomcat web applications discovery is described in detail in our main documentation

Differences to 6.x approach

We can now perform Active Versioning Commands on Windows and Unix. This is due to the functionality to perform additional steps in versioning techniques. Previously we only supported Unix.

Additional Active Version Command has been added for Unix.

Ability to model Software in a unique manner. Previously we could only group Tomcat Application Server using a Footprint model.

Subject Matter Expertise

We have received SME input with regards the Active Versioning technique. It identified the Release Notes text file containing version information in the installation directory of the product.

Any further SME input would be welcome on any other potential approaches to improving Tomcat versioning coverage and depth or with regards identifying the applications running on a particular installation.

Testing

Testing to ensure the processes related to Apache Tomcat Server have been correctly identified has been performed using Foundation record data as well as live discovery of hosts running Solaris, Linux and Windows operating systems.

Both live discovery and record data contained enough information to extract the version information using the path regular expression methods.

Information Sources

Tomcat Wikipedia was used to gather information on the product and produced a lot of the product description. It was also used as the source for some of our known versions.

The official Apache Tomcat homepage was used to identify some versioning techniques and completed the information we had on known versions.

Open Issues

There are no outstanding issues with this pattern.

TOP

Created by: Luke 02:33, 15 November 2007 (PST)
Reviewed by: Edoardo 16:28, 22 November 2007 (GMT)
Updated by: Chris Blake 11:56, 10 May 2009 (GMT)
Updated by: Chris Blake 11:00 24 Dec 2009 (GMT)
Updated by: Chris Blake 12:35 03 Feb 2010 (GMT)
Updated by: Chris Blake 12:35 08 Feb 2010 (GMT)
Updated by: Vadym Ratniuk 12:35 16 Mar 2011 (GMT)
Updated by: [Rebecca Shalfield] 14:55 16 Aug 2011 (GMT)
Reviewed by: Chris Blake 18:14 16 Aug 2011 (GMT)

Skip to end of metadata
Go to start of metadata
Labels:
products products Delete
package_versioning package_versioning Delete
path_versioning path_versioning Delete
active_versioning active_versioning Delete
additional_attributes additional_attributes Delete
application_server_software_platforms application_server_software_platforms Delete
apache_foundation apache_foundation Delete
tku_2011-aug-1 tku_2011-aug-1 Delete
active_command active_command Delete
open_source open_source Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.