You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/03/25 22:49:53 UTC

svn commit: r1305124 [7/17] - in /tomcat/site/trunk/docs/connectors-doc-archive: ./ jk2/ jk2/common/ jk2/common/printer/ jk2/images/ jk2/jk/ jk2/jk/printer/ jk2/jk2/ jk2/jk2/printer/ jk2/printer/

Added: tomcat/site/trunk/docs/connectors-doc-archive/jk2/jk/neshowto.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/connectors-doc-archive/jk2/jk/neshowto.html?rev=1305124&view=auto
==============================================================================
--- tomcat/site/trunk/docs/connectors-doc-archive/jk2/jk/neshowto.html (added)
+++ tomcat/site/trunk/docs/connectors-doc-archive/jk2/jk/neshowto.html Sun Mar 25 20:49:51 2012
@@ -0,0 +1,983 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html xmlns="http://www.w3.org/TR/xhtml1/strict">
+<head>
+<title>Netscape/iPlanet HowTo</title>
+<!--
+   Copyright 1999-2004 The Apache Software Foundation
+ 
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+ 
+       http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<meta content="1999-2004 The Apache Software Foundation" name="copyright"/>
+<meta content="$Date$" name="last-changed"/>
+<meta content="Henri Gomez" name="author"/>
+<meta content="hgomez@apache.org" name="email"/>
+<meta content="Gal Shachor" name="author"/>
+<meta content="shachor@il.ibm.com" name="email"/>
+<link href="..//style.css" type="text/css" rel="stylesheet"/>
+<link href="../images/tomcat.ico" rel="shortcut icon"/>
+</head>
+<body link="#525D76" vlink="#525D76" alink="#525D76" text="#000000" bgcolor="#ffffff">
+<a name="TOP"/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr height="1">
+<td class="nil" height="1" bgcolor="#ffffff" width="150">
+<img hspace="0" vspace="0" height="1" width="150" border="0" src="../images/pixel.gif"/>
+</td>
+<td class="nil" height="1" bgcolor="#ffffff" width="*">
+<img hspace="0" vspace="0" height="1" width="370" border="0" src="../images/pixel.gif"/>
+</td>
+</tr>
+<tr>
+<td width="*" colspan="2" class="logo" bgcolor="#ffffff">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left">
+<img align="left" height="48" width="505" border="0" src="../images/jakarta.gif"/>
+</td>
+<td align="right">
+<img align="right" border="0" src="../images/mod_jk.jpg"/>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+<tr>
+<td colspan="2" width="*" align="right" class="head" bgcolor="#999999">
+<nobr>
+<a href="http://www.apache.org/" class="head">Apache Software Foundation</a> |
+                <a href="http://jakarta.apache.org/" class="head">Jakarta Project</a> |
+                <a href="http://jakarta.apache.org/tomcat/" class="head">Apache Tomcat</a>
+</nobr>
+</td>
+</tr>
+<tr>
+<td valign="top" width="150" bgcolor="#ffffff">
+<table class="menu" cellpadding="0" cellspacing="0" width="150" border="0">
+<tr height="1">
+<td class="nil" height="1" bgcolor="#cccccc" width="10">
+<img hspace="0" vspace="0" height="1" width="10" border="0" src="../images/pixel.gif"/>
+</td>
+<td class="nil" height="1" bgcolor="#cccccc" width="140">
+<img hspace="0" vspace="0" height="1" width="140" border="0" src="../images/pixel.gif"/>
+</td>
+</tr>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Presentation</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../index.html">Overview</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Commons</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../common/AJPv13.html">AJPv13</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../common/AJPv13-extensions-proposal.html">AJPv13 extensions Proposal</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../common/doccontrib.html">How to Contribute to the Documentation</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../common/tools.html">Tools</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../faq.html">FAQ</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">JK</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/quickhowto.html">Quick Start HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/aphowto.html">Apache HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/domhowto.html">Domino HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/iishowto.html">IIS HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/neshowto.html">Netscape/iPlanet HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td width="10" bgcolor="#cccccc"/>
+<td width="140" bgcolor="#cccccc">
+<a href="#Introduction" class="menu">Introduction</a>
+</td>
+</tr>
+<tr height="1"/>
+<tr>
+<td width="10" bgcolor="#cccccc"/>
+<td width="140" bgcolor="#cccccc">
+<a href="#Installation" class="menu">Installation</a>
+</td>
+</tr>
+<tr height="1"/>
+<tr>
+<td width="10" bgcolor="#cccccc"/>
+<td width="140" bgcolor="#cccccc">
+<a href="#Configuring the NSAPI Redirector" class="menu">Configuring the NSAPI Redirector</a>
+</td>
+</tr>
+<tr height="1"/>
+<tr>
+<td width="10" bgcolor="#cccccc"/>
+<td width="140" bgcolor="#cccccc">
+<a href="#Building NSAPI redirector" class="menu">Building NSAPI redirector</a>
+</td>
+</tr>
+<tr height="1"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk/workershowto.html">Workers HowTo</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">JK2</td>
+</tr>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Configuration in the Tomcat</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configtc.html">Configuration options</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configtccom.html">Coyote/JK2 Handlers</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configtcex.html">Examples</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Configuration in the Web Server</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configweb.html">Configuration file</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configwebcom.html">Components</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/configwebex.html">Examples</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Installation</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/installhowto.html">Installation of jk2 in the Web Server</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+<tr height="6">
+<td colspan="2" width="150" bgcolor="#d0d0d0">Howto</td>
+</tr>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/confighowto.html">Quick Start JK2 Configuration Guide</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/vhosthowto.html">Apache 2.0.43 - Tomcat 4.1.12 - jk2 - virtual host HOWTO</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr>
+<td colspan="2" width="150" bgcolor="#cccccc">
+<nobr>
+<a class="menu" href="../jk2/davhowto.html">Apache 2.x/mod-dav - Tomcat/jk2 - HOWTO</a>
+</nobr>
+</td>
+</tr>
+<tr height="2"/>
+<tr height="6"/>
+</table>
+</td>
+<td class="body" valign="top" width="*" bgcolor="#ffffff">
+<table cellspacing="4" width="100%" border="0">
+<tr>
+<td nowrap="true" valign="top" align="left">
+<h2>Netscape/iPlanet HowTo</h2>
+</td>
+<td nowrap="true" valign="top" align="right">
+<small>
+<a href="../jk/printer/neshowto.html">
+<img alt="Printer Friendly Version" border="0" src="../images/printer.gif"/>
+<br/>print-friendly<br/>version
+            </a>
+</small>
+</td>
+</tr>
+</table>
+<a name="Introduction">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="section" bgcolor="#525D76">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Introduction</td>
+</tr>
+</table>
+</a>
+<p class="section">
+This document explains how to set up Netscape web servers to cooperate with Tomcat. 
+</p>
+<p class="section">
+Normally the Netscape web servers come with their own Servlet engine, 
+but you can also configure them to send servlet and JSP requests to Tomcat 
+using the Tomcat redirector plugin.
+</p>
+<p class="section">
+It is recommanded that you also read the <b>
+<a href="../jk/workershowto.html">Workers HowTo</a>
+</b> document
+to learn how to setup the working entities between your WebServer and Tomcat Engines.
+</p>
+<a name="sub_Document Conventions and Assumptions">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Document Conventions and Assumptions</td>
+</tr>
+</table>
+</a>
+<p class="section">
+${tomcat_home} is the root directory of tomcat. 
+Your Tomcat installation should have the following subdirectories:
+
+<ul>
+<li>
+${tomcat_home}\conf - Where you can place various configuration files
+</li>
+<li>
+${tomcat_home}\webapps - Containing example applications
+</li>
+<li>
+${tomcat_home}\bin - Where you place web server plugins
+</li>
+</ul>
+</p>
+<p class="section">
+In all the examples in this document ${tomcat_home} will be <b>
+<font color="#333333">c:\jakarta-tomcat</font>
+</b>.
+A worker is defined to be a tomcat process that accepts work from the Netscape/iPlanet server.
+</p>
+<br/>
+<a name="sub_Supported Configuration">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Supported Configuration</td>
+</tr>
+</table>
+</a>
+<p class="section">
+The Netscape-Tomcat redirector was developed and tested on:
+<ul>
+<li>
+WinNT4.0-i386 SP4/SP5/SP6a (should be able to work with other service packs) and some Unixes
+</li>
+<li>
+Netscape Enterprise 3.0 and 3.61
+</li>
+<li>
+Tomcat 3.2.x, 3.3.x, Tomcat 4.0.x, Tomcat 4.1.x and Tomcat 5
+</li>
+</ul>
+</p>
+<p class="section">
+The redirector uses <b>
+<font color="#333333">ajp12</font>
+</b> and <b>
+<font color="#333333">ajp13</font>
+</b> to send requests to the Tomcat containers. 
+There is also an option to use Tomcat in process, 
+more about the in-process mode can be found in the in process howto.
+</p>
+<br/>
+<a name="sub_Who support ajp protocols ?">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Who support ajp protocols ?</td>
+</tr>
+</table>
+</a>
+<p class="section">
+The ajp12 protocol is only available in Tomcat 3.2.x and 3.3.x.
+</p>
+<p class="section">
+The <b>
+<font color="#333333">ajp12</font>
+</b> has been <b>
+<font color="#333333">deprecated</font>
+</b> with Tomcat 3.3.x and you should use instead 
+<b>
+<font color="#333333">ajp13</font>
+</b> which is the only ajp protocol known by Tomcat 4.0.x, 4.1.x and 5.
+</p>
+<p class="section">
+Of course Tomcat 3.2.x and 3.3.x also support ajp13 protocol.
+</p>
+<p class="section">
+Others servlet engines such as <b>
+<font color="#333333">jetty</font>
+</b> have support for ajp13 protocol
+</p>
+<br/>
+<a name="sub_How does it work ?">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>How does it work ?</td>
+</tr>
+</table>
+</a>
+<p class="section">
+<ol>
+<li>
+The Netscape-Tomcat redirector is an Netscape service step plugin, 
+Netscape load the redirector plugin and calls its service handler 
+function for request that are assigned to the "servlet" configuration object.
+</li>
+<li>
+For each in-coming request Netscape will execute the set of NameTrans directives 
+that we added to obj.conf, the assign-name function will check if it's from 
+parameter matches the request URL.
+</li>
+<li>
+If a match is found, assign-name will assign the servlet object name to the request. 
+This will cause Netscape to send the request to the servlet configuration object.
+</li>
+<li>
+Netscape will execute our jk_service extension. The extension collects the 
+request parameters and forwards them to the appropriate worker using the ajp13 protocol 
+(the worker="defworker" parameter in jk_service inform it that the worker for this request is named <b>
+<font color="#333333">defworker</font>
+</b>).
+the workers properties files, <b>
+<font color="#333333">workers.properties</font>
+</b>, will indicate that defworker use ajp13 protocol.
+</li>
+<li>
+The extension collects the response from the worker and returns it to the browser.
+</li>
+</ol>
+</p>
+<br/>
+<br/>
+<a name="Installation">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="section" bgcolor="#525D76">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Installation</td>
+</tr>
+</table>
+</a>
+<p class="section">
+A pre-built version of the Netscape redirector, nsapi_redirect.dll, may be available under 
+the win32/i386 directory of jakarta-tomcat-connectors distribution. 
+For those using Netscape as your browser, try downloading a zip version of the file, if available. 
+There can be problems using Netscape to download DLL files.
+
+You can also build a copy locally from the source present in jakarta-tomcat-connectors distribution.
+
+
+The Tomcat redirector requires two entities:
+<ul>
+<li>
+nsapi_redirect.dll - The Netscape server plugin, either obtain a pre-built DLL or build it yourself 
+(see the build section).
+</li>
+<li>
+workers.properties - A file that describes the host(s) and port(s) used by the workers (Tomcat processes). 
+A sample workers.properties can be found under the conf directory.
+</li>
+</ul>
+
+The installation includes the following parts:
+
+<ul>
+<li>
+Configuring the NSAPI redirector with a default /examples context and checking that you can serve servlets 
+with Netscape.
+</li>
+<li>
+Adding more contexts to the configuration.
+</li>
+</ul>
+
+</p>
+<br/>
+<a name="Configuring the NSAPI Redirector">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="section" bgcolor="#525D76">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Configuring the NSAPI Redirector</td>
+</tr>
+</table>
+</a>
+<p class="section">
+In this document we'll assume that nsapi_redirect.dll is placed in 
+<b>
+<font color="#333333">c:\jk\lib\nsapi_redirect.dll</font>
+</b>, the properties file is in<b>
+<font color="#333333">c:\jk\conf</font>
+</b>
+and you created a log directory <b>
+<font color="#333333">c:\jk\logs</font>
+</b>
+</p>
+<ul>
+<li>
+If the Netscape built in servlet support is working disable it.
+</li>
+<li>
+Add the redirector plugin into the Netscape server configuration. 
+Edit your server <b>
+<font color="#333333">obj.conf</font>
+</b> and add the following lines:
+</li>
+</ul>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<div class="screen">In the Init section:</div>
+<code class="screen">
+<nobr>Init fn="load-modules" funcs="jk_init,jk_service" shlib="c:/jk/lib/nsapi_redirect.dll"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>Init fn="jk_init" worker_file="c:/jk/conf/workers.properties" log_level="debug" log_file="c:/jk/logs/nsapi.log"</nobr>
+</code>
+<br/>
+<div class="screen">In the default object NameTrans section</div>
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/servlet/*" name="servlet"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/examples/*" name="servlet"</nobr>
+</code>
+<br/>
+<div class="screen">Create a new configuration object by adding the following lines to the end of the obj.conf file</div>
+<code class="screen">
+<nobr>&lt;Object name=servlet&gt;</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>ObjectType fn=force-type type=text/plain</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>Service fn="jk_service" worker="worker1"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>&lt;/Object&gt;</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<ul>
+<li>
+Restart Netscape (stop and start the server)
+</li>
+</ul>
+<p class="section">
+That's all, now you should start tomcat and ask Netscape for http://server:port/examples/
+</p>
+<a name="sub_Adding additional Contexts">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Adding additional Contexts</td>
+</tr>
+</table>
+</a>
+<p class="section">
+The examples context is useful for verifying your installation, but you will also need to add your own contexts. 
+Adding a new context requires two operations:
+</p>
+<ul>
+<li>
+Adding the context to Tomcat (I am not going to talk about this).
+</li>
+<li>
+Assigning the NSAPI redirector to handle this context.
+</li>
+</ul>
+<p class="section">
+Assigning the NSAPI redirector to handle this context is simple, 
+all you need to do is to edit <b>
+<font color="#333333">obj.conf</font>
+</b> and add a NameTrans line that looks like:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/&lt;context name&gt;/*" name="servlet"</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+After saving <b>
+<font color="#333333">obj.conf</font>
+</b> restart Netscape and it will serve the new context.
+</p>
+<br/>
+<a name="sub_Advanced Context Configuration">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Advanced Context Configuration</td>
+</tr>
+</table>
+</a>
+<p class="section">
+Sometimes it is better to have Netscape serve the static pages (html, gif, jpeg etc.) 
+even if these files are part of a context served by Tomcat. For example, consider the html and gif files in the examples context, there is no need to serve them from the Tomcat process, Netscape will suffice.
+</p>
+<p class="section">
+Making Netscape serve static files that are part of the Tomcat contexts requires the following:
+</p>
+<ul>
+<li>
+Configuring Netscape to know about the Tomcat contexts
+</li>
+<li>
+Make sure that the WEB-INF directory is protected from access.
+</li>
+<li>
+Configuring Netscape to assign the NSAPI redirector only specific requests that requires JSP/Servlet handling.
+</li>
+</ul>
+<p class="section">
+Adding a Tomcat context to Netscape requires the addition of a new Netscape virtual directory 
+that covers the Tomcat context.
+</p>
+<p class="section">
+For example, adding a /example Netscape virtual directory that 
+covers the <b>
+<font color="#333333">c:\jakarta-tomcat\webapps\examples</font>
+</b> directory. 
+</p>
+<p class="section">
+To add a new virtual directory add the following line to your <b>
+<font color="#333333">obj.conf</font>
+</b>:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<code class="screen">
+<nobr>NameTrans fn=pfx2dir from=/examples dir="c:/jakarta-tomcat/webapps/examples"</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+WEB-INF protection requires some explanation; Each servlet application (context) has a special directory named <b>
+<font color="#333333">WEB-INF</font>
+</b>,
+this directory contains sensitive configurations data and Java classes and must be kept hidden from web users. 
+WEB-INF can be protected by adding the following line to the PathCheck section in the default configuration object:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<code class="screen">
+<nobr>PathCheck fn="deny-existence" path="*/WEB-INF/*"</nobr>
+</code>
+<br/>
+<div class="screen">This line instructs the Netscape server to reject any request with a URL that contain the path /WEB-INF/.</div>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+Configuring Netscape to assign the NSAPI redirector only specific requests is somewhat harder, 
+you will need to specify the exact URL-Path pattern(s) that you want Tomcat to handle 
+(usually only JSP files and servlets). 
+</p>
+<p class="section">
+This requires a change to NemaTrans portion of <b>
+<font color="#333333">obj.conf</font>
+</b>. 
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<div class="screen">For the examples context it requires to replace the following line:</div>
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/examples/*" name="servlet"</nobr>
+</code>
+<br/>
+<div class="screen">with the following two lines:</div>
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/examples/jsp/*.jsp" name="servlet"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/examples/servlet/*" name="servlet"</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+As you can see the second configuration is more explicit, it actually instructs 
+Netscape to assign the redirector with only requests to resources under 
+<b>
+<font color="#333333">/examples/servlet/</font>
+</b> and resources under <b>
+<font color="#333333">/examples/</font>
+</b> whose name ends with <b>
+<font color="#333333">.jsp</font>
+</b>.
+</p>
+<p class="section">
+You can be even more explicit and provide lines such as:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<code class="screen">
+<nobr>NameTrans fn="assign-name" from="/examples/servletname" name="servlet"</nobr>
+</code>
+<br/>
+<div class="screen">Instructs Netscape to assign the redirector request whose URL-Path equals /example/servletname</div>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<br/>
+<a name="sub_Advanced Worker Configuration">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="subsection" bgcolor="#828DA6">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Advanced Worker Configuration</td>
+</tr>
+</table>
+</a>
+<p class="section">
+Sometimes you want to serve different contexts with different Tomcat processes 
+(for example to spread the load among different machines). 
+To achieve such goal you will need to define several workers and assign each context with its own worker.
+</p>
+<p class="section">
+Defining workers is done in <b>
+<font color="#333333">workers.properties</font>
+</b>, this file includes two types of entries:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<div class="screen">An entry that lists all the workers defined. For example:</div>
+<code class="screen">
+<nobr>worker.list=worker1, worker2</nobr>
+</code>
+<br/>
+<div class="screen">Entries that define the host and port associated with these workers.</div>
+<code class="screen">
+<nobr>worker.worker1.host=localhost</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>worker.worker1.port=8009</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>worker.worker1.type=ajp13</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>worker.worker2.host=otherhost</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>worker.worker2.port=8009</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>worker.worker2.type=ajp13</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+The above examples defined two workers, now we can use these workers to serve two different 
+contexts each with it’s own worker. 
+Submitting requests to different workers is accomplished by using multiple Service directives 
+in the servlet configuration Object, each with a different path pattern parameter. 
+</p>
+<p class="section">
+For example, if we want to submit the <b>
+<font color="#333333">/examples</font>
+</b> context to the worker named <b>
+<font color="#333333">worker1</font>
+</b> and the 
+<b>
+<font color="#333333">/webpages</font>
+</b> context to the worker named <b>
+<font color="#333333">worker2</font>
+</b> we should use the following configuration:
+</p>
+<p class="screen">
+<div align="center">
+<table bgcolor="#cccccc" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#cccccc">
+<code class="screen">
+<nobr>&lt;Object name=servlet&gt;</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>ObjectType fn=force-type type=text/plain</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>Service fn="jk_service" worker="worker1" path="/examples/*"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>Service fn="jk_service" worker="worker2" path="/webpages/*"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>Service fn="jk_service" worker="worker1"</nobr>
+</code>
+<br/>
+<code class="screen">
+<nobr>&lt;/Object&gt;</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+<p class="section">
+More informations on using and configuring workers in the <b>
+<a href="../jk/workershowto.html">Workers HowTO</a>
+</b>
+</p>
+<br/>
+<br/>
+<a name="Building NSAPI redirector">
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+<td align="left" valign="top" class="section" bgcolor="#525D76">
+<img border="0" vspace="0" hspace="0" align="left" valign="top" src="../images/corner.gif"/>Building NSAPI redirector</td>
+</tr>
+</table>
+</a>
+<p class="section">
+The redirector was developed using Visual C++ Ver.6.0, so having this environment is a prereq if you want 
+to perform a custom build. You should also have NES developer SDK
+
+The steps that you need to take are:
+<ul>
+<li>
+Change directory to the nsapi plugins source directory.
+</li>
+<li>
+Edit <b>
+<font color="#333333">nsapi.dsp</font>
+</b> and update the include and library path to reflect your own Netscape server installation 
+(search for a <b>
+<font color="#333333">/I compiler</font>
+</b> option and <b>
+<font color="#333333">/libpath</font>
+</b> linker option)
+</li>
+<li>
+Make the source with MSDEV
+</li>
+</ul>
+<p class="screendos">
+<div align="center">
+<table bgcolor="#000000" cellpadding="2" cellspacing="0" border="1" width="80%">
+<tr>
+<td align="left" bgcolor="#000000">
+<div class="screendos">Change directory to the nsapi plugins source directory</div>
+<code>
+<nobr>
+<em class="screendos">c:\&gt;</em>
+<b class="screendos">cd c:\home\apache\jk\nsapi</b>
+</nobr>
+</code>
+<br/>
+<div class="screendos">Build the sources using MSDEV</div>
+<code>
+<nobr>
+<em class="screendos">c:\&gt;</em>
+<b class="screendos">MSDEV nsapi.dsp /MAKE ALL</b>
+</nobr>
+</code>
+<br/>
+</td>
+</tr>
+</table>
+</div>
+</p>
+</p>
+<p class="section">
+If msdev is not in your path, enter the full path to msdev.exe. 
+This will build both release and debug versions of the redirector plugin.
+An alternative will be to open the nsapi workspace file (nsapi.dsw) in msdev and 
+build it using the build menu.
+</p>
+<br/>
+</td>
+</tr>
+</table>
+</body>
+</html>

Propchange: tomcat/site/trunk/docs/connectors-doc-archive/jk2/jk/neshowto.html
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org