Dear all,
I managed to compile a version of mod_jk.so for Apache 2 and
tomcat 4 on linux with some minor changes to the build scripts.
Version info:
- RHat Linux 6.2
- gcc 2.91.66
- Sun Java JDK 1.4
- Apache 2.0.34
- Tomcat 4.0.4-b2
- tomcat-connectors-4.0.4-b2 (native mod_jk.so)

Load balancing also works between W2K and Linux!

Here's what you need to do:
1. Download src, build & install Apache 2.0.35
2. set APACHE_HOME to the installation(runtime) directory
   Eg. Let's assume you install into /usr/local/apache2
   export APACHE_HOME=/usr/local/apache2
3. Download tomcat connector src and extract to any directory
from
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.
4-b2/src/jakarta-tomcat-connectors-4.0.4-b2-src.tar.gz
   (make sure you copy the entire url)
   Eg. Let's assume you extract the zip into
   /tmp/jakarta-tomcat-connectors-4.0.4-b2-src
3. Ensure JAVA_HOME is properly configured
4. cd /tmp/jakarta-tomcat-connectors...src/jk/native/apache-2.0
5. Edit build-unix.sh and change the contents according to the
diff.txt attached. For those who fear looking at diff reports,
you may use the updated build-unix.sh attached as well.
6. ./build-unix.sh
   You may note some 'undefined reference to ...' errors - that's
ok.
   The script will ultimately use gcc and compile mod_jk.so and
copy
   to the <APACHE_HOME>/modules directory
7. Add the following to <APACHE_HOME>/conf/httpd.conf:
      Include conf/mod_jk.conf
8. Attached is my sample mod_jk.conf (with load balancing
configured)
9. Other files attached:
   workers.properties (ajp13 load balancing to a W2K PC and Linux
PC)
   As for steps to config load balancing on tomcat, follow
instructions on tomcat's site. ONE OF the config changed in
TOMCAT/conf/server.xml:

   <Engine jvmRoute="tomcat1" name="Standalone"
defaultHost="localhost">

   Other instructions are very clear at the site.

10. Startup tomcat then apache
11. Pray that it works :)

Good luck!

-keng wong

-keng wong
--- build-unix.sh.old   Sat Mar 23 22:09:26 2002
+++ build-unix.sh       Wed Apr 24 11:23:04 2002
@@ -37,13 +37,16 @@
 # Figure out INCLUDE directories
 
 # use "find" to pick the right include directories for current machine
-JAVA_INCLUDE="`find ${JAVA_HOME}/include -type d | sed 's/^/-I /g'`" ||  echo "find 
failed, edit build-unix.sh source to fix"
+# this method fixed the newline problem
+for line in `find ${JAVA_HOME}/include -type d`;do
+    JAVA_INCLUDE="${JAVA_INCLUDE} -I ${line} "
+done
 
 # if "find" fails, use (uncomment) the following instead, substituting your
 # platform for "linux"
 # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux"
 
-INCLUDE="-I ../common -I$APACHE_HOME/include/apr-util $JAVA_INCLUDE"
+INCLUDE="$JAVA_INCLUDE -I $APACHE_HOME/include -I $APACHE_HOME/srclib/apr/include -I 
+$APACHE_HOME/srclib/apr-util/include"
 # SRC="mod_jk.c ../common/*.c"
 SRC="*.c"
 
@@ -52,12 +55,15 @@
 
 # Run APXS to compile module
 echo Compiling mod_jk
-cp ../common/*.c .
-$APXS -c -o mod_jk.so $INCLUDE $LIB $SRC
+cp ../common/*.c ../common/*.h .
+$APXS -c -o mod_jk.so $INCLUDE $SRC
+
+# Compile mod_jk.so
+gcc -shared -o mod_jk.so *.o
 
 # Copy mod_jk.so into the apache libexec directory
 echo Installing mod_jk.so into $APACHE_HOME/libexec
-cp mod_jk.so $APACHE_HOME/libexec
+cp -p mod_jk.so $APACHE_HOME/modules
 
 # Done!
 echo "Done. Install by running ./install-unix.sh"

Attachment: build-unix.sh
Description: Binary data

Attachment: mod_jk.conf
Description: Binary data

Attachment: workers.properties
Description: Binary data

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to