Manually Configuring Apache Tomcat With or Without Apache HTTP Server

In this section:

Note: If you chose the option for the WebFOCUS installation to install Tomcat, you can skip this chapter.

This section explains how to install and configure Apache Tomcat, with or without Apache HTTP web server. There are two configurations available when using Apache Tomcat:

This section contains information for installing and configuring Tomcat and setting up the connection between the HTTP and Tomcat Servers. If you are using the HTTP Server, it should already be installed. Apache HTTP Server 2 is recommended, but 1.3 should work.

Steps are the following:

  1. If it is not installed, install Tomcat 7.
  2. Set environment variables and create contexts to deploy WebFOCUS web applications, as explained in Preparing Tomcat for WebFOCUS Configuration.
  3. If you are using Apache HTTP Server to serve WebFOCUS content, create aliases, as explained in Configuring Apache HTTP Server.
  4. If you are using Apache HTTP Server, configure communications between Tomcat and the HTTP Server, as explained in Connecting Apache HTTP and Tomcat Servers.
  5. Verify the configuration, as explained in Verifying the WebFOCUS Configuration With Tomcat and Apache HTTP Server.

Top of page

x
Preparing Tomcat for WebFOCUS Configuration

How to:

To prepare Tomcat for WebFOCUS, you need to choose how to create WebFOCUS graphs and add the ReportCaster JDBC driver.



x
Procedure: How to Configure Tomcat for WebFOCUS Graphs

To generate graphs, WebFOCUS Servlets either need access to an X Server or they can use the Java VM headless option. You can set either by editing the catalina.sh file.



x
Procedure: How to Set the Tomcat CLASSPATH for the WebFOCUS Repository

Before a WebFOCUS application can connect to the WebFOCUS repository, you must first add the location of a JDBC driver to the CLASSPATH in setclasspath.sh.

  1. Open the following file in a text editor:
    /tomcat_home/bin/catalina.sh 
  2. Find the line that sets CLASSPATH. For example:
    CLASSPATH=/home/oracle/oracle/ojdbc6.jar

    Note: If there is more than one jar file, it should be appended, separated by a colon (:).

  3. Append a colon followed by the path to the JDBC drivers for your repository. Include any ZIP or JAR files. For example:
    CLASSPATH="$JAVA_HOME"/lib/tools.jar:/home/oracle/oracle/ojdbc6.jar

    Note: You must include the full path including the file name. Specifying a directory is not sufficient.

  4. Save and close the editor.

Top of page

x
Deploying WebFOCUS Web Applications With Tomcat

How to:

Reference:

Configuring Tomcat mainly requires telling Tomcat where WebFOCUS files are located and the context roots in which to use them. For example, you must tell Tomcat to serve files from the WebFOCUS web application:

/install_directory/ibi/WebFOCUS80/webapps/webfocus

When it receives a request for the WebFOCUS context root:

http://TomcatHost:tomcatHTTPport/ibi_apps

By creating this context, you deploy the WebFOCUS web application.



x
Procedure: How to Create Contexts

There are several ways to create contexts:

This procedure explains how to create contexts using the web-based tools. When you create a context for a web application, the web application is deployed.

To create contexts for Tomcat 7.0, Information Builders recommends creating or editing XML files in the following directory to define the contexts:

/tomcat_home/conf/Catalina/localhost


x
Reference: Reloading Web Applications

This is not a consideration if you just installed WebFOCUS for the first time, but you should be aware of it for when you install a service pack or new release. When you upgrade WebFOCUS or install a service pack, Tomcat must use the new web applications rather than cached copies of the old version.


Top of page

x
Configuring Apache HTTP Server

How to:

Tomcat can be used with or without Apache HTTP Server.

To create aliases, edit the httpd.conf configuration file as explained below making sure to replace install_directory with the correct path on your machine. If you changed the default names for the WebFOCUS aliases and context root (/ibi_apps), substitute accordingly.



x
Procedure: How to Modify the Apache httpd.conf File
  1. Using a text editor, open the httpd.conf file located in the /apache_home/conf directory.
  2. Add the following lines in the Alias section making sure to use the correct install_directory on your machine:
    • Point an alias to the apps directory.
      Alias /approot/ "/install_directory/ibi/apps/"

    For example:

    Alias /approot/ "/home/iadmin/ibi/apps/"
    Alias /icons/ "/usr/apache2/icons/"
  3. Save and close the file.
  4. Restart the HTTP Server.

Top of page

x
Connecting Apache HTTP and Tomcat Servers

How to:

