Configuring Apache Tomcat

Topics:

The App Studio installation provided the option to install and configure Apache Tomcat for you. If you chose this option and the verification tool ran successfully, you do not need to manually configure Tomcat. However, if you are not familiar with Tomcat, you may wish to review this section to understand the configuration process.

Note:
  • If Tomcat is not yet installed, install it at this time. You can install Tomcat by restarting the App Studio installation program, choosing the Full Install option, choosing the Apache Tomcat installation option, and deselecting the App Studio option.
  • Tomcat uses TCP ports 8080, 8009, and 8005 by default. If you need to change them, see Tomcat Ports.
  • If App Studio installs Tomcat, it increases the default Java VM memory options. If you manually install Tomcat or need to troubleshoot memory issues, see Java Memory Issues.

Tomcat Configuration Overview

To configure Tomcat, you tell Tomcat where App Studio files are located and the contexts in which to use them. For example, the WebFOCUS web application is installed with App Studio in:

drive:\ibi\AppStudio82\webapps\webfocus

Tomcat must know to serve files from the web application when it receives a request for the ibi_apps context path. For example:

http://localhost:8080/ibi_apps

Tomcat can be used as both a web server and application server, so Tomcat can also serve files outside of a web application after it knows their location and context. On a traditional web server, you create aliases. With Tomcat, an alias is treated like a context root, even when serving files outside of a web application.

  • When using Tomcat as both web and application server, the following contexts must be created:

    Context (path)

    Directory (DocumentBase)

    /ibi_apps
    drive:\ibi\AppStudio82\webapps\webfocus
    /ibi_apphelp
    drive:\ibi\AppStudio82\webapps\ibi_apphelp
    /approot
    drive:\ibi\apps
  • When using Tomcat as the application server and IIS as the web server, create only one context on Tomcat:

    Context (path)

    Directory (DocumentBase)

    /ibi_apps
    drive:\ibi\AppStudio82\webapps\webfocus
    /ibi_apphelp
    drive:\ibi\AppStudio82\webapps\ibi_apphelp

    The ibi_apphelp and approot contexts are then created as aliases (Virtual Directories) on IIS and IIS is configured to send requests for ibi_apps to Tomcat.

Configuring Tomcat

How to:

There are many ways to configure Tomcat. It is recommended that you create XML files under:

<catalina_home>\conf\Catalina\localhost

where:

<catalina_home>

Is the actual location of your Tomcat installation directory. For example:

drive:\ibi\tomcat

or

C:\Program Files\Apache Software Foundation\tomcat x.x.

Context roots can be created as specified in the following steps.

Procedure: How to Create Contexts for Apache Tomcat

  1. Stop Tomcat from Windows Services by right-clicking Apache Tomcat and selecting Stop.
  2. Navigate to the following directory in File Explorer:
    <catalina_home>\conf\Catalina\localhost

    This directory can contain XML files that define contexts. If the App Studio installation installed and configured Tomcat for you, the following files should appear to define the ibi_apps context that deploys the webfocus directory:

    approot.xml
    ibi_apps.xml

    If you are using stand-alone Tomcat, the following file should appear as well:

    ibi_apphelp.xml

    The XML files are named for the context root you would use to access the web application and should have the following syntax:

    <?xml version='1.0' encoding='utf-8'?>
    <Context docBase="path_To_WebApplication" path="/contextRoot">
    </Context>

    where:

    path_To_WebApplication

    Is the absolute path to the WAR file or directory you are deploying.

    contextRoot

    Is the context root.

    Note: They can optionally contain additional information, as explained in Tomcat documentation.

  3. If the ibi_apps.xml file does not exist, create it using Notepad. For example:
    <?xml version='1.0' encoding='utf-8'?>
    <Context docBase="C:\ibi\AppStudio82\webapps\webfocus" path="/ibi_apps">
    </Context>

    Be sure to specify the correct directory on your machine and change the context root if you are not using the default (ibi_apps).

  4. If you are using stand-alone Tomcat and approot.xml does not exist, create it using Notepad. For example:
    <?xml version='1.0' encoding='utf-8'?>
    <Context docBase="C:\ibi\apps" path="/approot">
    </Context>

    Be sure to specify the correct directory on your machine.

  5. If you are using stand-alone Tomcat and ibi_apphelp.xml does not exist, create it using Notepad. For example:
    <?xml version='1.0' encoding='utf-8'?>
    <Context docBase="C:\ibi\AppStudio82\webapps\ibi_apphelp" path="/ibi_apphelp">
    </Context>

    Be sure to specify the correct directory on your machine.

  6. Restart Tomcat from Windows Services.

