| Hongqing Liu | 7189829 | 2014-10-15 13:31:32 +0800 | [diff] [blame^] | 1 | <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 Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 2 | 			.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 Liu | 7189829 | 2014-10-15 13:31:32 +0800 | [diff] [blame^] | 6 |     " 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 Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 7 | <p>
 | 
 | 8 | This 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>
 | 
 | 14 | In the Tomcat world, a
 | 
 | 15 | <a href="../config/server.html">Server</a> represents the whole container.
 | 
 | 16 | Tomcat provides a default implementation of the 
 | 
 | 17 | <a href="../api/org/apache/catalina/Server.html">Server interface</a>
 | 
 | 18 | which 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>
 | 
 | 24 | A <a href="../config/service.html">Service</a> is an intermediate component
 | 
 | 25 | which lives inside a Server and ties one or more Connectors to exactly one
 | 
 | 26 | Engine.  The Service element is rarely customized by users, as the default
 | 
 | 27 | implementation 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>
 | 
 | 34 | An
 | 
 | 35 | <a href="../config/engine.html">Engine</a> represents request processing
 | 
 | 36 | pipeline for a specific Service.  As a Service may have multiple Connectors,
 | 
 | 37 | the Engine receives and processes all requests from these connectors, handing
 | 
 | 38 | the response back to the appropriate connector for transmission to the client.
 | 
 | 39 | The <a href="../api/org/apache/catalina/Engine.html">Engine interface</a>
 | 
 | 40 | may be implemented to supply custom Engines, though this is uncommon.
 | 
 | 41 | </p>
 | 
 | 42 | <p>
 | 
 | 43 | Note that the Engine may be used for Tomcat server clustering via the
 | 
 | 44 | jvmRoute 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>
 | 
 | 50 | A <a href="../config/host.html">Host</a> is an association of a network name,
 | 
 | 51 | e.g. www.yourcompany.com, to the Tomcat server.  An Engine may contain
 | 
 | 52 | multiple hosts, and the Host element also supports network aliases such as
 | 
 | 53 | yourcompany.com and abc.yourcompany.com.  Users rarely create custom
 | 
 | 54 | <a href="../api/org/apache/catalina/Host.html">Hosts</a>
 | 
 | 55 | because the 
 | 
 | 56 | <a href="../api/org/apache/catalina/core/StandardHost.html">StandardHost
 | 
 | 57 | implementation</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>
 | 
 | 63 | A Connector handles communications with the client.  There are multiple
 | 
 | 64 | connectors available with Tomcat. These include the
 | 
 | 65 | <a href="../config/http.html">HTTP connector</a> which is used for
 | 
 | 66 | most HTTP traffic, especially when running Tomcat as a standalone server, 
 | 
 | 67 | and the <a href="../config/ajp.html">AJP connector</a> which implements
 | 
 | 68 | the AJP procotol used when connecting Tomcat to a web server such as
 | 
 | 69 | Apache HTTPD server. Creating a customized connector is a significant
 | 
 | 70 | effort.
 | 
 | 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>
 | 
 | 76 | A
 | 
 | 77 | <a href="../config/context.html">Context</a>
 | 
 | 78 | represents a web application.  A Host may contain multiple
 | 
 | 79 | contexts, each with a unique path.  The
 | 
 | 80 | <a href="../api/org/apache/catalina/Context.html">Context
 | 
 | 81 | interface</a> may be implemented to create custom Contexts, but
 | 
 | 82 | this is rarely the case because the
 | 
 | 83 | <a href="../api/org/apache/catalina/core/StandardContext.html">
 | 
 | 84 | StandardContext</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>
 | 
 | 89 | Tomcat is designed to be a fast and efficient implementation of the
 | 
 | 90 | Servlet Specification.  Tomcat came about as the reference implementation
 | 
 | 91 | of this specification, and has remained rigorous in adhering to the
 | 
 | 92 | specification.  At the same time, significant attention has been paid
 | 
 | 93 | to Tomcat's performance and it is now on par with other servlet containers,
 | 
 | 94 | including commercial ones.
 | 
 | 95 | </p>
 | 
 | 96 | <p>
 | 
 | 97 | In recent releases of Tomcat, mostly starting with Tomcat 5,
 | 
 | 98 | we have begun efforts to make more aspects of Tomcat manageable via
 | 
 | 99 | JMX.  In addition, the Manager and Admin webapps have been greatly
 | 
 | 100 | enhanced and improved.  Manageability is a primary area of concern
 | 
 | 101 | for us as the product matures and the specification becomes more
 | 
 | 102 | stable.
 | 
 | 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 © 1999-2014, Apache Software Foundation
 | 
 | 106 |         </em></font></div></td></tr></table></body></html> |