blob: 68e82dff4e7e502fc2342566c576ce8f6edd984e [file] [log] [blame]
Hongqing Liu71898292014-10-15 13:31:32 +08001<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Architecture (6.0.41) - Architecture Overview</title><meta name="author" content="Yoav Shapira"><style type="text/css" media="print">
Hongqing Liufd5ee812014-05-10 16:32:51 +08002 .noPrint {display: none;}
3 td#mainBody {width: 100%;}
4 </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
5 The Apache Tomcat Servlet/JSP Container
Hongqing Liu71898292014-10-15 13:31:32 +08006 " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.41, May 19 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li></ul><p><strong>Contents</strong></p><ul><li><a href="index.html">Contents</a></li><li><a href="overview.html">Overview</a></li><li><a href="startup.html">Server Startup</a></li><li><a href="requestProcess.html">Request Process</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat Architecture</h1><h2>Architecture Overview</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview"><strong>Overview</strong></a></font></td></tr><tr><td><blockquote>
Hongqing Liufd5ee812014-05-10 16:32:51 +08007<p>
8This page provides an overview of the Tomcat server architecture.
9</p>
10</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Terms"><strong>Terms</strong></a></font></td></tr><tr><td><blockquote>
11
12<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Server"><strong>Server</strong></a></font></td></tr><tr><td><blockquote>
13<p>
14In the Tomcat world, a
15<a href="../config/server.html">Server</a> represents the whole container.
16Tomcat provides a default implementation of the
17<a href="../api/org/apache/catalina/Server.html">Server interface</a>
18which is rarely customized by users.
19</p>
20</blockquote></td></tr></table>
21
22<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Service"><strong>Service</strong></a></font></td></tr><tr><td><blockquote>
23<p>
24A <a href="../config/service.html">Service</a> is an intermediate component
25which lives inside a Server and ties one or more Connectors to exactly one
26Engine. The Service element is rarely customized by users, as the default
27implementation is simple and sufficient:
28<a href="../api/org/apache/catalina/Service.html">Service interface</a>.
29</p>
30</blockquote></td></tr></table>
31
32<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Engine"><strong>Engine</strong></a></font></td></tr><tr><td><blockquote>
33<p>
34An
35<a href="../config/engine.html">Engine</a> represents request processing
36pipeline for a specific Service. As a Service may have multiple Connectors,
37the Engine receives and processes all requests from these connectors, handing
38the response back to the appropriate connector for transmission to the client.
39The <a href="../api/org/apache/catalina/Engine.html">Engine interface</a>
40may be implemented to supply custom Engines, though this is uncommon.
41</p>
42<p>
43Note that the Engine may be used for Tomcat server clustering via the
44jvmRoute parameter. Read the Clustering documentation for more information.
45</p>
46</blockquote></td></tr></table>
47
48<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Host"><strong>Host</strong></a></font></td></tr><tr><td><blockquote>
49<p>
50A <a href="../config/host.html">Host</a> is an association of a network name,
51e.g. www.yourcompany.com, to the Tomcat server. An Engine may contain
52multiple hosts, and the Host element also supports network aliases such as
53yourcompany.com and abc.yourcompany.com. Users rarely create custom
54<a href="../api/org/apache/catalina/Host.html">Hosts</a>
55because the
56<a href="../api/org/apache/catalina/core/StandardHost.html">StandardHost
57implementation</a> provides significant additional functionality.
58</p>
59</blockquote></td></tr></table>
60
61<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Connector"><strong>Connector</strong></a></font></td></tr><tr><td><blockquote>
62<p>
63A Connector handles communications with the client. There are multiple
64connectors available with Tomcat. These include the
65<a href="../config/http.html">HTTP connector</a> which is used for
66most HTTP traffic, especially when running Tomcat as a standalone server,
67and the <a href="../config/ajp.html">AJP connector</a> which implements
68the AJP procotol used when connecting Tomcat to a web server such as
69Apache HTTPD server. Creating a customized connector is a significant
70effort.
71</p>
72</blockquote></td></tr></table>
73
74<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Context"><strong>Context</strong></a></font></td></tr><tr><td><blockquote>
75<p>
76A
77<a href="../config/context.html">Context</a>
78represents a web application. A Host may contain multiple
79contexts, each with a unique path. The
80<a href="../api/org/apache/catalina/Context.html">Context
81interface</a> may be implemented to create custom Contexts, but
82this is rarely the case because the
83<a href="../api/org/apache/catalina/core/StandardContext.html">
84StandardContext</a> provides significant additional functionality.
85</p>
86</blockquote></td></tr></table>
87</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Comments"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote>
88<p>
89Tomcat is designed to be a fast and efficient implementation of the
90Servlet Specification. Tomcat came about as the reference implementation
91of this specification, and has remained rigorous in adhering to the
92specification. At the same time, significant attention has been paid
93to Tomcat's performance and it is now on par with other servlet containers,
94including commercial ones.
95</p>
96<p>
97In recent releases of Tomcat, mostly starting with Tomcat 5,
98we have begun efforts to make more aspects of Tomcat manageable via
99JMX. In addition, the Manager and Admin webapps have been greatly
100enhanced and improved. Manageability is a primary area of concern
101for us as the product matures and the specification becomes more
102stable.
103</p>
104</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
105 Copyright &copy; 1999-2014, Apache Software Foundation
106 </em></font></div></td></tr></table></body></html>