bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / docs / webserver_howto / iis.html
1 <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>The Apache Tomcat Connector - Webserver HowTo - IIS HowTo</title><meta name="author" value="Henri Gomez"><meta name="email" value="hgomez@apache.org"><meta name="author" value="Gal Shachor"><meta name="email" value="shachor@il.ibm.com"><meta name="author" value="Yoav Shapira"><meta name="email" value="yoavs@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 - Webserver HowTo</h1><h2>IIS HowTo</h2></td><td align="right" valign="top" nowrap="true"><small><a href="printer/iis.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="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
3 <p>
4 This document explains how to set up IIS to cooperate with Tomcat. 
5 </p>
6
7 <p>
8 Normally IIS can not execute Servlets and Java Server Pages (JSPs), 
9 configuring IIS to use the JK ISAPI redirector plugin will let IIS send servlet and 
10 JSP requests to Tomcat (and this way, serve them to clients).
11 </p>
12
13 <p>
14 It is recommended that you also read the
15 <a href="../generic_howto/workers.html">Workers HowTo</a> document
16 to learn how to setup the working entities between your web server and Tomcat Engines.
17 For more detailed configuration information consult the Reference Guide for
18 <a href="../reference/workers.html">workers.properties</a>,
19 <a href="../reference/uriworkermap.html">uriworkermap</a>
20 and <a href="../reference/iis.html">IIS</a>.
21 </p>
22
23
24 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Document Conventions and Assumptions"><strong>Document Conventions and Assumptions</strong></a></font></td></tr><tr><td><blockquote>
25 <p>
26 ${tomcat_home} is the root directory of tomcat. 
27 Your Tomcat installation should have the following subdirectories:
28
29 <ul>
30 <li>
31 ${tomcat_home}\conf - Where you can place various configuration files
32 </li>
33 <li>
34 ${tomcat_home}\webapps - Containing example applications
35 </li>
36 <li>
37 ${tomcat_home}\bin - Where you place web server plugins
38 </li>
39 </ul>
40 </p>
41 <p>
42 In all the examples in this document ${tomcat_home} will be <b>c:\tomcat</b>.
43 A worker is defined to be a tomcat process that accepts work from the IIS server.
44 </p>
45 </blockquote></td></tr></table>
46
47
48 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Supported Configuration"><strong>Supported Configuration</strong></a></font></td></tr><tr><td><blockquote>
49 <p>
50 The IIS-Tomcat redirector was developed and tested on:
51 <ul>
52 <li>
53 WinNT4.0-i386 SP4/SP5/SP6a (should be able to work with other service packs), Win2K and WinXP and Win98
54 </li>
55 <li>
56 IIS4.0 and PWS4.0 (numerous people have working IIS 5 and IIS 6 configurations)
57 </li>
58 <li>
59 Tomcat 3.2 and later, Tomcat 4.x, Tomcat 5 and 5.5 and Tomcat 6
60 </li>
61 </ul>
62 </p>
63
64 <p>
65 The redirector uses <b>ajp12</b> and <b>ajp13</b> to send requests to the Tomcat containers. There is also an option to use Tomcat in process, 
66 more about the in-process mode can be found in the in process howto.
67 </p>
68 </blockquote></td></tr></table>
69
70 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="IIS 5 and 6 Notes"><strong>IIS 5 and 6 Notes</strong></a></font></td></tr><tr><td><blockquote>
71 <p>
72 There are extra steps you need to take for configuring Tomcat with IIS 5 and 6.  Please see the appropriate links from 
73 <a href="http://wiki.apache.org/tomcat/Tomcat/Links">Tomcat Useful Links</a>.
74 </p>
75 </blockquote></td></tr></table>
76
77 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="IIS 7 notes"><strong>IIS 7 notes</strong></a></font></td></tr><tr><td><blockquote>
78 <p>
79 There is a known bug in IIS that may result in incomplete log messages. See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=45769">bug 45769</a>
80 for further details.
81 </p>
82 </blockquote></td></tr></table>
83
84 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Who support ajp protocols ?"><strong>Who support ajp protocols ?</strong></a></font></td></tr><tr><td><blockquote>
85 <p>
86 The ajp12 protocol is only available in Tomcat 3.2.x and 3.3.x.
87 </p>
88
89 <p>
90 The <b>ajp12</b> has been <b>deprecated</b> with Tomcat 3.3.x and you should use instead 
91 <b>ajp13</b> which is the only ajp protocol known by Tomcat 4.x, 5 and 5.5 and Tomcat 6.
92 </p>
93
94 <p>
95 Of course Tomcat 3.2.x and 3.3.x also support ajp13 protocol.
96 </p>
97
98 <p>
99 Others servlet engines such as <b>jetty</b> have support for ajp13 protocol
100 </p>
101
102 </blockquote></td></tr></table>
103
104 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="How does it work ?"><strong>How does it work ?</strong></a></font></td></tr><tr><td><blockquote>
105 <p>
106 <ol>
107 <li>
108 The IIS-Tomcat redirector is an IIS plugin (filter + extension), IIS load the redirector plugin and calls its 
109 filter function for each in-coming request.
110 </li>
111 <li>
112 The filter then tests the request URL against a list of URI-paths held inside uriworkermap.properties, 
113 If the current request matches one of the entries in the list of URI-paths, 
114 the filter transfers the request to the extension.
115 </li>
116 <li>
117 The extension collects the request parameters and forwards them to the appropriate worker using the defined
118 protocol like <b>ajp13</b>.
119 </li>
120 <li>
121 The extension collects the response from the worker and returns it to the browser.
122 </li>
123 </ol>
124 </p>
125 </blockquote></td></tr></table>
126
127 </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="Installation"><strong>Installation</strong></a></font></td></tr><tr><td><blockquote>
128 <p>
129 A pre-built version of the ISAPI redirector server plugin, isapi_redirect.dll, is available under 
130 the win32/i386 directory of tomcat-connectors distribution. 
131 For those using Netscape as your browser, try downloading a zip version of the file, if available. 
132 There can be problems using Netscape to download DLL files.
133
134 You can also build a copy locally from the source present in tomcat-connectors distribution.
135
136 The Tomcat redirector requires three entities:
137
138 <ul>
139 <li>
140 <b>isapi_redirect.dll</b> - The IIS server plugin, either obtain a pre-built DLL or build it yourself (see the build section).
141 </li>
142 <li>
143 <b><a href="../reference/workers.html">workers.properties</a></b> - A file that describes the host(s) and port(s) used by the workers (Tomcat processes). 
144 A sample workers.properties can be found under the conf directory.
145 </li>
146 <li>
147 <b><a href="../reference/uriworkermap.html">uriworkermap.properties</a></b> - A file that maps URL-Path patterns to workers. 
148 A sample uriworkermap.properties can be found under the conf directory as well.
149 </li>
150 </ul>
151 </p>
152
153 <p>
154 The installation includes the following parts:
155
156 <ul>
157 <li>
158 Configuring the ISAPI redirector with a default /examples context and checking that you can serve servlets with IIS.
159 </li>
160 <li>
161 Adding more contexts to the configuration.
162 </li>
163 </ul>
164 </p>
165
166 </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="Configuring the ISAPI Redirector"><strong>Configuring the ISAPI Redirector</strong></a></font></td></tr><tr><td><blockquote>
167 <p>
168 In this document I will assume that isapi_redirect.dll is placed in 
169 <b>c:\tomcat\bin\win32\i386\isapi_redirect.dll</b> and 
170 that the properties files which you created are in <b>c:\tomcat\conf</b>.
171 </p>
172 <p>
173 <ol>
174 <li>
175 In the registry, create a new registry key named
176 <b>"HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0"</b>
177 </li>
178 <li>
179 Add a string value with the name <b>extension_uri</b> and a value of <b>/jakarta/isapi_redirect.dll</b>
180 </li>
181 <li>
182 Add a string value with the name <b>log_file</b> and a value pointing to where you want your 
183 log file to be (for example <b>c:\tomcat\logs\isapi.log</b>).
184 </li>
185 <li>
186 Add a string value with the name <b>log_level</b> and a value for your log level 
187 (can be debug, info, error or emerg).
188 </li>
189 <li>
190 Add a string value with the name <b>worker_file</b> and a value which is the full path 
191 to your workers.properties file (for example <b>c:\tomcat\conf\workers.properties</b>)
192 </li>
193 <li>
194 Add a string value with the name <b>worker_mount_file</b> and a value which is the full path 
195 to your uriworkermap.properties file (for example <b>c:\tomcat\conf\uriworkermap.properties</b>)
196 </li>
197 <li>
198 Using the IIS management console, add a new virtual directory to your IIS/PWS web site.
199 The name of the virtual directory must be jakarta. 
200 Its physical path should be the directory where you placed isapi_redirect.dll 
201 (in our example it is c:\tomcat\bin\win32\i386). 
202 While creating this new virtual directory assign it with execute access.
203 </li>
204 <li>
205 Using the IIS management console, add isapi_redirect.dll as a filter in your IIS/PWS web site. 
206 The name of the filter should reflect its task (I use the name tomcat), 
207 its executable must be our c:\tomcat\bin\win32\i386\isapi_redirect.dll. 
208 For PWS, you'll need to use regedit and add/edit the <b>"Filter DLLs"</b> key under 
209 <b>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters</b>. 
210 This key contains a "," separated list of dlls (full paths) - 
211 you need to insert the full path to isapi_redirect.dll.
212 </li>
213 <li>
214 If you're using IIS 6.0 you must also do the following:
215 <br>
216 Using the IIS management console, add the Jakarta Isapi Redirector to the Web
217 Service Extensions. 
218 <ol>
219 <li>Right-click on Web Service Extensions and choose Add a new Web Service
220 Extension.</li> 
221 <li>Enter tomcat for the Extension Name.</li>
222 <li>Add the isapi_redirect.dll to the required files.</li> 
223 <li>Check the Set extension status to Allowed.</li>
224 <li>Click on OK.</li>
225 </ol>
226 </li>
227 <li>
228 Restart IIS (stop + start the IIS service), make sure that the tomcat filter is marked with a green up-pointing arrow.
229 Under Win98 you may need to <b>cd WINDOWS\SYSTEM\inetsrv</b> and type PWS /stop 
230 ( the DLL and log files are locked - even if you click the stop button, 
231 PWS will still keep the DLLs in memory. ). Type pws to start it again.
232 </li>
233 </ol>
234 </p>
235 <p>
236 That's all, you should now start Tomcat and ask IIS to serve you the /examples context. 
237 Try <a href="http://localhost/examples/jsp/index.html">http://localhost/examples/jsp/index.html</a> for example and 
238 execute some of the JSP examples. 
239 </p>
240 <p>
241 If this does not work successfully, refer to the Troubleshooting section below for help on correcting the problem.
242 </p>
243
244 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Adding additional Contexts"><strong>Adding additional Contexts</strong></a></font></td></tr><tr><td><blockquote>
245 <p>
246 The examples context is useful for verifying your installation, 
247 but you will also need to add your own contexts. Adding a new context requires two operations:
248 </p>
249 <p>
250 <ol>
251 <li>
252 Adding the context to Tomcat (I am not going to talk about this).
253 </li>
254 <li>
255 Adding the context to the ISAPI redirector.
256 </li>
257 </ol>
258 </p>
259 <p>
260 Adding a context to the ISAPI redirector is simple, all you need to do is to edit 
261 your uriworkermap.properties and to add a line that looks like:
262 </p>
263
264 <div class="example"><pre>
265   /context/*=worker_name
266 </pre></div>
267
268 <p>
269 Workers and their name are defined in workers.properties, by default workers.properties comes 
270 with a single pre-configured worker named <b>"defworker"</b> so you can use it. 
271 As an example, if you want to add a context named "shop", the line that you should add to 
272 uriworkermap.properties will be:
273 </p>
274
275 <div class="example"><pre>
276   /shop/*=defworker
277 </pre></div>
278
279 After saving uriworkermap.properties restart IIS and it will serve the new context.
280 <p>
281 The above should be all you need for IIS to pass through to Tomcat any request for any URI which corresponds
282 to a Tomcat context (webapp).
283 </p>
284 </blockquote></td></tr></table>
285
286 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Advanced Context Configuration"><strong>Advanced Context Configuration</strong></a></font></td></tr><tr><td><blockquote>
287 <p>
288 If your webiste is very busy (more than 100 requests/second, or more than 100 simultaneous client connections),
289 it might sometimes be desirable to have IIS serve static content (html, gif, jpeg etc.) directly, 
290 even if these files are part of a context served by Tomcat.  Allowing IIS to serve such files directly may
291  avoid the small overhead consisting of passing the request to Tomcat via the redirector, and may free up
292  Tomcat somewhat, by using it only to process requests that only Tomcat can handle (e.g. requests to JSP pages and java servlets).
293 </p>
294 <p>
295 For example, consider the html and gif files in the examples context : you could serve these files directly
296 with IIS; there is no need to serve them from the Tomcat process.
297 </p>
298 <p><font color="#ff0000">However, you should be very careful when you implement the following configuration style, because by doing so you are
299 in fact providing a "back-door" to IIS, and allowing it to serve files out of a Tomcat context without Tomcat's knowledge,
300 thus bypassing any security
301 restrictions which Tomcat itself and the Tomcat context (webapp) may place on those files.</font></p>
302 <p>
303 Making IIS serve static files that are part of the Tomcat contexts requires the following:
304 <ol>
305 <li>
306 Configuring IIS to know about the Tomcat contexts
307 </li>
308 <li>
309 Configuring the redirector to leave the static files for IIS
310 </li>
311 </ol>
312 </p>
313
314 <p>
315 Adding a Tomcat context to IIS requires the addition of a new IIS virtual directory that covers the Tomcat context. 
316 For example adding a /example IIS virtual directory that covers the c:\tomcat\webapps\examples directory.
317 </p>
318
319 <p>
320 Configuring the redirector is somewhat harder, you will need to specify the exact 
321 URL-Path pattern(s) which you want Tomcat to handle (usually only JSP files and servlets). 
322 This requires a change to the uriworkermap.properties : 
323
324 <div class="example"><pre>
325   For the examples context it requires to replace the following line
326   /examples/*=defworker
327   with the following two lines
328   /examples/*.jsp=defworker
329   /examples/servlet/*=defworker
330 </pre></div>
331 </p>
332
333 <p>
334 As you can see the second configuration is more explicit, it actually instruct the redirector 
335 to redirect only requests to resources under /examples/servlet/ and resources under /examples/ 
336 whose name ends with .jsp. 
337 </p>
338
339 <p>
340 You can even be more explicit and provide lines such as:
341
342 <div class="example"><pre>
343   /example/servletname=defworker
344 </pre></div>
345 </p>
346
347 <p>
348 that instructs the redirector to redirect all requests whose URL-path matches the leading string "/example/servletname" 
349 to the worker named defworker.
350 </p>
351
352 </blockquote></td></tr></table>
353
354 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Protecting the content of your Tomcat contexts"><strong>Protecting the content of your Tomcat contexts</strong></a></font></td></tr><tr><td><blockquote>
355 <p>Once again, be aware that by allowing IIS to access the content of your Tomcat context directly, you are
356 potentially bypassing Tomcat's protection of that content.  You should thus make sure to protect this content
357 at the IIS level if needed, by using the corresponding IIS management console functions. 
358 </p>
359 <p>
360 In particular, each servlet application (context) has a special directory named WEB-INF, 
361 which contains sensitive configuration data and Java classes, and which should always be kept hidden from web users. 
362 Using the IIS management console it is possible to protect the WEB-INF directory from user access, but considering that
363 this is a general requirement, and considering that it is easy to forget to implement this protection
364 at the IIS level, the redirector plugin does it automatically for you, and it will reject any request
365 which contains WEB-INF in its URL-path. 
366 </p>
367 </blockquote></td></tr></table>
368
369 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Advanced Worker Configuration"><strong>Advanced Worker Configuration</strong></a></font></td></tr><tr><td><blockquote>
370 <p>
371 Sometimes you may want to serve different contexts with different Tomcat processes 
372 (for example to spread the load among different machines). 
373 To achieve such a goal you will need to define several workers and assign each context to its own worker.
374 </p>
375 <p>
376 Defining additional workers is done in the workers.properties file. This file includes two types of entries:
377 </p>
378
379 <p>
380 <div class="example"><pre>
381   # An entry that lists all the workers defined
382   worker.list=worker1, worker2
383   # Entries that define the host and port associated with each of these workers
384   worker.worker1.host=localhost
385   worker.worker1.port=8009
386   worker.worker1.type=ajp13
387   worker.worker2.host=otherhost
388   worker.worker2.port=8009
389   worker.worker2.type=ajp13
390 </pre></div>
391 </p>
392
393 <p>
394 The above example defined two workers, now we can use these workers to serve two different contexts 
395 each with its own worker: 
396 <div class="example"><pre>
397   example uriworkermap.properties fragment
398   /examples/*=worker1
399   /webpages/*=worker2
400 </pre></div>
401 </p>
402
403 <p>
404 As you can see the <b>examples</b> context is served by <b>worker1</b> while the 
405 <b>webpages</b> context is served by <b>worker2</b>.
406 </p>
407
408 <p>
409 More information on using and configuring workers in the <a href="../generic_howto/workers.html">Workers HowTo</a>
410 and in the <a href="../reference/workers.html">worker.properties configuration reference</a>.
411 </p>
412
413 </blockquote></td></tr></table>
414
415 </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="Building ISAPI redirector"><strong>Building ISAPI redirector</strong></a></font></td></tr><tr><td><blockquote>
416 <p>
417 The redirector was developed using Visual C++ Ver.6.0, so having this environment is a prerequisite if you want 
418 to perform a custom build. You should also have the IIS developer SDK.
419
420 The steps that you need to take are:
421 <ul>
422 <li>
423 Change directory to the isapi plugins source directory.
424 </li>
425 <li>
426 Make the source with MSDEV
427 </li>
428 </ul>
429 <p class="screen"><div align="left"><table width="80%" border="1" cellspacing="0" cellpadding="2" bgcolor="#000000"><tr><td bgcolor="#000000" align="left"><div class="screen">Change directory to the isapi plugins source directory</div><code><nobr><em class="screen">c:\&gt;</em><b class="screen">cd c:\home\apache\jk\iis</b></nobr></code><br><div class="screen">Build the sources using MSDEV</div><code><nobr><em class="screen">c:\&gt;</em><b class="screen">MSDEV isapi.dsp /MAKE ALL</b></nobr></code><br></td></tr></table></div></p>
430 </p>
431 <p>
432 If msdev is not in your path, enter the full path to msdev.exe. 
433 This will build both release and debug versions of the redirector plugin.
434 An alternative will be to open the isapi workspace file (isapi.dsw) in msdev and 
435 build it using the build menu.
436 </p>
437 </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="Troubleshooting"><strong>Troubleshooting</strong></a></font></td></tr><tr><td><blockquote>
438 <p>
439 It is easy to have the ISAPI redirector not work the first time you try to install it.
440 </p>
441 <p>
442 If this happens to you, here are some steps to follow to try to correct the problem.
443 </p>
444 <p>
445 These steps aren't guaranteed to cover all possible problems, 
446 but they should help find the typical mistakes.
447 </p>
448 <p>
449 If you make any corrections during these steps, restart the IIS service as described above in the last step 
450 of the installation, then retry the step.
451 </p>
452
453 <p>To enable error tracking, make sure web site activity is being logged. 
454 For PWS 4.0 make sure "Save Web Site Activity Log" is checked in the Advanced Options of the Personal Web Manager.
455 </p>
456    
457 <p>
458 Note: These steps assume your <b>worker_mount_file</b> setting points to an unmodified copy of the 
459 <b>uriworkermap.properties</b> file.<br>
460 Results may be misleading if <b>worker_mount_file</b> points to a modified <b>uriworkermap.properties</b>
461 or the <b>uriworkermap.properties-auto</b> file.<br>
462 It is also assumed that the <b>"/examples" context</b> works correctly if you access Tomcat directly.
463 </p>
464
465 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Win98"><strong>Win98</strong></a></font></td></tr><tr><td><blockquote>
466 <p>
467 Start the IIS service and Tomcat.
468 </p>
469 <p>
470 Check for the presence of the ISAPI redirector log file you specified in the log_file setting. 
471 If not found, verify the following:
472 </p>
473 <ul>
474 <li>
475 Check the "Filter DLLs" setting in the "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters" 
476 key and make sure the path is correct.
477 </li>
478 <li>
479 Check the spelling of the "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0" key. 
480 Case isn't important, but an incorrect letter will prevent the isapi_redirect.dll from finding its registry settings.
481 </li>
482 <li>
483 Check the log_file setting for typos, name and data. Also insure the directory in which the log file will appear already exists.
484 </li>
485 If the above are set correctly, the ISAPI redirector should be able to create the log file.
486 </ul>
487 <p>
488 Invoke the URL <a href="http://localhost/examples/jsp/index.html">http://localhost/examples/jsp/index.html</a>
489 in your browser. 
490 Case is important in Tomcat. The characters following "localhost" in the URL must be lower case. 
491 If the page fails to appear, stop the IIS service (required to view the IIS log file). 
492 Then examine the last line in the IIS log file in found in SYSTEM/LogFiles/W3SVC1 :
493 </p>
494 <p>
495 If the last line contains: 
496 </p>
497 <div class="example"><pre>
498   GET "/examples/jsp/index.html HTTP/1.1" 404
499 </pre></div>
500 <p> 
501 then the ISAPI redirector is not recognising that it should be handling requests for the "/examples" context. 
502 Check the following:
503 </p>
504 <ul>
505 <li>
506 Check the extension_uri name for typos.
507 </li>
508 <li>
509 Check the worker_file setting for typos, name and data.
510 </li>
511 <li>
512 Check the worker_mount_file setting typos, name and data.
513 </li>
514 If these are set correctly, the ISAPI redirector should recognise that it should handle requests for the "/examples" context.
515 </ul>
516
517 <p>If the last line contains something like:
518 </p>
519
520 <div class="example"><pre>
521   GET "/jakarta/isapi_redirect.dll HTTP1.1"
522 </pre></div>
523
524 <p>
525 then the ISAPI redirector is recognising that it should handle the request, 
526 but is not successful at getting Tomcat to service the request.
527 </p>
528
529 <p>
530 You should check the HTTP error code following GET "/..." :
531 </p>
532
533 <div class="example"><pre>
534   Error 404
535   GET "/..." 404
536 </pre></div>
537
538 <ul>
539 <li>
540 Make sure you entered the URL correctly.
541 </li>
542 <li>
543 Make sure the virtual directory created was called "jakarta". 
544 It should display in Personal Web Manager as "/jakarta" (without the quotes).
545 </li>
546 <li>
547 Make sure the extension_uri data begins with "/jakarta/" (without the quotes).
548 </li>
549 </ul>
550
551 <div class="example"><pre>
552   Error 500
553   GET "/..." 500
554 </pre></div>
555
556 <ul>
557 <li>
558 Make sure that "isapi_redirect.dll" follows "/jakarta/" in the extension_uri setting.
559 </li>
560 <li>
561 Check the workers.properties file and make sure the port setting for worker.ajp12.port is the same as the port specified in the server.xml for the "Apache AJP12 support".
562 </li>
563 </ul>
564
565 <div class="example"><pre>
566   Error 200 or 403
567   GET "/..." 200
568   GET "/..." 403
569 </pre></div>
570
571 <ul>
572 <li>
573 Make sure you have checked Execute Access 
574 for the jakarta virtual directory in the Advanced Options of the Personal Web Manager.
575 </li>
576 </ul>
577
578 <p>
579 If the above settings are correct, the index.html page should appear in your browser. 
580 You should also be able to click the Execute links to execute the JSP examples.
581 </p>
582
583 </blockquote></td></tr></table>
584
585 <table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="WinNT/Win2K/WinXP"><strong>WinNT/Win2K/WinXP</strong></a></font></td></tr><tr><td><blockquote>
586 <p>
587 Start the World Wide Web Publishing Service and Tomcat.
588 </p>
589 <p>
590 Check for the presence of the ISAPI redirector log file you specified in the log_file setting. 
591 If not found, check the following:
592 </p>
593 <ul>
594 <li>
595 Check the "executable" you set for the filter in the IIS Management Console and make sure the path is correct.
596 </li>
597 <li>Check the spelling of the "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0" key.
598 Case isn't important, but an incorrect letter will prevent the isapi_redirect.dll from finding its registry settings.
599 </li>
600 <li>
601 Check the log_file setting for typos, name and data. Also insure the directory in which the log file will appear already exists.
602 </li>
603 If the above are set correctly, the ISAPI redirector should be able to create the log file.
604 </ul>
605
606 <p>
607 Check the tomcat filter you added and make sure its status shows a green upward-pointing arrow. 
608 If not, check the following:
609 </p>
610 <ul>
611 <li>
612 Check the worker_file setting for typos, name and data.
613 </li>
614 <li>
615 Check the worker_mount_file setting typos, name and data.
616 </li>
617 If the above are set correctly, the green upward-pointing arrow should appear, even if the other settings are wrong.
618 </ul>
619
620 <p>
621 Invoke the URL <a href="http://localhost/examples/jsp/index.html">http://localhost/examples/jsp/index.html</a> 
622 in your browser. Case is important in Tomcat. The characters following "localhost" in the URL must be lower case. 
623 If the page fails to appear, examine the last line in the IIS server log file in found in SYSTEM32/LogFiles/W3SVC1.
624 </p>
625
626 <p>
627 The last line should contain something like: GET "/jakarta/isapi_redirect.dll HTTP1.1", 
628 which indicates the ISAPI redirector is recognising that it should handle the request.
629 </p>
630
631 <p>
632 You should check the HTTP error code following GET "/..." :
633 </p>
634
635 <div class="example"><pre>
636   Error 404
637   GET "/..." 404
638 </pre></div>
639
640 <ul>
641 <li>
642 Make sure you entered the URL correctly.
643 </li>
644 </ul>
645
646 <div class="example"><pre>
647   Error 500
648   GET "/..." 500
649 </pre></div>
650
651 <ul>
652 <li>
653 Make sure the virtual directory created was called "jakarta".
654 </li>
655 <li>
656 Make sure that the extension_uri setting is correct.
657 </li>
658 <li>
659 Check the workers.properties file and make sure the port setting for worker.ajp12.port is the same as the port specified in the server.xml for the "Apache AJP12 support".
660 </li>
661 </ul>
662
663 <div class="example"><pre>
664   Error 200 or 403
665   GET "/..." 200
666   GET "/..." 403
667 </pre></div>
668
669 <ul>
670 <li>
671 Make sure you have checked Execute Access for the jakarta virtual directory in the 
672 Advanced Options of the Personal Web Manager.
673 </li>
674 </ul>
675
676 <p>
677 If the above settings are correct, the index.html page should appear in your browser. 
678 You should also be able to click the Execute links to execute the JSP examples.
679 </p>
680 </blockquote></td></tr></table>
681
682
683 </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>
684         Copyright &copy; 1999-2011, Apache Software Foundation
685         </em></font></div></td></tr></table></body></html>