Beruflich Dokumente
Kultur Dokumente
This document explains how to connect Tomcat to the popular open source web server, Apache.
Other important documents:
Introduction
As stated in the Tomcat User's Guide, Tomcat currently supports three modes of execution.
While it is entirely possible to have Tomcat serve both your static and dynamic document
provision needs, there are several reasons why you might not want want to do this. With respect
to the Apache web server,
For all these reasons it is recommended that real-world sites use an industrial-strength web
server, such as Apache, for serving static content, and use Tomcat as a Servlet/JSP add-on.
In a nutshell a web server is waiting for requests. When these requests arrive the server does
whatever is needed to serve the requests by providing the necessary content. Adding Tomcat to
the mix may somewhat change this behavior. Now the web server needs to perform the
following:
Before the first request can be served, Apache needs to load a web server adapter library
(so Tomcat can communicate with Apache) and initialize it.
When a request arrives, Apache needs to check and see if it belongs to a servlet; if so it
needs to let the adapter take the request and handle it.
What's required to pull this off?
Configuring Tomcat
<!ApacheAJP12support.Thisisalsousedtoshutdowntomcat.
>
<Connector
className="org.apache.tomcat.service.PoolTcpConnector">
<Parametername="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler
"/>
<Parametername="port"
value="8007"/>
</Connector>
To ensure that it is indeed listening on that port, Telnet to it or HTTP request it. The
Ajp12ConnectionHandler will throw an exception (visible in the tomcat log file), and you'll
know it's listening. As far as the web server adapter goes, this is all you really need to know on
the Tomcat side for now.
The next step in integrating Apache with Tomcat is to install a web server adapter. This is the
piece of software that will relay information between Tomcat and Apache. It doesn't really
belong under Apache configuration, and it doesn't really belong under Tomcat configuration, but
it's required for both of them to work together.
mod_jk
It is a completely new Tomcat-Apache plugin that passed adaptation to Tomcat.
mod_jk.so
D:\Apache2.2\conf
Include "%EM_HOME%/emweb/tomcat/conf/auto/mod_jk.conf"
Architecture Diagram