| [66] | 1 | <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Configuration Reference - The AJP Connector</title><meta value="Remy Maucherat" name="author"><meta value="remm@apache.org" name="email"><meta value="Yoav Shapira" name="author"><meta value="yoavs@apache.org" name="email"><meta value="Andrew R. Jaquith" name="author"><meta value="arjaquith@mindspring.com" 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 Configuration Reference</h1><h2>The AJP Connector</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="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote> | 
|---|
|  | 4 |  | 
|---|
|  | 5 | <p>The <strong>AJP Connector</strong> element represents a | 
|---|
|  | 6 | <strong>Connector</strong> component that communicates with a web | 
|---|
|  | 7 | connector via the <code>AJP</code> protocol.  This is used for cases | 
|---|
|  | 8 | where you wish to invisibly integrate Tomcat 6 into an existing (or new) | 
|---|
|  | 9 | Apache installation, and you want Apache to handle the static content | 
|---|
|  | 10 | contained in the web application, and/or utilize Apache's SSL | 
|---|
|  | 11 | processing.</p> | 
|---|
|  | 12 |  | 
|---|
|  | 13 | <p>This connector supports load balancing when used in conjunction with | 
|---|
|  | 14 | the <code>jvmRoute</code> attribute of the | 
|---|
|  | 15 | <a href="engine.html">Engine</a>.</p> | 
|---|
|  | 16 |  | 
|---|
|  | 17 | <p>The native connectors supported with this Tomcat release are: | 
|---|
|  | 18 | <ul> | 
|---|
|  | 19 | <li>JK 1.2.x with any of the supported servers</li> | 
|---|
|  | 20 | <li>mod_proxy on Apache httpd 2.x (included by default in Apache HTTP Server 2.2), | 
|---|
|  | 21 | with AJP enabled: see | 
|---|
|  | 22 | <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html">the httpd docs</a> | 
|---|
|  | 23 | for details.</li> | 
|---|
|  | 24 | </ul> | 
|---|
|  | 25 | </p> | 
|---|
|  | 26 |  | 
|---|
|  | 27 | <p><b>Other native connectors supporting AJP may work, but are no longer supported.</b></p> | 
|---|
|  | 28 |  | 
|---|
|  | 29 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote> | 
|---|
|  | 30 |  | 
|---|
|  | 31 | <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Common Attributes"><strong>Common Attributes</strong></a></font></td></tr><tr><td><blockquote> | 
|---|
|  | 32 |  | 
|---|
|  | 33 | <p>All implementations of <strong>Connector</strong> | 
|---|
|  | 34 | support the following attributes:</p> | 
|---|
|  | 35 |  | 
|---|
|  | 36 | <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><code>allowTrace</code></td><td valign="center" align="left"> | 
|---|
|  | 37 | <p>A boolean value which can be used to enable or disable the TRACE | 
|---|
|  | 38 | HTTP method. If not specified, this attribute is set to false.</p> | 
|---|
|  | 39 | </td></tr><tr><td valign="center" align="left"><code>emptySessionPath</code></td><td valign="center" align="left"> | 
|---|
|  | 40 | <p>If set to <code>true</code>, all paths for session cookies will be set | 
|---|
|  | 41 | to <code>/</code>. This can be useful for portlet specification implementations. | 
|---|
|  | 42 | If not specified, this attribute is set to <code>false</code>.</p> | 
|---|
|  | 43 | </td></tr><tr><td valign="center" align="left"><code>enableLookups</code></td><td valign="center" align="left"> | 
|---|
|  | 44 | <p>Set to <code>true</code> if you want calls to | 
|---|
|  | 45 | <code>request.getRemoteHost()</code> to perform DNS lookups in | 
|---|
|  | 46 | order to return the actual host name of the remote client.  Set | 
|---|
|  | 47 | to <code>false</code> to skip the DNS lookup and return the IP | 
|---|
|  | 48 | address in String form instead (thereby improving performance). | 
|---|
|  | 49 | By default, DNS lookups are enabled.</p> | 
|---|
|  | 50 | </td></tr><tr><td valign="center" align="left"><code>maxPostSize</code></td><td valign="center" align="left"> | 
|---|
|  | 51 | <p>The maximum size in bytes of the POST which will be handled by | 
|---|
|  | 52 | the container FORM URL parameter parsing. The feature can be disabled by | 
|---|
|  | 53 | setting this attribute to a value less than or equal to 0. | 
|---|
|  | 54 | If not specified, this attribute is set to 2097152 (2 megabytes).</p> | 
|---|
|  | 55 | </td></tr><tr><td valign="center" align="left"><code>maxSavePostSize</code></td><td valign="center" align="left"> | 
|---|
|  | 56 | <p>The maximum size in bytes of the POST which will be saved/buffered by | 
|---|
|  | 57 | the container during FORM or CLIENT-CERT authentication. For both types | 
|---|
|  | 58 | of authentication, the POST will be saved/buffered before the user is | 
|---|
|  | 59 | authenticated. For CLIENT-CERT authentication, the POST is buffered for | 
|---|
|  | 60 | the duration of the SSL handshake and the buffer emptied when the request | 
|---|
|  | 61 | is processed. For FORM authentication the POST is saved whilst the user | 
|---|
|  | 62 | is re-directed to the login form and is retained until the user | 
|---|
|  | 63 | successfully authenticates or the session associated with the | 
|---|
|  | 64 | authentication request expires. The limit can be disabled by setting this | 
|---|
|  | 65 | attribute to -1. Setting the attribute to zero will disable the saving of | 
|---|
|  | 66 | POST data during authentication. If not specified, this attribute is set | 
|---|
|  | 67 | to 4096 (4 kilobytes).</p> | 
|---|
|  | 68 | </td></tr><tr><td valign="center" align="left"><code>protocol</code></td><td valign="center" align="left"> | 
|---|
|  | 69 | <p>This attribute value must be <code>AJP/1.3</code> to use the AJP | 
|---|
|  | 70 | handler.</p> | 
|---|
|  | 71 | </td></tr><tr><td valign="center" align="left"><code>proxyName</code></td><td valign="center" align="left"> | 
|---|
|  | 72 | <p>If this <strong>Connector</strong> is being used in a proxy | 
|---|
|  | 73 | configuration, configure this attribute to specify the server name | 
|---|
|  | 74 | to be returned for calls to <code>request.getServerName()</code>. | 
|---|
|  | 75 | See <a href="#Proxy Support">Proxy Support</a> for more | 
|---|
|  | 76 | information.</p> | 
|---|
|  | 77 | </td></tr><tr><td valign="center" align="left"><code>proxyPort</code></td><td valign="center" align="left"> | 
|---|
|  | 78 | <p>If this <strong>Connector</strong> is being used in a proxy | 
|---|
|  | 79 | configuration, configure this attribute to specify the server port | 
|---|
|  | 80 | to be returned for calls to <code>request.getServerPort()</code>. | 
|---|
|  | 81 | See <a href="#Proxy Support">Proxy Support</a> for more | 
|---|
|  | 82 | information.</p> | 
|---|
|  | 83 | </td></tr><tr><td valign="center" align="left"><code>redirectPort</code></td><td valign="center" align="left"> | 
|---|
|  | 84 | <p>If this <strong>Connector</strong> is supporting non-SSL | 
|---|
|  | 85 | requests, and a request is received for which a matching | 
|---|
|  | 86 | <code><security-constraint></code> requires SSL transport, | 
|---|
|  | 87 | Catalina will automatically redirect the request to the port | 
|---|
|  | 88 | number specified here.</p> | 
|---|
|  | 89 | </td></tr><tr><td valign="center" align="left"><code>request.registerRequests</code></td><td valign="center" align="left"> | 
|---|
|  | 90 | <p>This attribute controls request registration for JMX monitoring | 
|---|
|  | 91 | of the Connector.  It is enabled by default, but may be turned | 
|---|
|  | 92 | it off to save a bit of memory.</p> | 
|---|
|  | 93 | </td></tr><tr><td valign="center" align="left"><code>scheme</code></td><td valign="center" align="left"> | 
|---|
|  | 94 | <p>Set this attribute to the name of the protocol you wish to have | 
|---|
|  | 95 | returned by calls to <code>request.getScheme()</code>.  For | 
|---|
|  | 96 | example, you would set this attribute to "<code>https</code>" | 
|---|
|  | 97 | for an SSL Connector.  The default value is "<code>http</code>". | 
|---|
|  | 98 | See <a href="#SSL Support">SSL Support</a> for more information.</p> | 
|---|
|  | 99 | </td></tr><tr><td valign="center" align="left"><code>secure</code></td><td valign="center" align="left"> | 
|---|
|  | 100 | <p>Set this attribute to <code>true</code> if you wish to have | 
|---|
|  | 101 | calls to <code>request.isSecure()</code> to return <code>true</code> | 
|---|
|  | 102 | for requests received by this Connector (you would want this on an | 
|---|
|  | 103 | SSL Connector).  The default value is <code>false</code>.</p> | 
|---|
|  | 104 | </td></tr><tr><td valign="center" align="left"><code>URIEncoding</code></td><td valign="center" align="left"> | 
|---|
|  | 105 | <p>This specifies the character encoding used to decode the URI bytes, | 
|---|
|  | 106 | after %xx decoding the URL. If not specified, ISO-8859-1 will be used. | 
|---|
|  | 107 | </p> | 
|---|
|  | 108 | </td></tr><tr><td valign="center" align="left"><code>useBodyEncodingForURI</code></td><td valign="center" align="left"> | 
|---|
|  | 109 | <p>This specifies if the encoding specified in contentType should be used | 
|---|
|  | 110 | for URI query parameters, instead of using the URIEncoding. This | 
|---|
|  | 111 | setting is present for compatibility with Tomcat 4.1.x, where the | 
|---|
|  | 112 | encoding specified in the contentType, or explicitely set using | 
|---|
|  | 113 | Request.setCharacterEncoding method was also used for the parameters from | 
|---|
|  | 114 | the URL. The default value is <code>false</code>. | 
|---|
|  | 115 | </p> | 
|---|
|  | 116 | </td></tr><tr><td valign="center" align="left"><code>useIPVHosts</code></td><td valign="center" align="left"> | 
|---|
|  | 117 | <p>Set this attribute to <code>true</code> to cause Tomcat to use | 
|---|
|  | 118 | the ServerName passed by the native web server to determine the Host | 
|---|
|  | 119 | to send the request to.  The default value is <code>false</code>.</p> | 
|---|
|  | 120 | </td></tr><tr><td valign="center" align="left"><code>xpoweredBy</code></td><td valign="center" align="left"> | 
|---|
|  | 121 | <p>Set this attribute to <code>true</code> to cause Tomcat to advertise | 
|---|
|  | 122 | support for the Srevlet specification using the header recommended in the | 
|---|
|  | 123 | specification.  The default value is <code>false</code>.</p> | 
|---|
|  | 124 | </td></tr></table> | 
|---|
|  | 125 |  | 
|---|
|  | 126 | </blockquote></td></tr></table> | 
|---|
|  | 127 |  | 
|---|
|  | 128 | <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Standard Implementation"><strong>Standard Implementation</strong></a></font></td></tr><tr><td><blockquote> | 
|---|
|  | 129 |  | 
|---|
|  | 130 | <p>To use AJP, you | 
|---|
|  | 131 | must specify the protocol attribute (see above).</p> | 
|---|
|  | 132 |  | 
|---|
|  | 133 | <p><strong>This implementation supports the AJP 1.3 protocol.</strong></p> | 
|---|
|  | 134 |  | 
|---|
|  | 135 | <p>It supports the following additional attributes (in addition to the | 
|---|
|  | 136 | common attributes listed above):</p> | 
|---|
|  | 137 |  | 
|---|
|  | 138 | <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><code>address</code></td><td valign="center" align="left"> | 
|---|
|  | 139 | <p>For servers with more than one IP address, this attribute | 
|---|
|  | 140 | specifies which address will be used for listening on the specified | 
|---|
|  | 141 | port.  By default, this port will be used on all IP addresses | 
|---|
|  | 142 | associated with the server. A value of <code>127.0.0.1</code> | 
|---|
|  | 143 | indicates that the Connector will only listen on the loopback | 
|---|
|  | 144 | interface.</p> | 
|---|
|  | 145 | </td></tr><tr><td valign="center" align="left"><code>backlog</code></td><td valign="center" align="left"> | 
|---|
|  | 146 | <p>The maximum queue length for incoming connection requests when | 
|---|
|  | 147 | all possible request processing threads are in use.  Any requests | 
|---|
|  | 148 | received when the queue is full will be refused.  The default | 
|---|
|  | 149 | value is 10.</p> | 
|---|
|  | 150 | </td></tr><tr><td valign="center" align="left"><code>bufferSize</code></td><td valign="center" align="left"> | 
|---|
|  | 151 | <p>The size of the output buffer to use.  If less than or equal to zero, | 
|---|
|  | 152 | then output buffering is disabled.  The default value is -1 | 
|---|
|  | 153 | (i.e. buffering disabled)</p> | 
|---|
|  | 154 | </td></tr><tr><td valign="center" align="left"><code>connectionTimeout</code></td><td valign="center" align="left"> | 
|---|
|  | 155 | <p>The number of milliseconds this <strong>Connector</strong> will wait, | 
|---|
|  | 156 | after accepting a connection, for the request URI line to be | 
|---|
|  | 157 | presented.  The default value is infinite (i.e. no timeout).</p> | 
|---|
|  | 158 | </td></tr><tr><td valign="center" align="left"><code>executor</code></td><td valign="center" align="left"> | 
|---|
|  | 159 | <p>A reference to the name in an <a href="executor.html">Executor</a> element. | 
|---|
|  | 160 | If this attribute is enabled, and the named executor exists, the connector will | 
|---|
|  | 161 | use the executor, and all the other thread attributes will be ignored.</p> | 
|---|
|  | 162 | </td></tr><tr><td valign="center" align="left"><code>keepAliveTimeout</code></td><td valign="center" align="left"> | 
|---|
|  | 163 | <p>The number of milliseconds this <strong>Connector</strong> will wait for | 
|---|
|  | 164 | another AJP request before closing the connection. | 
|---|
|  | 165 | The default value is to use the value that has been set for the | 
|---|
|  | 166 | connectionTimeout attribute.</p> | 
|---|
|  | 167 | </td></tr><tr><td valign="center" align="left"><code>maxThreads</code></td><td valign="center" align="left"> | 
|---|
|  | 168 | <p>The maximum number of request processing threads to be created | 
|---|
|  | 169 | by this <strong>Connector</strong>, which therefore determines the | 
|---|
|  | 170 | maximum number of simultaneous requests that can be handled.  If | 
|---|
|  | 171 | not specified, this attribute is set to 200. If an executor is associated | 
|---|
|  | 172 | with this connector, this attribute is ignored as the connector will | 
|---|
|  | 173 | execute tasks using the executor rather than an internal thread pool.</p> | 
|---|
|  | 174 | </td></tr><tr><td valign="center" align="left"><code>packetSize</code></td><td valign="center" align="left"> | 
|---|
|  | 175 | <p>This attribute sets the maximum AJP packet size in Bytes. The maximum | 
|---|
|  | 176 | value is 65536. It should be the same as the <code>max_packet_size</code> | 
|---|
|  | 177 | directive configured for mod_jk. Normally it is not necessary to change | 
|---|
|  | 178 | the maximum packet size. Problems with the default value have been | 
|---|
|  | 179 | reported when sending certificates or certificate chains. The default | 
|---|
|  | 180 | value is 8192.</p> | 
|---|
|  | 181 | </td></tr><tr><td valign="center" align="left"><strong><code>port</code></strong></td><td valign="center" align="left"> | 
|---|
|  | 182 | <p>The TCP port number on which this <strong>Connector</strong> | 
|---|
|  | 183 | will create a server socket and await incoming connections.  Your | 
|---|
|  | 184 | operating system will allow only one server application to listen | 
|---|
|  | 185 | to a particular port number on a particular IP address.</p> | 
|---|
|  | 186 | </td></tr><tr><td valign="center" align="left"><code>request.secret</code></td><td valign="center" align="left"> | 
|---|
|  | 187 | <p>Only requests from workers with this secret keyword will be accepted. | 
|---|
|  | 188 | </p> | 
|---|
|  | 189 | </td></tr><tr><td valign="center" align="left"><code>request.shutdownEnabled</code></td><td valign="center" align="left"> | 
|---|
|  | 190 | <p>If true and a secret has been configured, a correctly fomatted AJP | 
|---|
|  | 191 | request (that includes the secret) will shutdown the Tomcat instance | 
|---|
|  | 192 | associated with this connector. This is set to <code>false</code> by | 
|---|
|  | 193 | default.</p> | 
|---|
|  | 194 | </td></tr><tr><td valign="center" align="left"><code>request.useSecret</code></td><td valign="center" align="left"> | 
|---|
|  | 195 | <p>If set to <code>true</code>, then a random value for | 
|---|
|  | 196 | <code>request.secret</code> will be generated. It is for use with | 
|---|
|  | 197 | <code>request.shutdownEnabled</code>. This is set to <code>false</code> | 
|---|
|  | 198 | by default.</p> | 
|---|
|  | 199 | </td></tr><tr><td valign="center" align="left"><code>tcpNoDelay</code></td><td valign="center" align="left"> | 
|---|
|  | 200 | <p>If set to <code>true</code>, the TCP_NO_DELAY option will be | 
|---|
|  | 201 | set on the server socket, which improves performance under most | 
|---|
|  | 202 | circumstances.  This is set to <code>true</code> by default.</p> | 
|---|
|  | 203 | </td></tr><tr><td valign="center" align="left"><code>tomcatAuthentication</code></td><td valign="center" align="left"> | 
|---|
|  | 204 | <p>If set to <code>true</code>, the authetication will be done in Tomcat. | 
|---|
|  | 205 | Otherwise, the authenticated principal will be propagated from the native | 
|---|
|  | 206 | webaserver and used for authorization in Tomcat. | 
|---|
|  | 207 | The default value is <code>true</code>.</p> | 
|---|
|  | 208 | </td></tr></table> | 
|---|
|  | 209 |  | 
|---|
|  | 210 | </blockquote></td></tr></table> | 
|---|
|  | 211 |  | 
|---|
|  | 212 | </blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Nested Components"><strong>Nested Components</strong></a></font></td></tr><tr><td><blockquote> | 
|---|
|  | 213 |  | 
|---|
|  | 214 | <p>None at this time.</p> | 
|---|
|  | 215 |  | 
|---|
|  | 216 | </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> | 
|---|
|  | 217 | Copyright © 1999-2008, Apache Software Foundation | 
|---|
|  | 218 | </em></font></div></td></tr></table></body></html> | 
|---|