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