bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / docs / reference / apache.html
1 <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>The Apache Tomcat Connector - Reference Guide - Configuring Apache</title><meta name="author" value="Mladen Turk"><meta name="email" value="mturk@apache.org"><link href="../style.css" type="text/css" rel="stylesheet"></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="4"><!--PAGE HEADER--><tr><td colspan="2"><!--TOMCAT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="left" alt="Apache Tomcat" border="0"></a><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="http://www.apache.org/images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="true"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li></ul><p><strong>Reference Guide</strong></p><ul><li><a href="../reference/workers.html">workers.properties</a></li><li><a href="../reference/uriworkermap.html">uriworkermap.properties</a></li><li><a href="../reference/status.html">Status Worker</a></li><li><a href="../reference/apache.html">Apache HTTP Server</a></li><li><a href="../reference/iis.html">IIS</a></li></ul><p><strong>Generic HowTo</strong></p><ul><li><a href="../generic_howto/quick.html">For the impatient</a></li><li><a href="../generic_howto/workers.html">All about workers</a></li><li><a href="../generic_howto/timeouts.html">Timeouts</a></li><li><a href="../generic_howto/loadbalancers.html">Load Balancing</a></li><li><a href="../generic_howto/proxy.html">Reverse Proxy</a></li></ul><p><strong>Webserver HowTo</strong></p><ul><li><a href="../webserver_howto/apache.html">Apache HTTP Server</a></li><li><a href="../webserver_howto/iis.html">IIS</a></li><li><a href="../webserver_howto/nes.html">Netscape/SunOne/Sun</a></li></ul><p><strong>AJP Protocol Reference</strong></p><ul><li><a href="../ajp/ajpv13a.html">AJPv13</a></li><li><a href="../ajp/ajpv13ext.html">AJPv13 Extension Proposal</a></li></ul><p><strong>Miscellaneous Documentation</strong></p><ul><li><a href="../miscellaneous/faq.html">Frequently asked questions</a></li><li><a href="../miscellaneous/changelog.html">Changelog</a></li><li><a href="http://issues.apache.org/bugzilla/buglist.cgi?query_format=advanced&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;product=Tomcat+Connectors&amp;long_desc_type=substring&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;keywords_type=allwords&amp;keywords=&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;cmdtype=doit&amp;order=Reuse+same+sort+as+last+time&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">Current Tomcat Connectors bugs</a></li><li><a href="../miscellaneous/doccontrib.html">Contribute documentation</a></li><li><a href="../miscellaneous/jkstatustasks.html">JK Status Ant Tasks</a></li><li><a href="../miscellaneous/reporttools.html">Reporting Tools</a></li><li><a href="http://tomcat.apache.org/connectors-doc-archive/jk2/index.html">Old JK/JK2 documentation</a></li></ul><p><strong>News</strong></p><ul><li><a href="../news/20110701.html">2011</a></li><li><a href="../news/20100101.html">2010</a></li><li><a href="../news/20090301.html">2009</a></li><li><a href="../news/20081001.html">2008</a></li><li><a href="../news/20070301.html">2007</a></li><li><a href="../news/20060101.html">2006</a></li><li><a href="../news/20050101.html">2005</a></li><li><a href="../news/20041100.html">2004</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left"><table border="0" width="100%" cellspacing="4"><tr><td align="left" valign="top"><h1>The Apache Tomcat Connector - Reference Guide</h1><h2>Configuring Apache</h2></td><td align="right" valign="top" nowrap="true"><small><a href="printer/apache.html"><img src="../images/printer.gif" border="0" alt="Printer Friendly Version"><br>print-friendly<br>version
2                     </a></small></td></tr></table><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Configuration Directives"><strong>Configuration Directives</strong></a></font></td></tr><tr><td><blockquote>
3 <p>
4 Most of the directives are allowed once in the global part of the Apache httpd
5 configuration and once in every &lt;VirtualHost&gt; elements. Exceptions from this rule are
6 explicitly listed in the table below.
7 </p>
8 <p>
9 Most values are inherited from the main server to the virtual hosts.
10 Since version 1.2.20 they can be overwritten in the virtual hosts.
11 Exceptions from this rule are again explicitly listed in the table below.
12 See especially JkMountCopy.
13 </p>
14 <p><font color="#ff0000">
15 Warning: If Apache httpd and Tomcat are configured to serve content from
16 the same filing system location then care must be taken to ensure that httpd is
17 not able to serve inappropriate content such as the contents of the WEB-INF
18 directory or JSP source code.
19 </font></p>
20 <p>
21 This could occur if the httpd DocumentRoot
22 overlaps with a Tomcat Host's appBase or the docBase of any Context. It could
23 also occur when using the httpd Alias directive with a Tomcat Host's appBase or
24 the docBase of any Context.
25 </p>
26 <p>
27 Here are the all directives supported by Apache:
28 </p>
29 <table border="1" cellpadding="5"><tr><th width="20%" bgcolor="#023264"><font color="#ffffff">Directive</font></th><th width="80%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><code>JkWorkersFile</code></td><td align="left" valign="center"><p>
30 The name of a worker file for the Tomcat servlet containers.
31 <br>
32 This directive is only allowed once. It must be put into
33 the global part of the configuration.
34 <br>
35 If you don't use the JkWorkerProperty directives, then you must
36 define your workers with a valid JkWorkersFile. There is no default
37 value.
38 </p></td></tr><tr><td align="left" valign="center"><code>JkWorkerProperty</code></td><td align="left" valign="center"><p>
39 Enables setting worker properties inside Apache configuration file.
40 The syntax is the same as in the JkWorkersFile (usually workers.properties).
41 Simply prefix each line with "JkWorkerProperty" to put it directly into
42 the Apache httpd config files.
43 <br>
44 This directive is allowed multiple times.
45 It must be put into the global part of the configuration.
46 <br>
47 If you don't use the JkWorkerProperty directives, then you must
48 define your workers with a valid JkWorkersFile. There is no default
49 value.
50 <br>
51 This directive is available in jk1.2.7 version and later.
52 </p></td></tr><tr><td align="left" valign="center"><code>JkShmFile</code></td><td align="left" valign="center"><p>
53 Shared memory file name. Used only on unix platforms.
54 The shm file is used by balancer and status workers.
55 <br>
56 This directive is only allowed once. It must be put into
57 the global part of the configuration.
58 <br>
59 The default value is logs/jk-runtime-status.
60 It is highly recommended that the shm file be placed on a local
61 drive and not an NFS share.
62 </p>
63 <p>
64 The shared memory contains configuration and runtime information for load balancer
65 workers and their members. It is need in order that all apache children
66 <ul>
67 <li>share the same status information for load balancing members (OK, ERROR, ...),</li>
68 <li>share the information about load taken by the individual workers,</li>
69 <li>share the information for the parts of the configuration, which are changeable
70 during runtime by status workers.</li>
71 </ul>
72 </p>
73 </td></tr><tr><td align="left" valign="center"><code>JkShmSize</code></td><td align="left" valign="center"><p>
74 Size of the shared memory file name.
75 <br>
76 This directive is only allowed once. It must be put into
77 the global part of the configuration.
78 <br>
79 The default value depends on the platform. It is usually less than 64KB.
80 </p></td></tr><tr><td align="left" valign="center"><code>JkMountFile</code></td><td align="left" valign="center"><p>
81 File containing multiple mappings from a context to a Tomcat worker.
82 It is usually called uriworkermap.properties.
83 <br>
84 For inheritance rules, see: JkMountCopy.
85 <br>
86 There is no default value.
87 </p></td></tr><tr><td align="left" valign="center"><code>JkMountFileReload</code></td><td align="left" valign="center"><p>
88 This directive configures the reload check interval in seconds.
89 The JkMountFile is checked periodically for changes.
90 A changed file gets reloaded automatically. If you set
91 this directive to "0", reload checking is turned off.
92 <br>
93 The default value is 60 seconds.
94 <br>
95 This directive has been added in version 1.2.20 of mod_jk.
96 </p></td></tr><tr><td align="left" valign="center"><code>JkMount</code></td><td align="left" valign="center"><p>
97 A mount point from a context to a Tomcat worker.
98 <br>
99 This directive is allowed multiple times.
100 It is allowed in the global configuration and in VirtualHost.
101 You can also use it inside Location with a different syntax.
102 Inside Location, one omits the first argument (path),
103 which gets inherited from the Location.
104 <br>
105 By default JkMount entries are not inherited from the global
106 server to other VirtualHosts or between VirtualHosts.
107 For the complete inheritance rules, see: JkMountCopy.
108 </p></td></tr><tr><td align="left" valign="center"><code>JkUnMount</code></td><td align="left" valign="center"><p>
109 An exclusion mount point from a context to a Tomcat worker.
110 All exclusion mounts are checked after mapping a request
111 to a tomcat worker. If the request maps also to an exclusion,
112 it will not be forwarded to tomcat, and instead be served locally.
113 <br>
114 This directive is allowed multiple times.
115 It is allowed in the global configuration and in VirtualHost.
116 You can also use it inside Location with a different syntax.
117 Inside Location, one omits the first argument (path),
118 which gets inherited from the Location.
119 For inheritance rules, see: JkMountCopy.
120 <br>
121 This directive is available in jk1.2.7 version and later.
122 </p></td></tr><tr><td align="left" valign="center"><code>JkAutoAlias</code></td><td align="left" valign="center"><p>
123 Automatically Alias webapp context directories into the Apache
124 document space.
125 <br>
126 Care should be taken to ensure that only static content is served via httpd as a
127 result of using this directive. Any static content served by httpd will bypass any
128 security constraints defined in the application's web.xml.
129 <br>
130 For inheritance rules, see: JkMountCopy.
131 <br>
132 There is no default value.
133 </p></td></tr><tr><td align="left" valign="center"><code>JkMountCopy</code></td><td align="left" valign="center"><p>
134 If this directive is set to "On" in some virtual server,
135 the mounts from the global server will be copied to this
136 virtual server, more precisely all mounts defined by JkMount
137 or JkUnMount. The Mounts defined by JkMountFile and JkAutoAlias
138 will only be inherited, if the VirtualHost does not define
139 it's own JkMountFile or JkAutoAlias.
140 <br>
141 If you want all vhost to inherit mounts from the main server,
142 you can set JkMountCopy to 'All' in the main server.
143 <br>
144 This directive is only allowed inside VirtualHost (with value "On")
145 and in the global server (with value "All").
146 <br>
147 The default is Off, so no mounts will be inherited from the global
148 server to any VirtualHost.
149 <br>
150 Starting with version 1.2.26 you can also set it to "All" in the
151 global virtual server. This will switch the default to On.
152 </p></td></tr><tr><td align="left" valign="center"><code>JkWorkerIndicator</code></td><td align="left" valign="center"><p>
153 Name of the Apache environment variable that can be used to set worker names
154 in combination with SetHandler jakarta-servlet.
155 <br>
156 This directive is only allowed once per virtual server.
157 It is allowed in the global configuration and in VirtualHost.
158 <br>
159 The default value is JK_WORKER_NAME.
160 </p></td></tr><tr><td align="left" valign="center"><code>JkWatchdogInterval</code></td><td align="left" valign="center"><p>
161 This directive configures the watchdog thread interval in seconds.
162 The workers are maintained periodically by a background thread
163 running periodically every watchdog_interval seconds. Worker maintenance
164 checks for idle connections, corrects load status and is able
165 to detect backend health status.
166 <br>
167 The maintenance only happens, if since the last maintenance at
168 least <a href="workers.html"><b class="code">worker.maintain</b></a>
169 seconds have passed. So setting the JkWatchdogInterval
170 much smaller than <b class="code">worker.maintain</b> is not useful.
171 <br>
172 The default value is 0 seconds, meaning the watchdog thread
173 will not be created, and the maintenance is done in combination
174 with normal requests instead.
175 <br>
176 This directive is only allowed once. It must be put into
177 the global part of the configuration.
178 <br>
179 This directive has been added in version 1.2.27 of mod_jk.
180 It is available only for httpd 2.x and above using APR libraries
181 including thread support.
182 </p></td></tr><tr><td align="left" valign="center"><code>JkLogFile</code></td><td align="left" valign="center"><p>
183 Full or server relative path to the Tomcat Connector module log file.
184 It will also work with pipe, by using a value of the form "| ...".
185 <br>
186 The default value is logs/mod_jk.log.
187 <br>
188 Pipes are supported for Apache 1.3 only since version 1.2.16.
189 The default value exists only since version 1.2.20.
190 </p></td></tr><tr><td align="left" valign="center"><code>JkLogLevel</code></td><td align="left" valign="center"><p>
191 The Tomcat Connector module log level, can be debug, info, warn
192 error or trace.
193 <br>
194 The default value is info.
195 </p></td></tr><tr><td align="left" valign="center"><code>JkLogStampFormat</code></td><td align="left" valign="center"><p>
196 The Tomcat Connector module <b>date</b> log format, using an
197 extended strftime syntax.
198 This format will be used for the time stamps in the JkLogFile.
199 The maximum length of the format is 63 characters.
200 <br>
201 Starting with version 1.2.24 of mod_jk you can also use %Q
202 for adding milliseconds to the log and %q for microseconds. 
203 These conversion specifiers are an extension to strftime.
204 They will only work on platforms with a gettimeofday() function.
205 You can use %Q and %q only once in the pattern and also not both
206 together in the same pattern.
207 <br>
208 The default value is "[%a %b %d %H:%M:%S %Y] " and beginning
209 with version 1.2.24 on platforms with a gettimeofday()
210 function it is "[%a %b %d %H:%M:%S.%Q %Y] ".
211 </p></td></tr><tr><td align="left" valign="center"><code>JkRequestLogFormat</code></td><td align="left" valign="center"><p>
212 Request log format string. See detailed description below.
213 <br>
214 There is no default value. Without defining a value, the request logging
215 is turned off.
216 </p></td></tr><tr><td align="left" valign="center"><code>JkExtractSSL</code></td><td align="left" valign="center"><p>
217 Turns on SSL processing and information gathering by mod_jk
218 <br>
219 The default value is On.
220 <br>
221 In order to make SSL data available for mod_jk in Apache, you need to
222 set <b class="code">SSLOptions +StdEnvVars</b>. For the certificate information you also need
223 to add <b class="code">SSLOptions +ExportCertData</b>.
224 </p>
225 <p>
226   Specifically, mod_jk will export the following environment variables from
227   Apache httpd to Tomcat under these request attributes as per the
228   Servlet Specification 3.0, section 3.8:
229 </p>
230 <table>
231   <tr><th>Env Var</th><th>Request Attribute Name</th><th>Type</th><th>Example</th></tr>
232   <tr>
233     <td>SSL_CIPHER<br>(or <b class="code">JkKEYSIZEIndicator</b>)</td>
234     <td>javax.servlet.request.cipher_suite</td>
235     <td>java.lang.String</td>
236     <td>DHE-RSA-AES256-SHA</td>
237   </tr>
238   <tr>
239     <td>SSL_CIPHER_USEKEYSIZE<br>(or <b class="code">JkKEYSIZEIndicator</b>)</td>
240     <td>javax.servlet.request.key_size</td>
241     <td>java.lang.Integer</td>
242     <td>256</td>
243   </tr>
244   <tr>
245     <td>SSL_SESSION_ID<br>(or <b class="code">JkSESSIONIndicator</b>)</td>
246     <td>javax.servlet.request.ssl_session</td>
247     <td>java.lang.String</td>
248     <td>905...32E (a hex string)</td>
249   </tr>
250   <tr>
251     <td>SSL_CLIENT_CERT_CHAIN_<i>n</i><br>(or <b class="code">JkCERTCHAINPrefix</b><i>n</i>)</td>
252     <td>javax.servlet.request.X509Certificate</td>
253     <td>java.security.X509Certificate[]</td>
254     <td>(A chain of certs in ascending order of trust, the first one being
255         ths client's certificate, the second being the signer of that
256         certificate, and so on)</td>
257   </tr>
258 </table>
259 <p>
260   For all other SSL-related variables, use <b class="code">JkEnvVar</b> for each
261   variable you want. Please note that, like <b class="code">JkEnvVar</b>, these
262   variables are available from the request <i><b>attributes</b></i>, not as
263   environment variables or as request headers.
264 </p>
265 </td></tr><tr><td align="left" valign="center"><code>JkHTTPSIndicator</code></td><td align="left" valign="center"><p>
266 Name of the Apache environment variable that contains SSL indication.
267 <br>
268 The default value is "HTTPS".
269 </p></td></tr><tr><td align="left" valign="center"><code>JkCERTSIndicator</code></td><td align="left" valign="center"><p>
270 Name of the Apache environment variable that contains SSL client certificates.
271 <br>
272 The default value is "SSL_CLIENT_CERT".
273 </p></td></tr><tr><td align="left" valign="center"><code>JkCIPHERIndicator</code></td><td align="left" valign="center"><p>
274 Name of the Apache environment variable that contains SSL client cipher.
275 <br>
276 The default value is "SSL_CIPHER".
277 </p></td></tr><tr><td align="left" valign="center"><code>JkCERTCHAINPrefix</code></td><td align="left" valign="center"><p>
278 Name of the Apache environment (prefix) that contains SSL client chain certificates.
279 <br>
280 The default value is "SSL_CLIENT_CERT_CHAIN_".
281 </p></td></tr><tr><td align="left" valign="center"><code>JkSESSIONIndicator</code></td><td align="left" valign="center"><p>
282 Name of the Apache environment variable that contains SSL session.
283 <br>
284 The default value is "SSL_SESSION_ID".
285 </p></td></tr><tr><td align="left" valign="center"><code>JkKEYSIZEIndicator</code></td><td align="left" valign="center"><p>
286 Name of the Apache environment variable that contains SSL key size in use.
287 <br>
288 The default value is "SSL_CIPHER_USEKEYSIZE".
289 </p></td></tr><tr><td align="left" valign="center"><code>JkLocalNameIndicator</code></td><td align="left" valign="center"><p>
290 Name of the Apache environment variable which can be used to overwrite
291 the forwarded local name.
292 Use this only if you need to adjust the data (see the
293 <a href="../generic_howto/proxy.html">proxy</a> documentation).
294 <br>
295 The default value is "JK_LOCAL_NAME".
296 <br>
297 This directive has been added in version 1.2.28 of mod_jk.
298 </p></td></tr><tr><td align="left" valign="center"><code>JkLocalPortIndicator</code></td><td align="left" valign="center"><p>
299 Name of the Apache environment variable which can be used to overwrite
300 the forwarded local port.
301 Use this only if you need to adjust the data (see the
302 <a href="../generic_howto/proxy.html">proxy</a> documentation).
303 <br>
304 The default value is "JK_LOCAL_PORT".
305 <br>
306 This directive has been added in version 1.2.28 of mod_jk.
307 </p></td></tr><tr><td align="left" valign="center"><code>JkRemoteHostIndicator</code></td><td align="left" valign="center"><p>
308 Name of the Apache environment variable which can be used to overwrite
309 the forwarded remote (client) host name.
310 Use this only if you need to adjust the data (see the
311 <a href="../generic_howto/proxy.html">proxy</a> documentation).
312 <br>
313 The default value is "JK_REMOTE_HOST".
314 <br>
315 This directive has been added in version 1.2.28 of mod_jk.
316 </p></td></tr><tr><td align="left" valign="center"><code>JkRemoteAddrIndicator</code></td><td align="left" valign="center"><p>
317 Name of the Apache environment variable which can be used to overwrite
318 the forwarded remote (client) IP address.
319 Use this only if you need to adjust the data (see the
320 <a href="../generic_howto/proxy.html">proxy</a> documentation).
321 <br>
322 The default value is "JK_REMOTE_ADDR".
323 <br>
324 This directive has been added in version 1.2.28 of mod_jk.
325 </p></td></tr><tr><td align="left" valign="center"><code>JkRemotePortIndicator</code></td><td align="left" valign="center"><p>
326 Name of the Apache environment variable which can be used to overwrite
327 the forwarded remote (client) IP address.
328 Use this only if you need to adjust the data (see the
329 <a href="../generic_howto/proxy.html">proxy</a> documentation).
330 <br>
331 The default value is "JK_REMOTE_PORT".
332 <br>
333 This directive has been added in version 1.2.32 of mod_jk.
334 </p></td></tr><tr><td align="left" valign="center"><code>JkRemoteUserIndicator</code></td><td align="left" valign="center"><p>
335 Name of the Apache environment variable which can be used to overwrite
336 the forwarded user name.
337 Use this only if you need to adjust the data (see the
338 <a href="../generic_howto/proxy.html">proxy</a> documentation).
339 <br>
340 The default value is "JK_REMOTE_USER".
341 <br>
342 This directive has been added in version 1.2.28 of mod_jk.
343 </p></td></tr><tr><td align="left" valign="center"><code>JkAuthTypeIndicator</code></td><td align="left" valign="center"><p>
344 Name of the Apache environment variable which can be used to overwrite
345 the forwarded authentication type.
346 Use this only if you need to adjust the data (see the
347 <a href="../generic_howto/proxy.html">proxy</a> documentation).
348 <br>
349 The default value is "JK_AUTH_TYPE".
350 <br>
351 This directive has been added in version 1.2.28 of mod_jk.
352 </p></td></tr><tr><td align="left" valign="center"><code>JkOptions</code></td><td align="left" valign="center"><p>
353 Set one of more options to configure the mod_jk module. See below for
354 details about this directive.
355 <br>
356 This directive can be used multiple times per virtual server.
357 <br>
358 The default value is "ForwardURIProxy" since version 1.2.24.
359 It was "ForwardURICompatUnparsed" in version 1.2.23 and
360 "ForwardURICompat" until version 1.2.22.
361 </p></td></tr><tr><td align="left" valign="center"><code>JkEnvVar</code></td><td align="left" valign="center"><p>
362 Adds a name and an optional default value of environment variable
363 that should be sent to servlet-engine as a request attribute.
364 If the default value is not given explicitly, the variable
365 will only be send, if it is set during runtime.
366 <br>
367 The default is empty, so no additional variables will be sent.
368 <br>
369 This directive can be used multiple times per virtual server.
370 The settings will be merged between the global server and any
371 virtual server.
372 <br>
373 You can retrieve the variables on Tomcat as request attributes
374 via request.getAttribute(attributeName). Note that the variables
375 send via JkEnvVar will not be listed in request.getAttributeNames().
376 <br>
377 Empty default values are supported since version 1.2.20.
378 Not sending variables with empty defaults and empty runtime value
379 has been introduced in version 1.2.21.
380 </p></td></tr><tr><td align="left" valign="center"><code>JkStripSession</code></td><td align="left" valign="center"><p>
381 If this directive is set to On in some virtual server,
382 the session IDs <b class="code">;jsessionid=...</b> will be
383 removed for non matched URLs.
384 <br>
385 This directive is only allowed inside VirtualHost.
386 <br>
387 The default is Off.
388 <br>
389 This directive has been introduced in version 1.2.21.
390 <br>With version 1.2.27 and later this directive can have optional
391 session ID identifier. If not specified it defaults to
392 <b class="code">;jsessionid</b>.
393 </p>
394 </td></tr></table>
395 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Configuration Directives Types"><strong>Configuration Directives Types</strong></a></font></td></tr><tr><td><blockquote>
396 <p>
397 We'll discuss here the mod_jk directive types.
398 </p>
399
400 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Define workers"><strong>Define workers</strong></a></font></td></tr><tr><td><blockquote>
401 <p>
402 <b>JkWorkersFile</b> specify the location where mod_jk will find the workers definitions.
403 Take a look at <a href="workers.html">Workers documentation</a> for detailed description.
404
405 <div class="example"><pre>
406   JkWorkersFile     /etc/httpd/conf/workers.properties
407 </pre></div>
408
409 <br>
410 <br>
411 </p>
412
413 </blockquote></td></tr></table>
414
415 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Logging"><strong>Logging</strong></a></font></td></tr><tr><td><blockquote>
416 <p>
417 <b>JkLogFile</b> specify the location where mod_jk is going to place its log file.
418 </p>
419
420 <div class="example"><pre>
421   JkLogFile     /var/log/httpd/mod_jk.log
422 </pre></div>
423
424 <p>
425 Since JK 1.2.3 for Apache 2.x and JK 1.2.16 for Apache 1.3 this can also
426 be used for piped logging:
427 </p>
428
429 <div class="example"><pre>
430   JkLogFile     "|/usr/bin/rotatelogs /var/log/httpd/mod_jk.log 86400"
431 </pre></div>
432
433 <p>
434 <b>JkLogLevel</b>
435 set the log level between :
436 </p>
437
438 <ul>
439 <li>
440 <b>info</b> log will contain standard mod_jk activity (default).
441 </li>
442 <li>
443 <b>warn</b> log will contain non fatal error reports.
444 </li>
445 <li>
446 <b>error</b> log will contain also error reports.
447 </li>
448 <li>
449 <b>debug</b> log will contain all information on mod_jk activity
450 </li>
451 <li>
452 <b>trace</b> log will contain all tracing information on mod_jk activity
453 </li>
454 </ul>
455
456 <div class="example"><pre>  
457   JkLogLevel    info
458 </pre></div>
459
460 <p>
461 <b class="code">info</b> should be your default selection for normal operations.
462 <br>
463 <br>
464 </p>
465
466 <p>
467 <b>JkLogStampFormat</b> will configure the date/time format found on mod_jk log file. 
468 Using the strftime() format string it's set by<br>
469 default to <b>"[%a %b %d %H:%M:%S %Y]"</b>
470 </p>
471
472 <div class="example"><pre>
473   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
474 </pre></div>
475
476 <p>
477 <br>
478 <br>
479 </p>
480
481 <p>
482 <b>JkRequestLogFormat</b> will configure the format of mod_jk individual request logging. 
483 Request logging is configured and enabled on a per virtual host basis. 
484 To enable request logging for a virtual host just add a JkRequestLogFormat config. 
485 The syntax of the format string is similar to the Apache LogFormat command, 
486 here is a list of the available request log format options:
487 </p>
488
489 <p>
490 <table border="1" cellpadding="5"><tr><th width="20%" bgcolor="#023264"><font color="#ffffff">Options</font></th><th width="80%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><code>%b</code></td><td align="left" valign="center">Bytes sent, excluding HTTP headers (CLF format)</td></tr><tr><td align="left" valign="center"><code>%B</code></td><td align="left" valign="center">Bytes sent, excluding HTTP headers</td></tr><tr><td align="left" valign="center"><code>%H</code></td><td align="left" valign="center">The request protocol</td></tr><tr><td align="left" valign="center"><code>%m</code></td><td align="left" valign="center">The request method</td></tr><tr><td align="left" valign="center"><code>%p</code></td><td align="left" valign="center">The canonical Port of the server serving the request</td></tr><tr><td align="left" valign="center"><code>%q</code></td><td align="left" valign="center">The query string (prepended with a ? if a query string exists, otherwise an empty string)</td></tr><tr><td align="left" valign="center"><code>%r</code></td><td align="left" valign="center">First line of request</td></tr><tr><td align="left" valign="center"><code>%s</code></td><td align="left" valign="center">Request HTTP status code</td></tr><tr><td align="left" valign="center"><code>%T</code></td><td align="left" valign="center">Request duration, elapsed time to handle request in seconds '.' micro seconds</td></tr><tr><td align="left" valign="center"><code>%U</code></td><td align="left" valign="center">The URL path requested, not including any query string.</td></tr><tr><td align="left" valign="center"><code>%v</code></td><td align="left" valign="center">The canonical ServerName of the server serving the request</td></tr><tr><td align="left" valign="center"><code>%V</code></td><td align="left" valign="center">The server name according to the UseCanonicalName setting</td></tr><tr><td align="left" valign="center"><code>%w</code></td><td align="left" valign="center">Tomcat worker name</td></tr><tr><td align="left" valign="center"><code>%R</code></td><td align="left" valign="center">Real worker name</td></tr></table>
491
492 <div class="example"><pre>
493   JkRequestLogFormat     "%w %V %T"
494 </pre></div>
495
496 <br>
497 <br>
498 </p>
499
500 <p>
501 You can also log mod_jk information using the Apache standard module <b>mod_log_config</b>.
502 The module sets several notes in the Apache httpd notes table.
503 Most of them are are only useful in combination with a load balancer worker.
504 </p>
505
506 <p>
507 <table border="1" cellpadding="5"><tr><th width="20%" bgcolor="#023264"><font color="#ffffff">Note</font></th><th width="80%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><code>JK_WORKER_NAME</code></td><td align="left" valign="center">Name of the worker selected by the URI mapping</td></tr><tr><td align="left" valign="center"><code>JK_WORKER_TYPE</code></td><td align="left" valign="center">Type of the worker selected by the URI mapping</td></tr><tr><td align="left" valign="center"><code>JK_WORKER_ROUTE</code></td><td align="left" valign="center">Actual worker name selected by the URI mapping (usually a member of the load balancer).<br>
508                                                          Before version 1.2.26 only available if JkRequestLogFormat is set.</td></tr><tr><td align="left" valign="center"><code>JK_REQUEST_DURATION</code></td><td align="left" valign="center">Request duration in seconds and microseconds.<br>
509                                                          Before version 1.2.26 only available if JkRequestLogFormat is set.</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_NAME</code></td><td align="left" valign="center">Load-Balancer: Name of the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_TYPE</code></td><td align="left" valign="center">Load-Balancer: Type of the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_ACCESSED</code></td><td align="left" valign="center">Load-Balancer: Access count for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_READ</code></td><td align="left" valign="center">Load-Balancer: Bytes read for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_TRANSFERRED</code></td><td align="left" valign="center">Load-Balancer: Bytes transferred for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_ERRORS</code></td><td align="left" valign="center">Load-Balancer: Error count for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_BUSY</code></td><td align="left" valign="center">Load-Balancer: Busy count for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_ACTIVATION</code></td><td align="left" valign="center">Load-Balancer: Activation state for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_FIRST_STATE</code></td><td align="left" valign="center">Load-Balancer: Error state for the first worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_NAME</code></td><td align="left" valign="center">Load-Balancer: Name of the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_TYPE</code></td><td align="left" valign="center">Load-Balancer: Type of the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_ACCESSED</code></td><td align="left" valign="center">Load-Balancer: Access count for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_READ</code></td><td align="left" valign="center">Load-Balancer: Bytes read for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_TRANSFERRED</code></td><td align="left" valign="center">Load-Balancer: Bytes transferred for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_ERRORS</code></td><td align="left" valign="center">Load-Balancer: Error count for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_BUSY</code></td><td align="left" valign="center">Load-Balancer: Busy count for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_ACTIVATION</code></td><td align="left" valign="center">Load-Balancer: Activation state for the last worker tried</td></tr><tr><td align="left" valign="center"><code>JK_LB_LAST_STATE</code></td><td align="left" valign="center">Load-Balancer: Error state for the last worker tried</td></tr></table>
510
511 <div class="example"><pre>
512   LogFormat     "%h %l %u %t \"%r\" %&gt;s %b %{JK_WORKER_NAME}n %{JK_LB_FIRST_NAME}n \
513                  %{JK_LB_FIRST_BUSY}n %{JK_LB_LAST_NAME}n %{JK_LB_LAST_BUSY}n" mod_jk_log
514   CustomLog     logs/access_log     mod_jk_log
515 </pre></div>
516
517 <br>
518 <br>
519 </p>
520
521 </blockquote></td></tr></table>
522
523 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Forwarding"><strong>Forwarding</strong></a></font></td></tr><tr><td><blockquote>
524 <p>
525 The directive JkOptions allow you to set many forwarding options which will enable (+)
526 or disable (-) following option. Without any leading signs, options will be enabled.
527 <br>
528 <br>
529 </p>
530
531 <p>
532 The four following options <b>+ForwardURIxxx</b> are mutually exclusive.
533 Exactly one of them is required, a negative sign prefix is not allowed with them.
534 The default value is "ForwardURIProxy" since version 1.2.24.
535 It was "ForwardURICompatUnparsed" in version 1.2.23 and
536 "ForwardURICompat" until version 1.2.22.
537 You can turn the default off by switching on one of the other two options.
538 You should leave this at it's default value, unless you have a very good
539 reason to change it.
540 <br>
541 <br>
542 </p>
543
544 <p>
545 All options are inherited from the global server to virtual hosts.
546 Options that support enabling (plus options) and disabling (minus options),
547 are inherited in the following way:
548 <br>
549 <br>
550 options(vhost) = plus_options(global) - minus_options(global) + plus_options(vhost) - minus_options(vhost)
551 <br>
552 <br>
553 </p>
554
555 <p>
556 Using JkOptions <b>ForwardURIProxy</b>, the forwarded URI
557 will be partially reencoded after processing inside Apache httpd and
558 before forwarding to Tomcat. This will be compatible with local
559 URL manipulation by mod_rewrite and with URL encoded session ids.
560
561 <div class="example"><pre>
562   JkOptions     +ForwardURIProxy
563 </pre></div>
564
565 <br>
566 <br>
567 </p>
568
569 <p>
570 Using JkOptions <b>ForwardURICompatUnparsed</b>, the forwarded URI
571 will be unparsed. It's spec compliant and secure.
572 It will always forward the original request URI, so rewriting
573 URIs with mod_rewrite and then forwarding the rewritten URI
574 will not work.
575
576 <div class="example"><pre>
577   JkOptions     +ForwardURICompatUnparsed
578 </pre></div>
579
580 <br>
581 <br>
582 </p>
583
584 <p>
585 Using JkOptions <b>ForwardURICompat</b>, the forwarded URI will
586 be decoded by Apache httpd. Encoded characters will be decoded and
587 explicit path components like ".." will already be resolved.
588 This is less spec compliant and is <b>not safe</b> if you are using
589 prefix JkMount. This option will allow to rewrite URIs with
590 mod_rewrite before forwarding.
591
592 <div class="example"><pre>
593   JkOptions     +ForwardURICompat
594 </pre></div>
595
596 <br>
597 <br>
598 </p>
599
600 <p>
601 Using JkOptions <b>ForwardURIEscaped</b>, the forwarded URI will
602 be the encoded form of the URI used by ForwardURICompat.
603 Explicit path components like ".." will already be resolved.
604 This will not work in combination with URL encoded session IDs,
605 but it will allow to rewrite URIs with mod_rewrite before forwarding.
606
607 <div class="example"><pre>
608   JkOptions     +ForwardURIEscaped
609 </pre></div>
610
611 <br>
612 <br>
613 </p>
614
615 <p>
616 JkOptions <b>RejectUnsafeURI</b> will block all
617 URLs, which contain percent signs '%' or backslashes '\'
618 after decoding.
619 <br>
620 <br>
621 </p>
622 <p>
623 Most web apps do not use such URLs. Using the option RejectUnsafeURI, you
624 can block several well known URL encoding attacks. By default, this option
625 is not set.
626 </p>
627 <p>
628 You can also realise such a check with mod_rewrite, which is more powerful
629 but also slightly more complicated.
630
631 <div class="example"><pre>  
632   JkOptions     +RejectUnsafeURI
633 </pre></div>
634
635 <br>
636 <br>
637 </p>
638
639 <p>
640 JkOptions <b>ForwardDirectories</b> is used in conjunction with <b>DirectoryIndex</b>
641 directive of Apache web server. As such mod_dir should be available to Apache,
642 statically or dynamically (DSO)
643 <br>
644 <br>
645 </p>
646
647 <p>
648 When DirectoryIndex is configured, Apache will create sub-requests for
649 each of the local-url's specified in the directive, to determine if there is a
650 local file that matches (this is done by stat-ing the file).
651 </p>
652
653 <p>
654 If ForwardDirectories is set to false (default) and Apache doesn't find any
655 files that match, Apache will serve the content of the directory (if directive
656 Options specifies Indexes for that directory) or a <b class="code">403 Forbidden</b> response (if
657 directive Options doesn't specify Indexes for that directory).
658 </p>
659
660 <p>
661 If ForwardDirectories is set to true and Apache doesn't find any files that
662 match, the request will be forwarded to Tomcat for resolution. This is used in
663 cases when Apache cannot see the index files on the file system for various
664 reasons: Tomcat is running on a different machine, the JSP file has been
665 precompiled etc. 
666 </p>
667
668 <p>Note that locally visible files will take precedence over the
669 ones visible only to Tomcat (i.e. if Apache can see the file, that's the one
670 that's going to get served). This is important if there is more then one type of
671 file that Tomcat normally serves - for instance Velocity pages and JSP pages.
672
673 <div class="example"><pre>  
674   JkOptions     +ForwardDirectories
675 </pre></div>
676 <br>
677 <br>
678 </p>
679
680 <p>
681 JkOptions <b>ForwardLocalAddress</b>, you ask mod_jk to send the local address,
682 of the Apache web server instead remote client address. This can be used by
683 Tomcat remote address valve for allowing connections only from registered Apache
684 web servers.
685
686 <div class="example"><pre>  
687   JkOptions     +ForwardLocalAddress
688 </pre></div>
689
690 <br>
691 <br>
692 </p>
693
694 <p>
695 JkOptions <b>FlushPackets</b>, you ask mod_jk to flush Apache's connection
696 buffer after each AJP packet chunk received from Tomcat. This option can have
697 a strong performance penalty for Apache and Tomcat as writes are performed
698 more often than would normally be required (ie: at the end of each
699 response).
700
701 <div class="example"><pre>  
702   JkOptions     +FlushPackets
703 </pre></div>
704
705 <br>
706 <br>
707 </p>
708
709 <p>
710 JkOptions <b>FlushHeader</b>, you ask mod_jk to flush Apache's connection
711 buffer after the response headers have been  received from Tomcat.
712
713 <div class="example"><pre>  
714   JkOptions     +FlushHeader
715 </pre></div>
716
717 <br>
718 <br>
719 </p>
720
721 <p>
722 JkOptions <b>DisableReuse</b>, you ask mod_jk to close connections immediately
723 after their use. Normally mod_jk uses persistent connections and pools idle
724 connections to reuse them, when new requests have to be sent to Tomcat.
725 </p>
726
727 <p>
728 Using this option will have a strong performance penalty for Apache and Tomcat.
729 Use this only as a last resort in case of unfixable network problems.
730 If a firewall between Apache and Tomcat silently kills idle connections,
731 try to use the worker attribute socket_keepalive in combination with an appropriate
732 TCP keepalive value in your OS.
733
734 <div class="example"><pre>  
735   JkOptions     +DisableReuse
736 </pre></div>
737
738 <br>
739 <br>
740 </p>
741
742 <p>
743 JkOptions <b>ForwardKeySize</b>,  you ask mod_jk, when using ajp13, to forward also the SSL Key Size  as 
744 required by Servlet API 2.3.
745 This flag shouldn't be set when servlet engine is Tomcat 3.2.x (on by default).
746
747 <div class="example"><pre>  
748   JkOptions     +ForwardKeySize
749 </pre></div>
750
751 <br>
752 <br>
753 </p>
754
755 <p>
756 JkOptions <b>ForwardSSLCertChain</b>,  you ask mod_jk, when using ajp13,
757 to forward SSL certificate chain (off by default).
758 Mod_jk only passes the <b class="code">SSL_CLIENT_CERT</b> to the AJP connector. This is not a
759 problem with self-signed certificates or certificates directly signed by the
760 root CA certificate. However, there's a large number of certificates signed by
761 an intermediate CA certificate, where this is a significant problem: A servlet
762 will not have the possibility to validate the client certificate on its own. The
763 bug would be fixed by passing on the <b class="code">SSL_CLIENT_CERT_CHAIN</b> to Tomcat via the AJP connector.
764 <br>
765 This directive exists only since version 1.2.22.
766 <div class="example"><pre>  
767   JkOptions     +ForwardSSLCertChain
768 </pre></div>
769
770 <br>
771 <br>
772 </p>
773
774 <p>
775 The directive <b>JkEnvVar</b> allows you to forward environment variables
776 from Apache server to Tomcat engine.
777 You can add a default value as a second parameter to the directive.
778 If the default value is not given explicitly, the variable
779 will only be send, if it is set during runtime.
780 <br>
781 The variables can be retrieved on the Tomcat side as request attributes
782 via request.getAttribute(attributeName).
783 Note that the variables send via JkEnvVar will not be listed
784 in request.getAttributeNames().
785 <br>
786 <br>
787 The variables are inherited from the global server to virtual hosts.
788
789 <div class="example"><pre>  
790   JkEnvVar     SSL_CLIENT_V_START     undefined
791 </pre></div>
792 <br>
793 <br>
794 </p>
795
796 </blockquote></td></tr></table>
797
798 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Assigning URLs to Tomcat"><strong>Assigning URLs to Tomcat</strong></a></font></td></tr><tr><td><blockquote>
799 <p>
800 If you have created a custom or local version of mod_jk.conf-local as noted above, 
801 you can change settings such as the workers or URL prefix.
802 </p>
803 <p>
804 <b>JkMount</b> directive assign specific URLs to Tomcat. 
805 In general the structure of a JkMount directive is:
806 </p>
807
808 <div class="example"><pre>  
809   JkMount [URL prefix] [Worker name]
810 </pre></div>
811
812 <div class="example"><pre>
813   # send all requests ending in .jsp to worker1
814   JkMount /*.jsp worker1
815   # send all requests ending /servlet to worker1
816   JkMount /*/servlet/ worker1
817   # send all requests jsp requests to files located in /otherworker will go worker2
818   JkMount /otherworker/*.jsp worker2
819 </pre></div>
820
821 <p>
822 You can use the JkMount directive at the top level or inside &lt;VirtualHost&gt;
823 sections of your httpd.conf file.
824 </p>
825 <p><b>JkUnMount</b> directive acts as an opposite to JkMount and blocks access
826 to a particular URL. The purpose is to be able to filter out the particular content
827 types from mounted context. The following example mounts /servlet/*
828 context, but all .gif files that belongs to that context are not served.
829 </p>
830 <div class="example"><pre>
831   # send all requests ending with /servlet to worker1
832   JkMount /servlet/* worker1
833   # do not send requests ending with .gif to worker1
834   JkUnMount /servlet/*.gif worker1
835 </pre></div>
836 <p>
837 JkUnMount takes precedence over JkMount directives, meaning that the JK
838 will first try to mount and then checks, if there is an exclusion defined by a
839 JkUnMount. A JkUnMount overrides a JkMount only, if the worker names in the
840 JkMount and in the JkUnMount are the same.
841 </p>
842 <p>
843 The following example will block all .gif files although there is a JkMount for them:
844 </p>
845 <div class="example"><pre>
846   # do not send requests ending with .gif to worker1
847   JkUnMount /*.gif worker1
848   # The .gif files will not be mounted cause JkUnMount takes
849   # precedence over JkMount directive
850   JkMount /servlet/*.gif worker1
851 </pre></div>
852 <p>
853 Starting with version 1.2.26 of JK you can apply a JkUnMount to any worker,
854 by using the star character '*' as the worker name in the JkUnMount.
855 More complex patterns in JkUnMount worker names are not allowed.
856 </p>
857 <div class="example"><pre>
858   # Mapping the webapps myapp1 and myapp2:
859   /myapp1/*=worker1
860   /myapp2/*=worker2
861   # Exclude the all subdirectories static for all workers:
862   !/*/static/*=*
863   # Exclude some suffixes for all workers:
864   !*.html=*
865 </pre></div>
866 <p>
867 <b>JkAutoAlias</b> directive automatically <b>Alias</b> webapp context directories into
868 the Apache document space. It enables Apache to serve a static context while Tomcat
869 serving dynamic context. This directive is used for convenience so that you don't
870 have to put an apache Alias directive for each application directory inside Tomcat's
871 webapp directory. For security reasons is is strongly recommended that JkMount
872 is used to pass all requests to Tomcat by default and JkUnMount is used to
873 explicitly exclude static content to be served by httpd. It should also be noted
874 that content served by httpd will bypass any security constraints defined in the
875 application's web.xml.
876 </p>
877 <div class="example"><pre>
878   # enter the full path to the tomcat webapps directory
879   JkAutoAlias /opt/tomtact/webapps
880 </pre></div>
881 <p>The following example shows how to serve a dynamic context by
882 Tomcat and static using Apache. The webapps directory has to
883 be accessible by apache.</p>
884
885 <div class="example"><pre>
886   # enter the full path to the tomcat webapps directory
887   JkAutoAlias /opt/tomtact/webapps
888
889   # Mount 'servlets-examples' directory. It's physical location
890   # is assumed to be in the /opt/tomtact/webapps/servlets-examples
891   # ajp13w is a worker defined in the workers.properties
892   JkMount /servlets-examples/* ajp13w
893
894   # Unmount desired static content from servlets-examples webapp.
895   # This content will be served by the httpd directly.
896   JkUnMount /servlets-examples/*.gif ajp13w
897   JkUnMount /servlets-examples/*.jpg ajp13w
898 </pre></div>
899 <p>Note that you can have a single JkAutoAlias directive per virtual
900 host inside your httpd.conf
901 </p>
902 <p>
903 <b>JkWorkerProperty</b> is a new directive available from JK 1.2.7
904 version. It is a convenient method for setting directives that are
905 usually set inside <b>workers.propeties</b> file. The parameter for
906 that directive is raw line from workers.properties file.
907 </p>
908 <div class="example"><pre>
909   # Just like workers.properties but exact line is prefixed
910   # with JkWorkerProperty
911
912   # Minimal jk configuration
913   JkWorkerProperty worker.list=ajp13w
914   JkWorkerProperty worker.ajp13w.type=ajp13
915   JkWorkerProperty worker.ajp13w.host=localhost
916   JkWorkerProperty worker.ajp13w.port=8009   
917 </pre></div>
918 <p>
919 <b>JkMountFile</b> is a new directive available from JK 1.2.9
920 version. It is used for dynamic updates of mount points at runtime.
921 When the mount file is changed, JK will reload it's content.
922 </p>
923 <div class="example"><pre>
924   # Load mount points
925
926   JkMountFile conf/uriworkermap.properties
927 </pre></div>
928 <p>If the mount point uri starts with an exclamation mark '!'
929 it defines an exclusion in the same way JkUnMount does.
930 If the mount point uri starts with minus sign '-'
931 the mount point will only be disabled. A disabled mount can be reenabled
932 by deleting the minus sign and waiting for the JkMountFile to reload.
933 An exclusion can be disabled by prefixing it with a minus sign.
934 </p>
935 <div class="example"><pre>
936   # Sample uriworkermap.properties file
937
938   /servlets-examples/*=ajp13w
939   # Do not map .jpeg files
940   !/servlets-examples/*.jpeg=ajp13w
941   # Make jsp examples initially disabled  
942   -/jsp-examples/*=ajp13w
943 </pre></div>
944 <p>At run time you can change the content of this file. For example
945 removing minus signs will enable the previously disabled uri mappings.
946 You can add any number of new entries at runtime that reflects the newly deployed
947 applications. Apache will reload the file and update the mount
948 points within 60 second interval.
949 </p>
950 <p>
951 There is no way to delete entries by dynamic reloading, but you can disable or
952 exclude mappings.
953 <br>
954 <br>
955 </p>
956
957 </blockquote></td></tr></table>
958
959 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Using SetHandler and Environment Variables"><strong>Using SetHandler and Environment Variables</strong></a></font></td></tr><tr><td><blockquote>
960 <p>
961 Alternatively to the mod_jk specific directives, you can also use
962 SetHandler and environment variables to control, which requests
963 are being forwarded via which worker. This gives you more flexibility,
964 but the results might be more difficult to understand. If you mix both
965 ways of defining the forwards, in general to mod_jk directives will win.
966 </p>
967 <p>
968 <b>SetHandler jakarta-servlet</b> forces requests to be handled by mod_jk.
969 If you neither specify any workers via JkMount and the related directives,
970 not via the environment variable described below,
971 the first worker in the list of all worker will be chosen. You can use SetHandler
972 for example in Location blocks or with Apache 2.2 also in RewriteRule.
973 </p>
974 <p>
975 In order to control the worker using <b>SetEnvIf</b> or <b>RewriteRule</b>
976 for more complex rules, you can set the environment variable <b>JK_WORKER_NAME</b>
977 to the name of your chosen target worker. This enables you to decide on
978 the chosen worker in a more flexible way, including dependencies on cookie values.
979 This feature has been added in version 1.2.19 of mod_jk.
980 </p>
981 <p>
982 In order to use another variable than <b>JK_WORKER_NAME</b>, you can set the name
983 of this variable via the <b>JkWorkerIndicator</b> directive.
984 </p>
985 <p>
986 You can also define exclusions from mod_jk forwards by setting the environment
987 variable <b>no-jk</b>.
988 </p>
989 <div class="example"><pre>
990   # Automatically map all encoded urls
991   &lt;Location *;jsessionid=&gt;
992     SetHandler jakarta-servlet
993     SetEnv JK_WORKER_NAME my_worker
994   &lt;/Location&gt;
995
996   # Map all subdirs to workers via naming rule
997   # and exclude static content.
998   &lt;Location /apps/&gt;
999     SetHandler jakarta-servlet
1000     SetEnvIf REQUEST_URI ^/apps/([^/]*)/ JK_WORKER_NAME=$1
1001     SetEnvIf REQUEST_URI ^/apps/([^/]*)/static no-jk
1002   &lt;/Location&gt;
1003 </pre></div>
1004 <p>
1005 Finally, starting with version 1.2.27 you can use the environment variable
1006 <b>JK_REPLY_TIMEOUT</b> to dynamically set a reply timeout.
1007 </p>
1008 </blockquote></td></tr></table>
1009  </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
1010         Copyright &copy; 1999-2011, Apache Software Foundation
1011         </em></font></div></td></tr></table></body></html>