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:
Note: You can also use Tomcat for all WebFOCUS processing and use the HTTP Sever only to forward requests through a firewall. This is the recommended configuration.
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:
How to: |
To prepare Tomcat for WebFOCUS, you need to choose how to create WebFOCUS graphs and add the ReportCaster JDBC driver.
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.
/tomcat_home/bin/catalina.sh
Near the beginning of the file just after the commented section, add the appropriate DISPLAY definition. For example:
DISPLAY=xserver_host:0.0
export DISPLAY
TERM=xterm
export TERM
where:
Is the hostname or IP Address of a machine that is running an X server.
Note: Graphs are not actually displayed on the machine you set to DISPLAY, but WebFOCUS Servlets must access this X Server to generate graphs. After finishing this chapter, be sure to review the tests to verify graphs in Verifying and Troubleshooting Server Side Graphics (PCHOLD).
/TOMCAT_HOME/bin/catalina.sh
You can add the headless option by setting the $JAVA_OPTS variable. Near the beginning of the file, just after the commented section, add the following line:
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
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.
/tomcat_home/bin/catalina.sh
CLASSPATH=/home/oracle/oracle/ojdbc6.jar
Note: If there is more than one jar file, it should be appended, separated by a colon (:).
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.
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.
Context (path): /ibi_apps
Directory (DocumentBase): /install_directory/ibi/WebFOCUS80/webapps/webfocus
The approot context is then created as aliases on the HTTP Server. The HTTP Server is then configured to send requests for ibi_apps to Tomcat. However, this assumes the HTTP Server handles some WebFOCUS content directly. If you want the HTTP Server to only forward requests through a firewall, do not create aliases on the HTTP Server, but instead configure Tomcat to handle all WebFOCUS content.
Context (path) | Directory (DocumentBase) |
---|---|
/ibi_apps | /install_directory/ibi/WebFOCUS80/webapps/webfocus |
/ibi_help | /install_directory/ibi/WebFOCUS80/webapps/ibi_help |
/approot | /install_directory/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, a traditional web server alias is treated like a context root, even when serving files outside of a web application.
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
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.
/tomcat_home/work/Catalina/localhost/ibi_apps
/tomcat_home/work/Catalina/localhost/ibi_help
Note: The redirect.war file is available for redirecting custom applications with URLs containing rcaster as the ReportCaster context root. If you are planning to deploy this file, you should also remove the following work directory and then restart Tomcat:
/tomcat_home/work/Catalina/localhost/rcaster
/tomcat_home/conf/Catalina/localhost/ibi_apps.xml
/tomcat_home/work/Catalina/localhost/ibi_apps
/tomcat_home/webapps/ibi_apps
Note: When you deploy WAR files, Tomcat expands them into its own directory structure and does not always know the original location.
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.
Alias /approot/ "/install_directory/ibi/apps/"
For example:
Alias /approot/ "/home/iadmin/ibi/apps/" Alias /icons/ "/usr/apache2/icons/"
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:
Provides binary instructions for Apache to connect to Tomcat. See How to Download or Build the mod_jk.so File.
Provides configuration information needed by the mod_jk.so binary. See How to Create the mod_jk.conf File.
Tells Apache to load the mod_jk.so binary and use settings in workers.properties. See How to Create the workers.properties File.
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
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
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.
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.
workers.properties
For example:
/apache_home/conf/tomcat/workers.properties
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:
Is the installation directory for Apache Tomcat. Use an absolute path.
Is the installation directory for the Java JDK. Use an absolute path.
Is the Ajp13 port defined in server.xml. 8009 is the default, but if you changed this, provide the new value.
mod_jk.conf
For example:
/apache_home/conf/tomcat/mod_jk.conf
<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.
How to: |
After finishing the configuration, run test calls to verify operability.
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 |