You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Tomcat and Web Servers

Hi, This is a test of this page being writeable by everybody.

Introduction

A lot of questions get raised in the mailing list concerning Tomcat integration with various web servers. These questions get answered sooner or later, but many times the answers get spread across mulitple messages or subjects.

There are two major methods for connecting Tomcat to a web server. With each method, there are up to three mechanisms which depend on the operating system and web server used.

This document is going to cover simple configurations for many of the more commonly used combinations. In particular, this document will discuss the following:

  1. Tomcat 4(or 5) and mod_jk2 (Tomcat/Jk2Generic)
  2. Tomcat 4.1.x and Apache 2.0.x on Linux with mod_jk2 and IP sockets (LinuxJK2)
  3. Tomcat 4.1.x and Apache 2.0.x on Linux with mod_jk and IP sockets (LinuxJK)
  4. Tomcat 4.1.x and IIS on Windows/2000 Professional with mod_jk and IP sockets (WinJKIIS)
  5. Tomcat 4.1.x and IIS on Windows/2000 Professional with mod_jk2 and IP sockets (WinJK2IIs)
  6. Tomcat 4.1.x and Apache 2.0.x on Windows/2000 Professional with mod_jk and IP sockets (WinJKApache)
  7. Tomcat 4.1.x and Apache 2.0.x on Windows/2000 Professional with mod_jk2 and IP sockets (WinJK2Apache)

My Environment

Web - Application Servers

I have a development machine that is set up for dual boot. Each operating system has a separate disk.

  • Linux Operating System
    • Linux Redhat 9 2.4.20-9
    • Tomcat 4.1.29
    • Apache 2.0.48 with mod_jk2/2.0.2
    • Tomcat - Apache connection is via IP sockets

I can also run mod_jk on this system by changing the appropriate configurations.

Apache and the connectors were installed from source. I do this since I'm not confortable with Redhat rpm's for these packages. I also enable all modules that come with Apache, and add mod_perl, mod_python, and mod_php. Subversion is on my list of todo items.

  • Windows System
    • Windows/2000 Professional with latest security patches
    • Tomcat 4.1.29
    • Apache 2.0.47 with mod_jk2/2.0.2
    • Tomcat - Apache connection is via IP sockets
    • IIS 5 with isapi_redirector2.dll
    • Tomcat - IIS 5 connection is via IP sockets

I can also run mod_jk on this system by changing configurations. This is usually more of a pain than it is worth. Apparently the registry entries for mod_jk and mod_jk2 cannot coexist, so changing between the two configurations for IIS 5 involves editing the registry in addition to the Tomcat and IIS 5 reconfigurations.

All packages were installed by using the appropriate Windows installer. I have not installed the latest Visual C++ compiler on my machine, nor do I have all of the other libraries available to build the complete module set.

I normally run the Tomcat - Apache combination on Windows/2000 Professional. The Tomcat - IIS 5 connection is set up for cross-webserver testing.

Normal Work Mode

I normally do my development and writing on the Linux side, followed by testing on Windows/2000. It's really more of a personal preference issue for me, since I have the same development environment (emacs, emacs xae, emacs jde, j2sdk 1.4.2, Netbeans or Eclipse, ant, forrest, cvs) on both operating systems. I find that running a portable development environment allows me to concentrate on information, and not on machine / OS differences. However, that is a topic for another paper.

Prerequisites

Since this document covers basic connectivity between Tomcat and either Apache 2.0.x or IIS 5, there are a few prerequisites.

  1. Tomcat 4.1.x installed and verified
    1. For Windows/2000, Tomcat 4.1.x will be run as a service
    2. For Linux, Tomcat 4.1.x is run as user tomcat
  2. Apache 2.0.x or IIS 5 installed and verified
    1. For Windows/2000 Apache 2.0.x will be run as a service
    2. For Linux, Apache 2.0.x is started as root, but run as user apache
  3. Binaries for the appropriate mod_jk / mod_jk2
    1. Windows binaries are available at the appropriate Apache mirror
    2. UNIX source available at the appropriate Apache mirror
  4. Access to the appropriate system accounts
    1. Windows/2000
    2. Windows account that can start and stop services
    3. Windows account that can edit registry settings
    4. Linux
    5. Linux account that can start and stop Tomcat and Apache
    6. Linux account to edit Tomcat and Apache configuration files

This document will NOT cover how to build the UNIX mod_jk.so or mod_jk2.so. Separate instructions are available in the mail archives. Writing a companion document for that is on my todo list.

MarkupLanguageSupport

Both Tomcat and Apache handle DotHtml and DotJsp files. How do they differ in handling:

  • No labels