Procedure: How to Test the Tomcat Configuration

  1. Ensure that Tomcat has been restarted.
  2. Test the ibi_apps context by going to the following URL in a web browser:
    http://localhost:8080/ibi_apps/

    The WebFOCUS Home Page should appear. If you receive an error, see Troubleshooting App Studio.

Additional Tomcat Configuration Options

Reference:

You should be aware of how to secure the Tomcat Manager Web Tool, Tomcat TCP ports, and how to reload web applications.

Reference: Tomcat Ports

By default, Tomcat uses the three TCP ports listed below:

Default Port

Name

Use

8080

HTTP Listener Port

You access Tomcat in a web browser using this port. For example:

http://localhost:8080
8009

Connector Port

Web servers can route servlet requests to Tomcat on this port. The Tomcat Connector for IIS uses this port. Tomcat listens on this port even if no web server is connecting.

8005

Shutdown Port

Tomcat uses this port for internal operations and for shutting down.

If these ports are not available or you wish to change them, do the following:

  1. Open the following file in a text editor:
    <catalina_home>\conf\server.xml
  2. Search for the port numbers you wish to replace (8080, 8009, 8005) and replace them with the ports you wish to use.
  3. Save and exit the file.
  4. Restart Tomcat.

If you change defaults, substitute accordingly in procedures and examples. You also need to update the App Studio connection settings so it knows the correct Tomcat HTTP port if you change the default.

Reference: Reloading Web Applications

This is not a consideration if you just installed Tomcat with App Studio for the first time, only when installing a service pack or new release. When you upgrade App Studio or install a service pack, Tomcat must use the new web application rather than cached copies of the old version.

To clear the Tomcat cache, delete the content in the following directory and restart Tomcat:

<catalina_home>\work\

Reference: Additional Configuration Steps

If you are using Tomcat as the application server and IIS as the web server, configure IIS, as explained in the next section.

Apache Tomcat Application Server Unicode Configuration

To set up a Unicode environment, follow these steps:

  1. Edit the server.xml file located under drive:\ibi\tomcat\conf.
  2. Add useBodyEncodingForURI="true" to the Connector, as shown in the following image.
    Configuration XML example
  3. Recycle the Tomcat Application Server to activate.

Deploying the App Studio Help on a Remote Application Server

This section is required if you are deploying the App Studio Help system on a remote application server. The App Studio Help web application must be deployed to an application server.

If Tomcat is your remote application server, you can do one of the following:

  • Copy the ibi\AppStudio82\webapps\ibi_apphelp folder to the following location, and restart Tomcat.
    <catalina_home>\webapps

or

  • Create a context that points to the deployed Help web application. Create the context ibi_apphelp.xml, and place it in the following location:
    <catalina_home>\conf\Catalina\localhost\

    The xml should include the following syntax:

    <?xml version='1.0' encoding='utf-8'?>
    <Context docBase="drive:\ibi\AppStudio82\webapps\ibi_apphelp" path="/ibi_apphelp">
    </Context>

To configure the App Studio Help on a remote application server other than Tomcat, you must deploy the ibi_apphelp.xml web application to the server.

WebFOCUS

Feedback