Servlet Container Configuration

This section contains specific notes about configuring WAF for specific servlet containers.

Basic Servlet Configuration

To prevent the enterprise.init from running twice at server startup, either:

Tomcat

Tomcat 3.x

Red Hat does not recommend using Tomcat 3.x due to several well-known bugs and performance problems. Instead, use Tomcat 4, the successor to Tomcat 3, which has vastly improved performance and stability.

If you must use Tomcat 3.3.x, make sure that your web.xml contains the following lines:

<servlet>
  <servlet-name>jsp</servlet-name>
  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
</servlet>

Alternatively, set the useJspServlet attribute of the JspInterceptor tag to "true" in server.xml. Not doing so will result in a NullPointerException when viewing any JSP page.

Remove /etc/tomcat3/conf/apps-admin.xml ($TOMCAT_HOME/conf/apps-admin.xml on a non-RPM install) or edit it and change path="/admin" to path="/tomcat-admin".

Tomcat 4.x

NoteNote
 

Do not use Tomcat 4.0.3. It will result in a security exception at server startup. Instead, use Tomcat 4.0.6 (or later) or Tomcat 4.1.x.

There are several changes that you will have to manually make to your Tomcat 4 installation to make it work properly with WAF.

First, if you are using an RPM of Tomcat, open the file:

/usr/bin/dtomcat4

Otherwise open the file:

$CATALINA_HOME/bin/setclasspath.sh

Change the line

CLASSPATH="$JAVA_HOME"/lib/tools.jar

to read as:

CLASSPATH="$CLASSPATH":"$JAVA_HOME"/lib/tools.jar

Next, you need to make sure that certain Tomcat environment variables are set when Tomcat is started. If you are using an RPM of Tomcat, open /etc/tomcat4/tomcat4.conf and add the following line to the bottom of the file:

. /var/www/ccm-core-cms/conf/tomcat-env.sh

If you are not using an RPM, then open $CATALINA_HOME/bin/catalina.sh and add the previous line directly after the line that reads BASEDIR="$CATALINA_HOME".

In /etc/tomcat4/server.xml (or $CATALINE_HOME/conf/server.xml for a non-RPM version of Tomcat), remove the examples context. Then, add the following context:

<Context path=""
docBase="/var/www/ccm-core-cms/dist"
debug="2"
reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="ccm-core-cms."
suffix=".log"
timestamp="true"/>
</Context>

Tomcat 4.1.x uses the AElfred non-validating parser instead of the Xerces parser. To use Xerces instead, add

JAVA_OPTS="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl";
export JAVA_OPTS

to

/usr/share/ccm-core-cms/conf/tomcat4/tomcat-env.sh.in

If you use, Tomcat 4.1.x, remove servlet.jar from your web application. This is due to a difference between the servlet 2.2 and 2.3 specifications.

NoteNote
 

j2ee.jar includes a Tomcat reference implementation that you should not use. If you have a j2ee.jar in your CLASSPATH, make sure that your tomcat.jar comes before your j2ee.jar.

Resin

If JAVA_HOME is set incorrectly, or is not set and the JDK is installed in a nonstandard location, Resin will die with the error message Bad File Descriptor.

WebSphere 4

WAS requires that the SunJCE.jar library be imported when the application server itself is started, as opposed to when the webapp is started.