Using the Tomcat Agent Feature

Learn how to install and configure a Tomcat Agent in Policy Manager.

Using Admin Console Managing Containers

Supported Platforms: 7.x ONLY

Table of Contents

  1. Introduction
  2. Step 1: Prerequisites
  3. Step 2: Configure Tomcat Container (GUI / Silent)
  4. Step 3: Install Tomcat Agent Feature
  5. Step 4: Configure Tomcat Agent Feature
  6. Step 5: Register Tomcat Agent Container

Introduction

The Tomcat Agent feature is the policy enforcement point for the Apache Tomcat application server and provides WS-Policy enforcement for web services deployed to Tomcat. It can only be deployed in a Container deployed in a Tomcat instance and only supports the Apache Axis 1.4 SOAP framework.

Step 1: Prerequisites

  • Installation of one of the supported platform versions.
  • Apache Tomcat Server must be installed on your machine.

Back to top

Step 2: Configure Tomcat Container (GUI / Silent)

GUI Configuration

  1. Launch the Configure Container Instance Wizard. Navigate to the Platform release directory c:\<release directory>\bin and enter:

    - startup.bat configurator (Windows)
    - startup.sh configurator (UNIX)
  2. Define the Tomcat container (TomcatAgent) and Default Admin User.
  3. On the Instance Configuration Options screen, select the Tomcat deployment option.
  4. On the Tomcat Settings screen, deploy the instance to an existing Tomcat installation. Specify the Tomcat Host, Tomcat Port, Context Path, and Browse the Root Directory of your Tomcat Installation (C:\apache-tomcat-6.0.18). If you select the Root Directory, the corresponding Application Base will be selected by default. Click Next to continue.

    Note: The Tomcat Server must be in a stopped state before proceeding with the installation. If the Tomcat Server is running, an error message will be raised.



    If the selected Root Directory is invalid, the following warning message displays. Select a valid Root Directory and click Next to continue. The Instance Configuration Summary screen displays.




    If the Tomcat Server is running the following warning message displays. Stop the Tomcat Server and click Next to continue. The Instance Configuration Summary screen displays.



  5. Select an Instance Startup Option, and indicate whether you would like the Administration Console to auto-start at the end of the configuration.
  6. On the Instance Configuration Summary screen, review the summary information and click Finish. If you chose to auto-launch the Administration Console, the script that displays on the bottom of the screen will say "starting <instance name>."
  7. To continue configuring the Tomcat deployment, start the Tomcat Server. When the Tomcat Container has successfully started, the message "STARTED [90] bundle(s)" displays.



  8. After the Tomcat Container has successfully started, launch the Administration Console using the following URL format http://[computer name]:[port]/ContextPath/admin/

    Example:

    http://localhost:8080/TomcatAgent/admin/login.html

    After the Administration Console launches, navigate to the Available Features tab and install and configure the Tomcat Agent. Refer to Step 3: Install Tomcat Agent Feature.

Back to top

Silent Configuration

The Configure Container Instance Wizard can be set up to run in an automated mode (i.e., silent). This is done by defining a properties file and pre-defining a set of property values to be used by the Configure Container Instance Wizard to automatically configure a Container instance.

  1. Define a properties file (e.g., myprops.properties).
  2. Add the following default content:

    container.instance.name=instancename
    credential.username = administrator
    credential.password = password
    default.host=localhost
    default.port=9901

    tomcat.root.dir= C\:/tomcat 6.0
    tomcat.context.path=/soa
    tomcat.application.base= C\:/tomcat 6.0\webapps

    Base Properties

    The following properties are used for Standalone and Embedded Deployments:

    • container.instance.name - Name of the Container.
    • credential.username - Username for logging into the Administration Console.
    • credential.password - Password for logging into the Administration Console.
    • default.host - Host for the Container Instance.
    • default.port - Port for the Container Instance.

    Tomcat Properties

    The following properties are used for Tomcat Deployments only and combined with Base Properties.

    • tomcat.root.dir - Specify the Tomcat "Root Directory."
    • tomcat.context.path - Specify the Tomcat "Context Path"
    • tomcat.application.base - Specify the Tomcat "Application Base"

    Run the silent configuration. The Configure Container Instance Wizard (Silent Configuration) properties file accepts three system properties which together are used to perform a silent configuration:

    • silent (If True, silent configuration will be performed)
    • deploymentName ("Standalone"or "Tomcat")
    • properties (location on filesystem of property file to be used for configuration)

    Windows and UNIX script examples:


    Windows:
    \<release directory>\bin>startup.bat configurator "-Dsilent=true" "-DdeploymentName=Tomcat" "-Dproperties=C:/<property file directory location>/myprops.properties"

    UNIX

    \<release directory>\bin>startup.sh configurator -Dsilent=true -DdeploymentName=Tomcat -Dproperties=/export/home/username/<property file directory location>\myprops.properties

Back to top

Step 3: Install Tomcat Agent Feature

  1. Launch the Administration Console (http://<hostname:<port>/admin/).
  2. On the Installed Features screen, select Feature from the Filter menu.
  3. Select the Tomcat Agent feature and click Install Feature.
  4. Note: If you are configuring a delegate on Tomcat, also install the Delegate feature as part of this sequence.
  5. After the installation is complete, click Configure and continue to Step 5.

Back to top

Step 4: Configure Tomcat Agent Feature

  1. On the WS-MetaDataExchange Options screen, enter the following "Metadata Exchange Service" URL:

    http://localhost:9900/wsmex

  2. After completing your entry, click Finish, review the summary information, then Go To Next Task.
  3. On the Select Key Management Options screen, select a Key Management Option and click Next to continue. The Generate PKI Keys & X.509 Certificate option is the most commonly used default option. Refer to Managing Keys for information about available options.
  4. After completing the key configuration, click Finish, then Close.
  5. Log out of the Administration Console and restart the Tomcat Agent Container:


Back to top

Step 5: Register Tomcat Agent Container

  1. Log into the Policy Manager Management Console (http://<hostname:<port>/ms/index.do/), and navigate to Organization > Containers.
  2. On the Containers Summary screen click Add Container.
  3. Specify the container type (SOA Container), container metadata, add metadata certificate to trusted CA (if applicable), and container details.



  4. Complete your entries and click Finish, then Close. The Container Details page for the Tomcat Agent displays.



  5. Next you will enable service discovery. In the Service Discovery Configuration portlet, click Modify Service Discovery Options.


    The screen is organized as follows:
    • Discovery Agent is deployed - A checkbox toggle feature that allows you to deploy a "Discovery Agent." In the enabled state (i.e., checked), specify a URL the represents the location of the "Discovery Agent" in the "Agent URL" text box. 
    • Agent URL - A field display that allows you to specify the Agent URL used to contact the Container "Discovery Agent." The source of the URL is based on your initial Container configuration and supported application server.
    • Discover and automatically manage services - Enables the "Discovery Agent." With this option, when a new service is added to the Application Server, the Discovery Agent registers the service in the Policy Manager, applies the appropriate policies, and immediately begins to monitor service activity.
    • Discover services only - Enables the "Discovery Agent." When you select this option, the "Discovery Agent" registers the service in the Policy Manager data repository and posts the service to the Discovered Services Portlet. With this option, policy enforcement and monitoring only begins after you select the Manage Service action in the console.
    • Do not discover services - Disables the Service Discovery functionality.
  6. Configure a service discovery option and click Apply. Your configuration changes are updated on the Containers Summary screen.

Back to top