remm        02/01/25 07:21:34

  Modified:    webapps/tomcat-docs/config project.xml
  Added:       webapps/tomcat-docs/config jk.xml jk2.xml webapp.xml
  Removed:     webapps/tomcat-docs/config ajp.xml warp.xml
  Log:
  - Rorganize a bit the connector documentation, according to the official
    connector name (warp -> webapp and ajp -> jk).
  - Add a placeholder page on JK 2 (currently with the same content as the JK 1 page,
    except the connector class name).
  
  Revision  Changes    Path
  1.7       +3 -2      jakarta-tomcat-4.0/webapps/tomcat-docs/config/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml       30 Nov 2001 06:23:13 -0000      1.6
  +++ project.xml       25 Jan 2002 15:21:34 -0000      1.7
  @@ -22,9 +22,10 @@
       </menu>
   
       <menu name="Connectors">
  +        <item name="JK"                    href="jk.html"/>
  +        <item name="JK 2"                  href="jk2.html"/>
           <item name="HTTP/1.1"              href="http11.html"/>
  -        <item name="Warp"                  href="warp.html"/>
  -        <item name="AJP"                   href="ajp.html"/>
  +        <item name="Webapp"                href="webapp.html"/>
       </menu>
   
       <menu name="Containers">
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/tomcat-docs/config/jk.xml
  
  Index: jk.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE document [
    <!ENTITY project SYSTEM "project.xml">
  ]>
  <document>
  
    &project;
  
    <properties>
      <author email="[EMAIL PROTECTED]">Remy Maucherat</author>
      <title>The JK Connector</title>
    </properties>
  
  <body>
  
  
  <section name="Introduction">
  
    <p>The <strong>JK Connector</strong> element represents a
    <strong>Connector</strong> component that communicates with a web
    connector via the <code>AJP</code> protocol.  This is used for cases
    where you wish to invisibly integrate Tomcat 4 into an existing (or new)
    Apache installation, and you want Apache to handle the static content
    contained in the web application, and/or utilize Apache's SSL
    processing.  In many application environments, this will result in
    better overall performance than running your applications under
    Tomcat stand-alone using the <a href="http11.html">HTTP/1.1 Connector</a>.  
    However, the only way to know for sure whether it will provide better 
    performance for <strong>your</strong> application is to try it both 
    ways.</p>
  
    <p>This connector supports load balancing when used in conjunction with
    the <code>jvmRoute</code> attribute of the 
    <a href="engine.html">Engine</a>.</p>
  
  </section>
  
  
  <section name="Attributes">
  
    <subsection name="Common Attributes">
  
    <p>All implementations of <strong>Connector</strong>
    support the following attributes:</p>
  
    <attributes>
  
      <attribute name="className" required="true">
        <p>Java class name of the implementation to use.  This class must
        implement the <code>org.apache.catalina.Connector</code> interface.
        You must specify the standard value defined below.</p>
      </attribute>
  
      <attribute name="enableLookups" required="false">
        <p>Set to <code>true</code> if you want calls to
        <code>request.getRemoteHost()</code> to perform DNS lookups in
        order to return the actual host name of the remote client.  Set
        to <code>false</code> to skip the DNS lookup and return the IP
        address in String form instead (thereby improving performance).
        By default, DNS lookups are enabled.</p>
      </attribute>
  
      <attribute name="redirectPort" required="false">
        <p>If this <strong>Connector</strong> is supporting non-SSL
        requests, and a request is received for which a matching
        <code>&lt;security-constraint&gt;</code> requires SSL transport,
        Catalina will automatically redirect the request to the port
        number specified here.</p>
      </attribute>
  
      <attribute name="scheme" required="false">
        <p>Set this attribute to the name of the protocol you wish to have
        returned by calls to <code>request.getScheme()</code>.  For
        example, you would set this attribute to "<code>https</code>"
        for an SSL Connector.  The default value is "<code>http</code>".
        See <a href="#SSL Support">SSL Support</a> for more information.</p>
      </attribute>
  
      <attribute name="secure" required="false">
        <p>Set this attribute to <code>true</code> if you wish to have
        calls to <code>request.isSecure()</code> to return <code>true</code>
        for requests received by this Connector (you would want this on an
        SSL Connector).  The default value is <code>false</code>.</p>
      </attribute>
  
    </attributes>
  
    </subsection>
  
    <subsection name="Standard Implementation">
  
    <p>The standard implementation of <strong>JK Connector</strong> is
    <strong>org.apache.ajp.tomcat4.Ajp13Connector</strong>.</p>
  
    <p><strong>This implementation supports the AJP 1.3 and 1.4 protocols.</strong></p>
  
    <p>It supports the following additional attributes (in addition to the
    common attributes listed above):</p>
  
    <attributes>
  
      <attribute name="acceptCount" required="false">
        <p>The maximum queue length for incoming connection requests when
        all possible request processing threads are in use.  Any requests
        received when the queue is full will be refused.  The default
        value is 10.</p>
      </attribute>
  
      <attribute name="debug" required="false">
        <p>The debugging detail level of log messages generated by this
        component, with higher numbers creating more detailed output.
        If not specified, this attribute is set to zero (0).</p>
      </attribute>
  
      <attribute name="maxProcessors" required="false">
        <p>The maximum number of request processing threads to be created
        by this <strong>Connector</strong>, which therefore determines the
        maximum number of simultaneous requests that can be handled.  If
        not specified, this attribute is set to 20.</p>
      </attribute>
  
      <attribute name="minProcessors" required="false">
        <p>The number of request processing threads that will be created
        when this <strong>Connector</strong> is first started.  This
        attribute should be set to a value smaller than that set for
        <code>maxProcessors</code>.  The default value is 5.</p>
      </attribute>
  
      <attribute name="port" required="true">
        <p>The TCP port number on which this <strong>Connector</strong>
        will create a server socket and await incoming connections.  Your
        operating system will allow only one server application to listen
        to a particular port number on a particular IP address.</p>
      </attribute>
  
    </attributes>
  
    </subsection>
  
  </section>
  
  
  <section name="Nested Components">
  
    <p></p>
  
  </section>
  
  
  <section name="Configuration HOWTOs">
  
    <subsection name="Apache">
  
       <subsection name="Introduction">
  
          <p>This section explains how to connect Tomcat 4 to the popular
          open source web server, Apache.  It was originally part of
          <i>Tomcat: A Minimalistic User's Guide</i> by Gal Shachor, but
          has been split off for organizational reasons.  It should be
          considered a <b>work in progress</b>.  Since the Tomcat source
          tree is constantly changing, the information herein may be out
          of date.  The only definitive reference at this point is the <a
          href="http://jakarta.apache.org/site/sourceindex.html";>source
          code</a>.</p>
  
       </subsection>
  
       <subsection name="Installation">
  
          <subsection name="Needed Components">
  
            <p>In a nutshell a web server is waiting for client HTTP requests.
            When these requests arrive the server does whatever is needed to 
            serve the requests by providing the necessary content. Adding a 
            servlet container may somewhat change this behavior. Now the web 
            server needs also to perform the following:</p>
  
            <ul>
              <li>Load the servlet container adapter library 
              and initialize it (prior to serving requests). </li>
              <li>When a request arrives, it needs to check and see if a certain 
              request belongs to a servlet, if so it needs to let the adapter
              take the request and handle it.</li>
            </ul>
  
            <p>The adapter on the other hand needs to know what requests it is
            going to serve, usually based on some pattern in the request URL, 
            and to where to direct these requests.</p>
  
            <p>Things are even more complex when the user wants to set 
            a configuration that uses virtual hosts, or when they want multiple 
            developers to work on the same web server but on different servlet 
            container JVMs. We will cover these two cases 
            in the advanced sections.</p>
  
          </subsection>
  
          <subsection name="mod_jk Terminology">
  
             <p>The following terms are used in this section:</p>
  
             <ul>
                <li><strong>Worker process</strong> - A worker is a Tomcat 
                instance that is running to serve servlet requests coming 
                from the web server. In most cases there is only a single worker
                (the one and only Tomcat process) but sometimes you will run 
                multiple workers to achieve load balancing or site partitioning.
                Each worker is identified to the web server by the host were 
                it is located, the port where it listens and the communication 
                protocol used to exchange messages.</li>
                <li><strong>In-Process Worker</strong> - This is a special 
                worker. Instead of working with a Tomcat process residing on 
                another process, the web server opens a JVM and executes 
                Tomcat inside the web server process address space. 
                Our discussion in this document is not going to get into this 
                special worker. Note: Tomcat 4 can't be run as this type of 
                worker at the moment.</li>
                <li><strong>Web Server Plug-in/Tomcat Redirector</strong> - 
                For Tomcat to cooperate with any web server it needs an "agent" 
                to reside in the web server and send him servlet requests. 
                This is the web server plug-in, and in our case the web server 
                plug-in is mod_jk. The redirector usually comes in the shape of 
                a DLL or shared object module that you plug into 
                the web server.</li>
                <li><strong>Plug-in Configuration</strong> - We need to 
                configure the web server plug-in so that it knows where 
                the different Tomcat workers are and to which of them 
                it should forward requests. This information, accompanied with 
                some internal parameter, such as the log level, comprises 
                the plug-in configuration.</li>
                <li><strong>Web Server Configuration</strong> - Each web server 
                has some configuration that defines its behavior, e.g. on which 
                port to listen, what files to serve, what web server plug-ins 
                to load, etc. You will need to modify your web server 
                configuration to instruct it to load the Tomcat 
                redirector mod_jk.</li>
             </ul>
  
          </subsection>
  
          <subsection name="Getting mod_jk">
  
             <p>The mod_jk source now resides in the jakarta-tomcat-connectors
             subproject. Please refer to it for build instructions.</p>
  
             <p>Binaries for mod_jk are available for several platforms in the 
             same area as the Tomcat Binary Release.  The binaries are located 
             in subdirectories by platform. For some platforms, such as Windows,
             this is the typical way of obtaining mod_jk since most Windows 
             systems do not have C compilers.  For others, the binary 
             distribution of mod_jk offers simpler installation.</p>
  
             <p><strong>Note: Note: The version of mod_jk is not dependent on 
             the version of Tomcat. The Tomcat 3.3 distribution of mod_jk will 
             function correctly with Tomcat 4.x and other 3.x versions of 
             Tomcat, such as Tomcat 3.2.1.</strong></p>
  
          </subsection>
  
          <subsection name="Configuring Apache">
  
             <p>If you've previously configured Apache to use mod_jserv, remove 
             any ApJServMount directives from your httpd.conf. If you're 
             including tomcat-apache.conf or tomcat.conf, you'll want to remove 
             them as well - they are specific to mod_jserv. 
             The mod_jserv configuration directives are not compatible 
             with mod_jk!</p>
  
             <p>Unlike Tomcat 3, Tomcat 4 doesn't automatically generate the 
             necessary <code>$CATALINA_HOME/conf/mod_jk.conf</code>,
             and it will have to be created manually. Note that Tomcat 
             and Apache must be restarted after adding a new context.</p>
  
             <p>The basic configuration is as follows:</p>
  
             <ul>
                <li>You will need to instruct Apache to load Tomcat. This can be
                done with Apache's LoadModule and AddModule configuration 
                directives.</li>
                <li>You must inform mod_jk the location of your 
                workers.properties file. Use mod_jk's JkWorkersFile 
                configuration directive.</li>
                <li>You should specify a location where mod_jk is going to place
                its log file and a log level to be used. Use the JkLogFile and 
                JkLogLevel configuration directives. Possible log levels are 
                debug, info, error and emerg. If the JkLogLevel is not specified,
                no log is generated.</li>
                <li>The directive JkLogStampFormat will configure the date/time 
                format found on mod_jk logfile. Using strftime() format string 
                it's set by default to "[%a %b %d %H:%M:%S %Y] "</li>
                <li>Use mod_jk's JkMount directive to assign specific URLs to 
                Tomcat. In general the structure of a JkMount directive is:
                <code>JkMount URL_PREFIX WORKER_NAME</code>. You can use the 
                JkMount directive at the top level or inside &lt;VirtualHost&gt;
                sections of your httpd.conf file.</li>
             </ul>
  
          </subsection>
  
          <subsection name="Configuring Tomcat">
  
             <p>Tomcat 4 won't automatically generate the Apache configuration 
             file at the moment.</p>
  
             <p>After enabling the AJP 1.3 connector, you need to define workers,
             using a <code>$CATALINA_HOME/conf/workers.properties</code> file.
             In most cases, using the example workers.properties given below
             should work fine, after changing the path values to reflect how your
             environment is set up.</p>
  
          </subsection>
  
          <subsection name="Example Configuration Files">
  
             <p>Excerpt from workers.properties showing the Ajp13 worker:</p>
  
  <source>
  # Setup for Solaris system
  #
  workers.tomcat_home=/usr/local/jakarta-tomcat
  workers.java_home=/usr/java
  ps=/
  worker.list=ajp12, ajp13
  
  # Definition for Ajp13 worker
  #
  worker.ajp13.port=8009
  worker.ajp13.host=localhost
  worker.ajp13.type=ajp13
  </source>
  
             <p>Excerpt from Apaches httpd.conf showing JK directives:</p>
  
  <source>
  # Load mod_jk
  #
  LoadModule jk_module libexec/mod_jk.so
  AddModule mod_jk.c
  
  # Configure mod_jk
  #
  JkWorkersFile /usr/local/jakarta-tomcat/conf/jk/workers.properties
  JkLogFile /usr/local/apache/logs/mod_jk.log
  JkLogLevel info
  
  # First Virtual Host.
  #
  &lt;VirtualHost 10.0.0.1:80>
  DocumentRoot /web/host1
  ServerName host1.apache.org
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  
  # Second Virtual Host. Also accessible via HTTPS
  #
  &lt;VirtualHost 10.0.0.2:80>
  DocumentRoot /web/host2
  ServerName host2.apache.org
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  
  &lt;VirtualHost 10.0.0.2:443>
  DocumentRoot /web/host2
  ServerName host2.apache.org
  SSLEngine On
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  </source>
  
          </subsection>
  
       </subsection>
  
    </subsection>
  
    <subsection name="IIS 4.x and 5.x">
  
       <subsection name="Introduction">
  
          <p>This section explains how to set up IIS 4.0 or newer to cooperate 
          with Tomcat 4. Normally IIS cannot execute Servlets and Java Server
          Pages (JSPs), configuring IIS to use Tomcat redirector plugin 
          will allow IIS to redirect Servlet and JSP requests to Tomcat.</p>
  
          <p>The Tomcat redirector for IIS is composed of four entities:
          <ul>
             <li>isapi_redirect.dll - The IIS server plugin, either obtain a 
             pre-built DLL or build it yourself (see the build section).</li>
             <li>worker.properties - A file that describes the host(s) and 
             port (s) used by the workers (Tomcat processes).</li>
             <li>uriworkermap.properties - A file that maps URL-Path patterns 
             to workers.</li>
             <li>iis_redirect.reg - A file that creates registry entries 
             in the Windows registry.</li>
          </ul>
          </p>
  
       </subsection>
  
       <subsection name="Installation">
  
          <p>Make sure the Tomcat AJP connector is properly declared in the
          Catalina configuration file.</p>
  
          <p>Download isapi_redirect.dll for Tomcat 3.3 release or use the 
          following 
          <a 
