Tomcat Servlet Engine


As with Apache, Tomcat is an open-source application. (It is also known by its open-source project name, Jakarta. For more information on the Jakarta project, see http://jakarta.apache.org.) Its specific function is as a servlet container. A servlet is a server-side program that generates dynamic web pages based upon user input. Tomcat provides a runtime environment within which servlets can execute and be managed. Apache Web Server depends on Tomcat to process servlets and Java Server Pages (JSP).

As with Apache, two instances of Tomcat can be loaded on an OES Linux server. The first is an admin instance that is used in conjunction with the Apache admin server to support the various management tools and other services available with OES Linux. The admin instance of Tomcat is loaded automatically when OES Linux is installed.

The second instance is a public copy that is used in support of web applications that are served from the OES Linux server. You will use this version to build your own web environment.

NOTE

Tomcat provides basic servlet and JSP support for OES Linux. For a more robust web application development environment, Novell offers Novell exteNd Application Server. For more information on Novell exteNd offerings, see the OES Linux online documentation, and visit http://www.novell.com/solutions/extend/.


Installing and Configuring Tomcat

Because Tomcat is useless without a web server with which to interoperate, Tomcat is normally installed in conjunction with Apache Web Server. For information on installing Apache and Tomcat, see the Apache installation section earlier in this chapter.

By default, OES Linux installs Tomcat 4 configuration files into the /etc/opt/novell/tomcat4 directory structure. If a second instance or public version of Tomcat is installed, these configuration files will normally be installed in the /etc/tomcat directory.

The admin (OES-specific) version of Tomcat requires no additional configuration in order to be operational. However, it is still a good idea to understand the important configuration files for Tomcat. The following list contains the most important configuration files for the admin instance of Tomcat:

  • server.xml Main configuration file for Tomcat. This file is located in the /etc/opt/novell/tomcat4 directory.

  • jk_module.conf The main configuration file for the Jakarta-Apache plug-in. This file is located in the /etc/opt/novell/httpd/gconf.d directory.

  • workers.properties Contains configuration information that connects servlets to Tomcat worker processes. This file is located in the /etc/opt/novell/httpd/gconf.d directory.

The public version of Tomcat uses the same configuration files; however, they are typically located within the /etc/tomcat directory. For more information on configuring Tomcat for use outside of OES, refer to the Tomcat documentation.

Managing Tomcat

Tomcat does not require much management with OES as the configuration should be completed by the OES installation, and the Tomcat service should be started automatically at server startup. However, you may encounter a situation where you want to start or stop the Tomcat service manually. To do so with the admin version of Tomcat, the following init script must be executed with a start or stop command-line parameter:

 /etc/init.d/novell-tomcat4 

If you are also running a public version of Tomcat, the init script for that instance of Tomcat is normally as follows:

 /etc/init.d/tomcat 

Tomcat Log Files

Another important aspect of managing Tomcat is analyzing and troubleshooting any errors that might be encountered. In the event errors are seen, understanding the important log files used by Tomcat will lead to much quicker identification and resolution of any problems.

Table 14.2 lists the important log files used by Tomcat 4 and each log file's purpose.

Table 14.2. Important Tomcat Log Files

LOG FILE

LOCATION

DESCRIPTION

mod_jk.log

/var/log/apache2

Contains all errors associated with the Tomcat plug-in for Apache. Use the JkLogLevel directive in jk_module.conf to increase the log level if more information is required.

catalina.out

/var/opt/novell/tomcat4/logs

Contains Tomcat startup information. Use this file to verify port configuration or troubleshoot any startup or shutdown problem.

localhost_log

/var/opt/novell/tomcat4/logs

These files contain servlet-specific messages and errors.


TIP

For more information on Tomcat, see the OES Linux online documentation, and visit the comprehensive Tomcat documentation site at http://jakarta.apache.org.




    NovellR Open Enterprise Server Administrator's Handbook SUSE LINUX Edition
    Novell Open Enterprise Server Administrators Handbook, SUSE LINUX Edition
    ISBN: 067232749X
    EAN: 2147483647
    Year: 2005
    Pages: 178

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net