There are many different ways to connect from Apache HTTP Server to Tomcat. This section addresses JK1.2, mod_jk. If you wish to use another approach, such as ProxyPass or JK2, refer to Apache and Tomcat documentation.

The following files are needed for Apache to connect to Tomcat when using JK1.2:

mod_jk.so

Provides binary instructions for Apache to connect to Tomcat. See How to Download or Build the mod_jk.so File.

workers.properties

Provides configuration information needed by the mod_jk.so binary. See How to Create the mod_jk.conf File.

mod_jk.conf

Tells Apache to load the mod_jk.so binary and use settings in workers.properties. See How to Create the workers.properties File.

httpd.conf

Tells Apache to Include mod_jk.conf. See How to Edit httpd.conf to Use JK1.2.

Additional documentation on using the JK1.2 connector is available at:

http://tomcat.apache.org/connectors-doc/index.html


x
Procedure: How to Download or Build the mod_jk.so File

The mod_jk.so binary must be compiled specifically for your platform and Apache HTTP Server release (1.3 or 2.0). Binaries and source code can be downloaded from:

http://jakarta.apache.org/tomcat/connectors-doc/index.html
  1. Test the WebFOCUS web application by going to the following URL in a browser:
    http://TomcatHost:TomcatHTTPport/ibi_apps/diagnostics/about.jsp

    A page should appear displaying information about the current build. For example:

    Version:WEB80

    If the page fails to load, restart Tomcat, and ensure it can compile JSP files. In some environments, the very first time a JSP file is compiled you might receive an error.

  2. If you are using Tomcat as both web and application server, proceed to Verifying the WebFOCUS Configuration With Tomcat and Apache HTTP Server.

The binaries you download will have a long name indicating the platform and Apache release. You should rename this file to mod_jk.so.

If a binary is not available for your platform, you can download the source code and compile it. If you do an online search, you should be able to find information on compiling mod_jk.so. The compiled file may have a different name, such as libmod_jk.so.

The mod_jk.so file should be placed on your system in a directory to which the HTTP Server has at least read permissions.



x
Procedure: How to Create the workers.properties File
  1. If the file does not exist, create the following file in a directory to which Apache HTTP Server has at least read permissions:
    workers.properties

    For example:

    /apache_home/conf/tomcat/workers.properties
  2. Open the file in a text editor to edit or add the following text to the file replacing text in italics with absolute paths:
    workers.tomcat_home=tomcat_home 
    workers.java_home=java_homeps=/
    worker.list=ajp13
    worker.ajp13.port=8009 
    worker.ajp13.host=localhost
    worker.ajp13.type=ajp13

    where:

    tomcat_home

    Is the installation directory for Apache Tomcat. Use an absolute path.

    java_home

    Is the installation directory for the Java JDK. Use an absolute path.

    8009

    Is the Ajp13 port defined in server.xml. 8009 is the default, but if you changed this, provide the new value.



x
Procedure: How to Create the mod_jk.conf File
  1. If the file does not exist, create the following file in a directory to which Apache HTTP Server has read access:
    mod_jk.conf

    For example:

    /apache_home/conf/tomcat/mod_jk.conf
  2. Open the file in a text editor to edit or add the following text to the file replacing /PATH_TO/ with absolute paths to the file in question:
    <IfModule !mod_jk.c>
      LoadModule jk_module /PATH_TO/mod_jk.so
    </IfModule>
    JkWorkersFile "/PATH_TO/workers.properties"
    JkLogFile "/PATH_TO/tomcatjk1.2/mod_jk.log"
    JkLogLevel emerg
    JkMount /ibi_apps ajp13
    JkMount /ibi_apps/* ajp13

    Note: If you changed the default context roots, substitute accordingly.



x
Procedure: How to Edit httpd.conf to Use JK1.2
  1. Using a text editor, open the httpd.conf file located in the /apache_home/conf directory.
  2. Add the following line to the end of the file specifying where the mod_jk.conf file is located on your system:
    Include /PATH_TO/mod_jk.conf

Top of page

x
Verifying the WebFOCUS Configuration With Tomcat and Apache HTTP Server

How to:

After finishing the configuration, run test calls to verify operability.



x
Procedure: How to Verify the WebFOCUS Configuration
  1. Restart the following:
    • WebFOCUS Reporting Server
    • Tomcat
    • Apache HTTP Server (if using the HTTP Server)
  2. Proceed to WebFOCUS Post-Installation Tasks, and run the verification tool. If you use ReportCaster, be sure to later review WebFOCUS ReportCaster Post-Installation Tasks.

Be aware that you may need to increase your Java memory settings if you use InfoAssist. You can do this later, as explained in Java Memory Issues.


WebFOCUS