href="http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/";>link</a>.
          </p>
  
          <p>Note: See below for examples of the configuration files. Those 
          configuration files assume Tomcat is installed in the 
          <code>c:\jakarta-tomcat-4.0.1</code> directory.</p>
  
          <p>The next step is to create worker.properties to help 
          isapi_redirect.dll to identify where to find Tomcat and its 
          configuration.</p>
  
          <p>Next, the ISAPI filter for Tomcat must be configured to redirect 
          requests for specific webapps to Tomcat.</p>
  
          <p>Then the <code>uriworkermap.properties</code> file must be created
          in <code>%CATALINA_HOME%\conf</code> directory.</p>
  
       </subsection>
  
       <subsection name="Configuring IIS">
  
          <p>
          <ul>
             <li>Launch Internet Service Manager</li>
             <li>Stop the Web Site if it is running</li>
             <li>Create a virtual directory, by clicking on the default 
                 web site
                <ul>
                   <li>Type the alias to say jakarta, press Next</li>
                   <li>Set the directory to <code>%CATALINA_HOME%\bin</code>
                       where you installed isapi_redirect.dll, press next</li>
                   <li>Provide only read and execute privileges for 
                       security purposes</li>
                </ul>
             </li>
             <li>Add a filter to the default web site, using the 
             IIS Management Console, right click on the properties and 
             go to ISAPI filters tab. Press Add button, 
             add isapi_redirect.dll as a filter the name of the filter 
             should reflect its task (for example, "Jakarta Redirector"). 
             The Executable field should point to the place where we installed 
             isapi_redirect.dll, in our case 
             <code>%CATALINA_HOME%\bin\isapi_redirect.dll</code></li>
             <li>Copy and paste the registry entries found below into a file 
             iis_redirect.reg. Remember to correct the 
             directories where Tomcat is installed in this file. 
             Run the iis_redirect.reg file found at the end of this document. 
             This will create entries in the registry which 
             the isapi_redirect.dll looks for to determine the configuration 
             and location of Tomcat.</li>
             <li>Startup IIS.</li>
             <li>Go to the Properties of the web site and select the ISAPI 
             filters tab to make sure that the ISAPI filter got registered 
             correctly. It should have a Green arrow alongside it. 
             Note: it is recommended to restart computer for the ISAPI filter 
             to load.</li>
          </ul>
          </p>
  
       </subsection>
  
       <subsection name="Sample worker.properties file">
  
          <p>
  <source>
  # ************ Begin worker.properties **************
  worker.ajp13.type=ajp13
  
  #
  # Specifies the load balance factor when used with
  # a load balancing worker.
  # Note:
  #  ----> lbfactor must be > 0
  #  ----> Low lbfactor means less work done by the worker.
  worker.ajp13.lbfactor=1
  
  #
  # Specify the size of the open connection cache.
  #worker.ajp13.cachesize
  
  #
  #------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
  #---------------------------------------------------------------------
  #
  
  #
  # The loadbalancer (type lb) worker perform weighted round-robin
  # load balancing with sticky sessions.
  # Note:
  #  ----> If a worker dies, the load balancer will check its state
  #        once in a while. Until then all work is redirected to peer
  #        worker.
  worker.loadbalancer.type=lb
  worker.loadbalancer.balanced_workers=ajp13
  
  #
  # worker.tomcat_home should point to the location where you
  # installed tomcat. This is where you have your conf, webapps and lib
  # directories.
  #
  worker.tomcat_home=C:\jakarta-tomcat-4.0.1
  
  #
  # worker.java_home should point to your Java installation. Normally
  # you should have a bin and lib directories beneath it.
  #
  worker.java_home=C:\jdk1.3.1
  
  #
  # You should configure your environment slash... ps=\ on NT and / on UNIX
  # and maybe something different elsewhere.
  #
  ps=\
  
  #
  #------ ADVANCED MODE ------------------------------------------------
  #---------------------------------------------------------------------
  #
  
  #
  #------ DEFAULT worker list ------------------------------------------
  #---------------------------------------------------------------------
  #
  # The worker that your plugins should create and work with
  worker.list=ajp13
  
  #
  #------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
  #---------------------------------------------------------------------
  #
  
  #
  # Defining a worker named ajp13 and of type ajp13
  # Note that the name and the type do not have to match.
  #
  worker.ajp13.port=8009
  worker.ajp13.host=localhost
  
  # ************ End worker.properties **************
  </source>
          </p>
  
       </subsection>
  
       <subsection name="Sample uriworkermap.properties">
  
          <p>
  <source>
  # *********** Begin uriworkermap.properties ***
  #
  # Simple worker configuration file
  #
  
  # Mount the Servlet context to the ajp13 worker
  /servlet/*=ajp13
  
  # Mount the examples context to the ajp13 worker
  /examples/*=ajp13
  
  # Advanced mount of the examples context
  # /examples/servlet/*=ajp13
  # ************* End uriworkermap.properties ****
  </source>
          </p>
  
       </subsection>
  
       <subsection name="iis_redirect.reg">
  
          <p>
  <source>
  REGEDIT4
  [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]
  "extension_uri"="/jakarta/isapi_redirect.dll"
  "log_file"="C:\\jakarta-tomcat-4.0.1\\logs\\iis_redirect.log"
  "log_level"="emerg"
  "worker_file"="C:\\jakarta-tomcat-4.0.1\\conf\\worker.properties"
  "worker_mount_file"="C:\\jakarta-tomcat-4.0.1\\conf\\uriworkermap.properties"
  </source>
          </p>
  
       </subsection>
  
    </subsection>
  
  </section>
  
  
  </body>
  
  </document>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/tomcat-docs/config/jk2.xml
  
  Index: jk2.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE document [
    <!ENTITY project SYSTEM "project.xml">
  ]>
  <document>
  
    &project;
  
    <properties>
      <author email="[EMAIL PROTECTED]">Remy Maucherat</author>
      <title>The JK 2 Connector</title>
    </properties>
  
  <body>
  
  
  <section name="Introduction">
  
    <p>The <strong>JK 2 Connector</strong> element represents a
    <strong>Connector</strong> component that communicates with a web
    connector via the <code>AJP</code> protocol.  This is used for cases
    where you wish to invisibly integrate Tomcat 4 into an existing (or new)
    Apache installation, and you want Apache to handle the static content
    contained in the web application, and/or utilize Apache's SSL
    processing.  In many application environments, this will result in
    better overall performance than running your applications under
    Tomcat stand-alone using the <a href="http11.html">HTTP/1.1 Connector</a>.  
    However, the only way to know for sure whether it will provide better 
    performance for <strong>your</strong> application is to try it both 
    ways.</p>
  
    <p>This connector supports load balancing when used in conjunction with
    the <code>jvmRoute</code> attribute of the 
    <a href="engine.html">Engine</a>.</p>
  
  </section>
  
  
  <section name="Attributes">
  
    <subsection name="Common Attributes">
  
    <p>All implementations of <strong>Connector</strong>
    support the following attributes:</p>
  
    <attributes>
  
      <attribute name="className" required="true">
        <p>Java class name of the implementation to use.  This class must
        implement the <code>org.apache.catalina.Connector</code> interface.
        You must specify the standard value defined below.</p>
      </attribute>
  
      <attribute name="enableLookups" required="false">
        <p>Set to <code>true</code> if you want calls to
        <code>request.getRemoteHost()</code> to perform DNS lookups in
        order to return the actual host name of the remote client.  Set
        to <code>false</code> to skip the DNS lookup and return the IP
        address in String form instead (thereby improving performance).
        By default, DNS lookups are enabled.</p>
      </attribute>
  
      <attribute name="redirectPort" required="false">
        <p>If this <strong>Connector</strong> is supporting non-SSL
        requests, and a request is received for which a matching
        <code>&lt;security-constraint&gt;</code> requires SSL transport,
        Catalina will automatically redirect the request to the port
        number specified here.</p>
      </attribute>
  
      <attribute name="scheme" required="false">
        <p>Set this attribute to the name of the protocol you wish to have
        returned by calls to <code>request.getScheme()</code>.  For
        example, you would set this attribute to "<code>https</code>"
        for an SSL Connector.  The default value is "<code>http</code>".
        See <a href="#SSL Support">SSL Support</a> for more information.</p>
      </attribute>
  
      <attribute name="secure" required="false">
        <p>Set this attribute to <code>true</code> if you wish to have
        calls to <code>request.isSecure()</code> to return <code>true</code>
        for requests received by this Connector (you would want this on an
        SSL Connector).  The default value is <code>false</code>.</p>
      </attribute>
  
    </attributes>
  
    </subsection>
  
    <subsection name="Standard Implementation">
  
    <p>The standard implementation of <strong>JK 2 Connector</strong> is
    <strong>org.apache.jk.server.tomcat40.JkConnector</strong>.</p>
  
    <p><strong>This implementation supports the AJP 2.0 protocol.</strong></p>
  
    <p>It supports the following additional attributes (in addition to the
    common attributes listed above):</p>
  
    <attributes>
  
      <attribute name="acceptCount" required="false">
        <p>The maximum queue length for incoming connection requests when
        all possible request processing threads are in use.  Any requests
        received when the queue is full will be refused.  The default
        value is 10.</p>
      </attribute>
  
      <attribute name="debug" required="false">
        <p>The debugging detail level of log messages generated by this
        component, with higher numbers creating more detailed output.
        If not specified, this attribute is set to zero (0).</p>
      </attribute>
  
      <attribute name="maxProcessors" required="false">
        <p>The maximum number of request processing threads to be created
        by this <strong>Connector</strong>, which therefore determines the
        maximum number of simultaneous requests that can be handled.  If
        not specified, this attribute is set to 20.</p>
      </attribute>
  
      <attribute name="minProcessors" required="false">
        <p>The number of request processing threads that will be created
        when this <strong>Connector</strong> is first started.  This
        attribute should be set to a value smaller than that set for
        <code>maxProcessors</code>.  The default value is 5.</p>
      </attribute>
  
      <attribute name="port" required="true">
        <p>The TCP port number on which this <strong>Connector</strong>
        will create a server socket and await incoming connections.  Your
        operating system will allow only one server application to listen
        to a particular port number on a particular IP address.</p>
      </attribute>
  
    </attributes>
  
    </subsection>
  
  </section>
  
  
  <section name="Nested Components">
  
    <p></p>
  
  </section>
  
  
  <section name="Configuration HOWTOs">
  
    <subsection name="Apache">
  
       <subsection name="Introduction">
  
          <p>This section explains how to connect Tomcat 4 to the popular
          open source web server, Apache.  It was originally part of
          <i>Tomcat: A Minimalistic User's Guide</i> by Gal Shachor, but
          has been split off for organizational reasons.  It should be
          considered a <b>work in progress</b>.  Since the Tomcat source
          tree is constantly changing, the information herein may be out
          of date.  The only definitive reference at this point is the <a
          href="http://jakarta.apache.org/site/sourceindex.html";>source
          code</a>.</p>
  
       </subsection>
  
       <subsection name="Installation">
  
          <subsection name="Needed Components">
  
            <p>In a nutshell a web server is waiting for client HTTP requests.
            When these requests arrive the server does whatever is needed to 
            serve the requests by providing the necessary content. Adding a 
            servlet container may somewhat change this behavior. Now the web 
            server needs also to perform the following:</p>
  
            <ul>
              <li>Load the servlet container adapter library 
              and initialize it (prior to serving requests). </li>
              <li>When a request arrives, it needs to check and see if a certain 
              request belongs to a servlet, if so it needs to let the adapter
              take the request and handle it.</li>
            </ul>
  
            <p>The adapter on the other hand needs to know what requests it is
            going to serve, usually based on some pattern in the request URL, 
            and to where to direct these requests.</p>
  
            <p>Things are even more complex when the user wants to set 
            a configuration that uses virtual hosts, or when they want multiple 
            developers to work on the same web server but on different servlet 
            container JVMs. We will cover these two cases 
            in the advanced sections.</p>
  
          </subsection>
  
          <subsection name="mod_jk Terminology">
  
             <p>The following terms are used in this section:</p>
  
             <ul>
                <li><strong>Worker process</strong> - A worker is a Tomcat 
                instance that is running to serve servlet requests coming 
                from the web server. In most cases there is only a single worker
                (the one and only Tomcat process) but sometimes you will run 
                multiple workers to achieve load balancing or site partitioning.
                Each worker is identified to the web server by the host were 
                it is located, the port where it listens and the communication 
                protocol used to exchange messages.</li>
                <li><strong>In-Process Worker</strong> - This is a special 
                worker. Instead of working with a Tomcat process residing on 
                another process, the web server opens a JVM and executes 
                Tomcat inside the web server process address space. 
                Our discussion in this document is not going to get into this 
                special worker. Note: Tomcat 4 can't be run as this type of 
                worker at the moment.</li>
                <li><strong>Web Server Plug-in/Tomcat Redirector</strong> - 
                For Tomcat to cooperate with any web server it needs an "agent" 
                to reside in the web server and send him servlet requests. 
                This is the web server plug-in, and in our case the web server 
                plug-in is mod_jk. The redirector usually comes in the shape of 
                a DLL or shared object module that you plug into 
                the web server.</li>
                <li><strong>Plug-in Configuration</strong> - We need to 
                configure the web server plug-in so that it knows where 
                the different Tomcat workers are and to which of them 
                it should forward requests. This information, accompanied with 
                some internal parameter, such as the log level, comprises 
                the plug-in configuration.</li>
                <li><strong>Web Server Configuration</strong> - Each web server 
                has some configuration that defines its behavior, e.g. on which 
                port to listen, what files to serve, what web server plug-ins 
                to load, etc. You will need to modify your web server 
                configuration to instruct it to load the Tomcat 
                redirector mod_jk.</li>
             </ul>
  
          </subsection>
  
          <subsection name="Getting mod_jk">
  
             <p>The mod_jk source now resides in the jakarta-tomcat-connectors
             subproject. Please refer to it for build instructions.</p>
  
             <p>Binaries for mod_jk are available for several platforms in the 
             same area as the Tomcat Binary Release.  The binaries are located 
             in subdirectories by platform. For some platforms, such as Windows,
             this is the typical way of obtaining mod_jk since most Windows 
             systems do not have C compilers.  For others, the binary 
             distribution of mod_jk offers simpler installation.</p>
  
             <p><strong>Note: Note: The version of mod_jk is not dependent on 
             the version of Tomcat. The Tomcat 3.3 distribution of mod_jk will 
             function correctly with Tomcat 4.x and other 3.x versions of 
             Tomcat, such as Tomcat 3.2.1.</strong></p>
  
          </subsection>
  
          <subsection name="Configuring Apache">
  
             <p>If you've previously configured Apache to use mod_jserv, remove 
             any ApJServMount directives from your httpd.conf. If you're 
             including tomcat-apache.conf or tomcat.conf, you'll want to remove 
             them as well - they are specific to mod_jserv. 
             The mod_jserv configuration directives are not compatible 
             with mod_jk!</p>
  
             <p>Unlike Tomcat 3, Tomcat 4 doesn't automatically generate the 
             necessary <code>$CATALINA_HOME/conf/mod_jk.conf</code>,
             and it will have to be created manually. Note that Tomcat 
             and Apache must be restarted after adding a new context.</p>
  
             <p>The basic configuration is as follows:</p>
  
             <ul>
                <li>You will need to instruct Apache to load Tomcat. This can be
                done with Apache's LoadModule and AddModule configuration 
                directives.</li>
                <li>You must inform mod_jk the location of your 
                workers.properties file. Use mod_jk's JkWorkersFile 
                configuration directive.</li>
                <li>You should specify a location where mod_jk is going to place
                its log file and a log level to be used. Use the JkLogFile and 
                JkLogLevel configuration directives. Possible log levels are 
                debug, info, error and emerg. If the JkLogLevel is not specified,
                no log is generated.</li>
                <li>The directive JkLogStampFormat will configure the date/time 
                format found on mod_jk logfile. Using strftime() format string 
                it's set by default to "[%a %b %d %H:%M:%S %Y] "</li>
                <li>Use mod_jk's JkMount directive to assign specific URLs to 
                Tomcat. In general the structure of a JkMount directive is:
                <code>JkMount URL_PREFIX WORKER_NAME</code>. You can use the 
                JkMount directive at the top level or inside &lt;VirtualHost&gt;
                sections of your httpd.conf file.</li>
             </ul>
  
          </subsection>
  
          <subsection name="Configuring Tomcat">
  
             <p>Tomcat 4 won't automatically generate the Apache configuration 
             file at the moment.</p>
  
             <p>After enabling the AJP 1.3 connector, you need to define workers,
             using a <code>$CATALINA_HOME/conf/workers.properties</code> file.
             In most cases, using the example workers.properties given below
             should work fine, after changing the path values to reflect how your
             environment is set up.</p>
  
          </subsection>
  
          <subsection name="Example Configuration Files">
  
             <p>Excerpt from workers.properties showing the Ajp13 worker:</p>
  
  <source>
  # Setup for Solaris system
  #
  workers.tomcat_home=/usr/local/jakarta-tomcat
  workers.java_home=/usr/java
  ps=/
  worker.list=ajp12, ajp13
  
  # Definition for Ajp13 worker
  #
  worker.ajp13.port=8009
  worker.ajp13.host=localhost
  worker.ajp13.type=ajp13
  </source>
  
             <p>Excerpt from Apaches httpd.conf showing JK directives:</p>
  
  <source>
  # Load mod_jk
  #
  LoadModule jk_module libexec/mod_jk.so
  AddModule mod_jk.c
  
  # Configure mod_jk
  #
  JkWorkersFile /usr/local/jakarta-tomcat/conf/jk/workers.properties
  JkLogFile /usr/local/apache/logs/mod_jk.log
  JkLogLevel info
  
  # First Virtual Host.
  #
  &lt;VirtualHost 10.0.0.1:80>
  DocumentRoot /web/host1
  ServerName host1.apache.org
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  
  # Second Virtual Host. Also accessible via HTTPS
  #
  &lt;VirtualHost 10.0.0.2:80>
  DocumentRoot /web/host2
  ServerName host2.apache.org
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  
  &lt;VirtualHost 10.0.0.2:443>
  DocumentRoot /web/host2
  ServerName host2.apache.org
  SSLEngine On
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  &lt;/VirtualHost>
  </source>
  
          </subsection>
  
       </subsection>
  
    </subsection>
  
    <subsection name="IIS 4.x and 5.x">
  
       <subsection name="Introduction">
  
          <p>This section explains how to set up IIS 4.0 or newer to cooperate 
          with Tomcat 4. Normally IIS cannot execute Servlets and Java Server
          Pages (JSPs), configuring IIS to use Tomcat redirector plugin 
          will allow IIS to redirect Servlet and JSP requests to Tomcat.</p>
  
          <p>The Tomcat redirector for IIS is composed of four entities:
          <ul>
             <li>isapi_redirect.dll - The IIS server plugin, either obtain a 
             pre-built DLL or build it yourself (see the build section).</li>
             <li>worker.properties - A file that describes the host(s) and 
             port (s) used by the workers (Tomcat processes).</li>
             <li>uriworkermap.properties - A file that maps URL-Path patterns 
             to workers.</li>
             <li>iis_redirect.reg - A file that creates registry entries 
             in the Windows registry.</li>
          </ul>
          </p>
  
       </subsection>
  
       <subsection name="Installation">
  
          <p>Make sure the Tomcat AJP connector is properly declared in the
          Catalina configuration file.</p>
  
          <p>Download isapi_redirect.dll for Tomcat 3.3 release or use the 
          following 
          <a 
href="http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/";>link</a>.
          </p>
  
          <p>Note: See below for examples of the configuration files. Those 
          configuration files assume Tomcat is installed in the 
          <code>c:\jakarta-tomcat-4.0.1</code> directory.</p>
  
          <p>The next step is to create worker.properties to help 
          isapi_redirect.dll to identify where to find Tomcat and its 
          configuration.</p>
  
          <p>Next, the ISAPI filter for Tomcat must be configured to redirect 
          requests for specific webapps to Tomcat.</p>
  
          <p>Then the <code>uriworkermap.properties</code> file must be created
          in <code>%CATALINA_HOME%\conf</code> directory.</p>
  
       </subsection>
  
       <subsection name="Configuring IIS">
  
          <p>
          <ul>
             <li>Launch Internet Service Manager</li>
             <li>Stop the Web Site if it is running</li>
             <li>Create a virtual directory, by clicking on the default 
                 web site
                <ul>
                   <li>Type the alias to say jakarta, press Next</li>
                   <li>Set the directory to <code>%CATALINA_HOME%\bin</code>
                       where you installed isapi_redirect.dll, press next</li>
                   <li>Provide only read and execute privileges for 
                       security purposes</li>
                </ul>
             </li>
             <li>Add a filter to the default web site, using the 
             IIS Management Console, right click on the properties and 
             go to ISAPI filters tab. Press Add button, 
             add isapi_redirect.dll as a filter the name of the filter 
             should reflect its task (for example, "Jakarta Redirector"). 
             The Executable field should point to the place where we installed 
             isapi_redirect.dll, in our case 
             <code>%CATALINA_HOME%\bin\isapi_redirect.dll</code></li>
             <li>Copy and paste the registry entries found below into a file 
             iis_redirect.reg. Remember to correct the 
             directories where Tomcat is installed in this file. 
             Run the iis_redirect.reg file found at the end of this document. 
             This will create entries in the registry which 
             the isapi_redirect.dll looks for to determine the configuration 
             and location of Tomcat.</li>
             <li>Startup IIS.</li>
             <li>Go to the Properties of the web site and select the ISAPI 
             filters tab to make sure that the ISAPI filter got registered 
             correctly. It should have a Green arrow alongside it. 
             Note: it is recommended to restart computer for the ISAPI filter 
             to load.</li>
          </ul>
          </p>
  
       </subsection>
  
       <subsection name="Sample worker.properties file">
  
          <p>
  <source>
  # ************ Begin worker.properties **************
  worker.ajp13.type=ajp13
  
  #
  # Specifies the load balance factor when used with
  # a load balancing worker.
  # Note:
  #  ----> lbfactor must be > 0
  #  ----> Low lbfactor means less work done by the worker.
  worker.ajp13.lbfactor=1
  
  #
  # Specify the size of the open connection cache.
  #worker.ajp13.cachesize
  
  #
  #------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
  #---------------------------------------------------------------------
  #
  
  #
  # The loadbalancer (type lb) worker perform weighted round-robin
  # load balancing with sticky sessions.
  # Note:
  #  ----> If a worker dies, the load balancer will check its state
  #        once in a while. Until then all work is redirected to peer
  #        worker.
  worker.loadbalancer.type=lb
  worker.loadbalancer.balanced_workers=ajp13
  
  #
  # worker.tomcat_home should point to the location where you
  # installed tomcat. This is where you have your conf, webapps and lib
  # directories.
  #
  worker.tomcat_home=C:\jakarta-tomcat-4.0.1
  
  #
  # worker.java_home should point to your Java installation. Normally
  # you should have a bin and lib directories beneath it.
  #
  worker.java_home=C:\jdk1.3.1
  
  #
  # You should configure your environment slash... ps=\ on NT and / on UNIX
  # and maybe something different elsewhere.
  #
  ps=\
  
  #
  #------ ADVANCED MODE ------------------------------------------------
  #---------------------------------------------------------------------
  #
  
  #
  #------ DEFAULT worker list ------------------------------------------
  #---------------------------------------------------------------------
  #
  # The worker that your plugins should create and work with
  worker.list=ajp13
  
  #
  #------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
  #---------------------------------------------------------------------
  #
  
  #
  # Defining a worker named ajp13 and of type ajp13
  # Note that the name and the type do not have to match.
  #
  worker.ajp13.port=8009
  worker.ajp13.host=localhost
  
  # ************ End worker.properties **************
  </source>
          </p>
  
       </subsection>
  
       <subsection name="Sample uriworkermap.properties">
  
          <p>
  <source>
  # *********** Begin uriworkermap.properties ***
  #
  # Simple worker configuration file
  #
  
  # Mount the Servlet context to the ajp13 worker
  /servlet/*=ajp13
  
  # Mount the examples context to the ajp13 worker
  /examples/*=ajp13
  
  # Advanced mount of the examples context
  # /examples/servlet/*=ajp13
  # ************* End uriworkermap.properties ****
  </source>
          </p>
  
       </subsection>
  
       <subsection name="iis_redirect.reg">
  
          <p>
  <source>
  REGEDIT4
  [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]
  "extension_uri"="/jakarta/isapi_redirect.dll"
  "log_file"="C:\\jakarta-tomcat-4.0.1\\logs\\iis_redirect.log"
  "log_level"="emerg"
  "worker_file"="C:\\jakarta-tomcat-4.0.1\\conf\\worker.properties"
  "worker_mount_file"="C:\\jakarta-tomcat-4.0.1\\conf\\uriworkermap.properties"
  </source>
          </p>
  
       </subsection>
  
    </subsection>
  
  </section>
  
  
  </body>
  
  </document>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/tomcat-docs/config/webapp.xml
  
  Index: webapp.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE document [
    <!ENTITY project SYSTEM "project.xml">
  ]>
  <document>
  
    &project;
  
    <properties>
      <author email="[EMAIL PROTECTED]">Craig R. McClanahan</author>
      <title>The Webapp Connector</title>
    </properties>
  
  <body>
  
  
  <section name="Introduction">
  
    <p>The <strong>Webapp Connector</strong> element represents a
    <strong>Connector</strong> component that communicates with a web
    connector via the <code>WARP</code> protocol.  This is used for cases
    where you wish to invisibly integrate Tomcat 4 into an existing (or new)
    Apache installation, and you want Apache to handle the static content
    contained in the web application, and/or utilize Apache's SSL
    processing.  In many application environments, this will result in
    better overall performance than running your applications under
    Tomcat stand-alone using the
    <a href="http11.html">HTTP/1.1 Connector</a>.  However, the only way
    to know for sure whether it will provide better performance for
    <strong>your</strong> application is to try it both ways.</p>
  
    <p><strong>FIXME</strong> - general description of what happens at server
    startup time when you have the WARP Connector configured.</p>
  
  </section>
  
  
  <section name="Attributes">
  
    <subsection name="Common Attributes">
  
    <p>All implementations of <strong>Connector</strong>
    support the following attributes:</p>
  
    <attributes>
  
      <attribute name="className" required="true">
        <p>Java class name of the implementation to use.  This class must
        implement the <code>org.apache.catalina.Connector</code> interface.
        You must specify the standard value defined below.</p>
      </attribute>
  
      <attribute name="enableLookups" required="false">
        <p>Set to <code>true</code> if you want calls to
        <code>request.getRemoteHost()</code> to perform DNS lookups in
        order to return the actual host name of the remote client.  Set
        to <code>false</code> to skip the DNS lookup and return the IP
        address in String form instead (thereby improving performance).
        By default, DNS lookups are enabled.</p>
      </attribute>
  
      <attribute name="redirectPort" required="false">
        <p>If this <strong>Connector</strong> is supporting non-SSL
        requests, and a request is received for which a matching
        <code>&lt;security-constraint&gt;</code> requires SSL transport,
        Catalina will automatically redirect the request to the port
        number specified here.</p>
      </attribute>
  
      <attribute name="scheme" required="false">
        <p>Set this attribute to the name of the protocol you wish to have
        returned by calls to <code>request.getScheme()</code>.  For
        example, you would set this attribute to "<code>https</code>"
        for an SSL Connector.  The default value is "<code>http</code>".
        See <a href="#SSL Support">SSL Support</a> for more information.</p>
      </attribute>
  
      <attribute name="secure" required="false">
        <p>Set this attribute to <code>true</code> if you wish to have
        calls to <code>request.isSecure()</code> to return <code>true</code>
        for requests received by this Connector (you would want this on an
        SSL Connector).  The default value is <code>false</code>.</p>
      </attribute>
  
    </attributes>
  
    <p><strong>FIXME</strong> - Update the above descriptions for anything
    that the WARP Connector delegates to Apache.</p>
  
    </subsection>
  
    <subsection name="Standard Implementation">
  
    <p>The standard implementation of <strong>Webapp Connector</strong> is
    <strong>org.apache.catalina.connector.warp.WarpConnector</strong>.
    It supports the following additional attributes (in addition to the
    common attributes listed above):</p>
  
    <attributes/>
  
    <p><strong>FIXME</strong> - Document any additional configuration attributes
    supported by the WARP connector.</p>
  
    </subsection>
  
  </section>
  
  
  <section name="Nested Components">
  
    <p><strong>FIXME</strong> - Document any use of a nested <code>Factory</code>
    element for communicating with <code>mod_webapp</code> over SSL.</p>
  
  </section>
  
  
  <section name="Special Features">
  
    <p><strong>FIXME</strong> - Document any special features supported by the
    WARP Connector.</p>
  
  </section>
  
  
  </body>
  
  </document>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to