Mike,

First off, thanks for working on this doc -- it's great to see someone
bringing the user docs for mod_jk up to date.

However, two things:

 1) If you can run 'diff -u' (if you've got it from cvs, 'cvs diff -u'), it
will produce the diff in "unified" format, which makes it possible to merge
changes via the patch program.  Without that, I'd have to apply things more
or less by hand.

 2) Chris Pepper actually submitted some fixes to this same doc (mostly
reformating the HTML and fixing typos), which I have, but haven't yet
committed (my fault).   I want to apply both of your fixes.  I'm attaching a
copy of his patch.  

If you want to make me a very happy committer, you could apply his patch to
the current version under cvs, make your changes, and then produce a diff
from that (I'll then apply that and credit you both).  

If you want to make me merely a fairly happy committer, you can say, "I'm
too busy to do that Dan, so I'm just running diff -u for my fixes based on
what's currently in cvs, and I'll send you that".  Then I can merge your and
Chris's work myself (which won't kill me, and will teach me to commit things
which are sent in!).

-Dan

Mike Braden wrote:
> 
> This patch updates the mod_jk-howto.html to include the latest changes for
> TC3.3's mod_jk configuration files.
> 
> Updates:
> 
> - Updated section on configuring Tomcat to include setting up the
>   <ApacheConfig /> tag
> - Updated path references to the mod_jk.conf-auto and workers.properties
>   from conf/ to conf/jk/
> 
> Mike.
> --
> Mike Braden
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>  <<patchfile.txt>>
> 
>   ----------------------------------------------------------------------------
>                     Name: patchfile.txt
>    patchfile.txt    Type: Plain Text (text/plain)
>                 Encoding: quoted-printable
> 
>   ----------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Dan Milstein // [EMAIL PROTECTED]
Index: mod_jk-howto.html =================================================================== RCS file: /home/cvspublic/jakarta-tomcat/src/doc/mod_jk-howto.html,v retrieving revision 1.4 diff -u -d -b -r1.4 mod_jk-howto.html --- mod_jk-howto.html 2000/10/11 19:11:54 1.4 +++ mod_jk-howto.html 2001/02/28 15:24:04 @@ -61,7 +61,7 @@
  • Configuring Apache to use mod_jk
    • Removing the mod_jserv directives
    • -
    • Obtaining mod_jk
    • +
    • Obtaining and building mod_jk
    • Configuring Tomcat to use the Ajpv13 protocol
    • Defining workers for mod_jk
    • Configuring Apache to use mod_jk
    • @@ -105,7 +105,7 @@

      Definitions and terminology

      -

      During this document I am going to use a few terms, so lets define them:

      +

      During this document I am going to use a few terms, so let's define them:

      @@ -209,8 +209,8 @@

      On NT

      -

      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.

      +

      The redirector was developed using Visual C++ version 6.0, so having this +environment is a prerequisite if you want to perform a custom build.

      The steps that you need to take are:

      @@ -240,53 +240,146 @@

      For Apache

        -
      1. Make sure you have Perl 5 installed. The apxs script - used to build the module is written in Perl. +
      2. Make sure your Apache has DSO support. You can check this + with $APACHE_HOME/bin/httpd -l. If you see + "mod_so.c" in the output, DSO support is available. If it's + missing, you may have to recompile or reinstall Apache.
      3. + +
      4. Find out whether your Apache has EAPI support. If you + compiled it yourself from source, EAPI is probably not compiled + in, unless you added it yourself (perhaps with mod_ssl). You + need to build mod_jk.so with or without EAPI to match your + Apache configuration. If you install a mismatched mod_jk.so, + $APACHE_HOME/bin/apachectl configtest will warn + you.
      5. +
      6. Make sure you have Perl 5 installed. The apxs + script used to build the module is written in Perl. +
      7. Change directory to - jakarta-tomcat/src/native/apache1.3 (or apache2.0). + jakarta-tomcat/src/native/apache1.3 (or + apache2.0). -
      8. Build mod_jk.so.

        +
      9. +

        Build mod_jk.so. Following are three techniques you can try, + in order of simplicity:

        - Following are three alternate techniques you can try, in order of - simplicity. +
          +
        1. Run ./build-unix.sh, if present in this + directory. This script will set some variables, call + apxs as below, and try to copy mod_jk.so to + $APACHE_HOME/libexec. If it fails, you need to do + the following manually:
            -
          • Option 1: Run ./build-unix.sh . This script will set some - variables, call apxs as below, and try to copy mod_jk.so to - $APACHE_HOME/libexec. If it fails, you may need to do the following: -
              -
            • set JAVA_HOME in your shell, e.g. "set JAVA_HOME=/usr/local/jdk1.2.2; export JAVA_HOME"
            • -
            • set APACHE_HOME in your shell, e.g. "set APACHE_HOME=/usr/local/apache; export APACHE_HOME"
            • -
            • uncomment the following line in the build-unix.sh file, - replacing "linux" with the name of your platform as specified in the +
            • set JAVA_HOME in your shell, e.g. "set + JAVA_HOME=/usr/local/jdk1.2.2; export + JAVA_HOME"
            • +
            • set APACHE_HOME in your shell, e.g. + "set APACHE_HOME=/usr/local/apache; + export APACHE_HOME"
            • +
            • uncomment the following line in the + build-unix.sh file, + replacing "linux" with the name of your + platform as specified in the Java include directory for your installation -
              -# JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux" -
              -
          • -
          • Option 2: If build-unix.sh fails, you may have better luck with the - Makefiles in the same directory. E.g. "make -f Makefile.linux mod_jk.so" + +
            # JAVA_INCLUDE="-I + ${JAVA_HOME}/include -I + ${JAVA_HOME}/include/linux"
          • -
          • Option 3: Finally, you can try to build it manually. Run the apxs command that came with your apache distribution (hint: look in /usr/local/apache/bin, /usr/sbin, or wherever you intalled apache). Type the command all on one line.

            - For Solaris:
            -
            apxs -o mod_jk.so -DSOLARIS -I../jk -I/usr/java/include -I/usr/java/include/solaris -c *.c ../jk/*.c
            - On some systems, this will build the module correctly, but will fail at runtime with a "symbol "fdatasync" not found". To fix, add -lposix4 just before the -c in the above command.

            - For Linux: -
            apxs -o mod_jk.so -I../jk -I/usr/local/jdk/include -I/usr/local/jdk/include/linux -c *.c ../jk/*.c
            - Your build may fail because the object files from the ../jk directory have been compiled to the current directory, rather than their source directory. Running gcc -shared -o mod_jk.so *.o should finish the build.

            - (If you've installed Java in another directory, adjust accordingly). For other *nixes you should be able to work it out, but remember that the order of the arguments to apxs is important!. -

            + +
        2. - -
        3. Copy mod_jk.so to Apache's libexec directory. (Note that - build-unix.sh attempts to do this, but you may have to "su root" - first.)
        4. + +
        5. If build-unix.sh fails, you may have better luck + with the Makefiles in the same directory, e.g. + "make -f Makefile.linux mod_jk.so" +
        6. + +
        7. +

          Finally, you can try to build it manually. Run the + apxs command that came with your apache + distribution (hint: look in /usr/local/apache/bin, + /usr/sbin, or wherever you installed apache). Type the + command all on one line.

          + +
          + +

          For Linux:

          + +
          apxs -o mod_jk.so -I../jk + -I/usr/local/jdk/include -I/usr/local/jdk/include/linux + -c *.c ../jk/*.c
          + +

          Your build may fail because the object files from + the ../jk directory have been compiled to the + current directory, rather than their source directory. + Running gcc -shared -o mod_jk.so *.o + should finish the build.

          + +
          + +

          For Solaris:

          + +
          $APACHE_HOME/bin/apxs -o mod_jk.so + -DSOLARIS -I../jk -I/usr/java/include + -I/usr/java/include/solaris -c *.c + ../jk/*.c
          + +

          On some systems, this will build the module + correctly, but will fail at runtime with a + "symbol "fdatasync" not found". To + fix, add -lposix4 just before the + -c in the above command.

          + +
          + +

          For other Unixes (including FreeBSD):

          + +

          You may need to replace fdatasync() with fsync() in + jk_util.c.

          + +
          + +

          If you are using EAPI, try adding + -DEAPI to the apxs command after + mod_jk.so.

          + +

          If apxs fails with apxs:Break: Command failed + with rc=255, it may have been damaged by + mod_ssl. Search for:

          + +
          my $CFG_LD_SHLIB      = q();          # substituted via Makefile.tmpl
          +my $CFG_LDFLAGS_SHLIB = q(); # substituted via Makefile.tmpl
          +
          + +

          and change to:

          + +
          my $CFG_LD_SHLIB      = q(ld);          # substituted via Makefile.tmpl
          +my $CFG_LDFLAGS_SHLIB = q(-G); # substituted via Makefile.tmpl
          +
          + +

          If you've installed Java in another directory, + adjust accordingly.

          + +

          For other Unixes you should be able to work it out, + but remember that the order of the arguments to + apxs is important!.

          +
        8. + +
        +
      10. + +
      11. cp mod_jk.so $APACHE_HOME/libexec. (Note that + build-unix.sh attempts to do this, but you may have to + su first.)

      For other Webservers

      -There are several Makefiles in the other directories under the jakarta-tomcat/src/native directory. +

      There are several Makefiles in the other directories under the jakarta-tomcat/src/native directory.

      +

      3. (optional) Configuring Tomcat to use the Ajpv13 protocol

      @@ -301,24 +394,30 @@ <Parameter name="port" value="8009"/> </Connector> -The server.xml file already has a block similar to this for Ajp12 connections on port 8007 (as delivered by mod_jserv). Even if you think you're only using Ajp13, you probably don't want to delete this connector - it's required to shut down Tomcat. + +

      The server.xml file already has a block similar to this for +Ajp12 connections on port 8007 (as delivered by mod_jserv). Even if you +think you're only using Ajp13, you probably don't want to delete this +connector -- it's required to shut down Tomcat.

      +

      4. Defining "workers"

      Quick start?

      -In most of simple cases Tomcat can generate the needed Apache configuration. +In most cases Tomcat can generate the needed Apache configuration. When Tomcat starts up it will automatically generate a configuration file for Apache in TOMCAT_HOME/conf/mod_jk.conf-auto. Most of the time you don't need to do anything but include this file (appending "Include TOMCAT_HOME/conf/mod_jk.conf-auto") -in your httpd.conf. That's it, you can +to your httpd.conf. That's it -- you can now start Tomcat and Apache and access Tomcat from the Apache server.

      If you have special needs, for example mounting -URL prefixes that are not the default, you can use this file as a base for your +URL prefixes that are not the default, you can use this file as a base +for your own customized configuration and save the results in another file. If you manage the Apache configuration yourself you'll need to update it whenever you add a new context. @@ -507,7 +606,7 @@

      Q. Which protocol should I use? Ajp12 or Ajp13?

      A. Ajp13 is a newer protocol, it's faster, and it works better with SSL. You almost -certainly want to use that. There is more information in the +certainly want to use it. There is more information in the workers.properties howto document

      Q. Whenever I restart Tomcat, Apache locks up!

      @@ -523,7 +622,7 @@

      Credits

      This document was created by -Gal Shachor, and was revised by Mike Bremford with help from the countless many on the tomcat-dev and tomcat-user lists!

      +Gal Shachor, and was revised by Mike Bremford with help from countless others on the tomcat-dev and tomcat-user lists!

      
      
      ---------------------------------------------------------------------
      To unsubscribe, e-mail: [EMAIL PROTECTED]
      For additional commands, email: [EMAIL PROTECTED]

      Reply via email to