Links Installation | Building jk on Unix |
The mod_jk build use the widely used configure system.
Prepare your mod_jk configure from CVS |
In case you get source from CVS, ie without an existing configure script,
you should have autoconf for configuration and installation.
To create jakarta-tomcat-connectors's autoconf script, you will need libtool 1.3.3 or higher,
and autoconf 2.13 or newer.
Those tools will not be required if you are just using a package downloaded from apache.org,
they are only required for developers.
To create the configure script just type :
[user@host] ~ $ ./buildconf.sh
|
|
Using configure to build mod_jk |
The configure file produced using buildconf script will create all necesary make files.
Here's how to use configure to prepare mod_jk for building, just type:
[user@host] ~ $ ./configure [autoconf arguments] [jakarta-tomcat-connectors arguments]
|
You could set CFLAGS and LDFLAGS to add some platform specifics:
[user@host] ~ $ LDFLAGS=-lc ./configure -with-apxs=/home2/local/apache/bin/apxs
|
If you want to build mod_jk for Apache 1.3, you should
-
use configure and indicate Apache 1.3 apxs location (--with-apxs)
-
use make
-
copy the mod_jk binary to the apache modules location
-
make clean (to remove all previously compiled modules)
-
then make.
|
configure arguments |
Apache related parameters :
Parameter | Description |
---|
--with-apxs[=FILE] |
FILE is the location of the apxs tool. Default is finding apxs in PATH.
It builds a shared Apache module. It detects automaticly the Apache version.
| --with-apache=DIR |
DIR is the path where apache sources are located.
The apache sources should have been configured before configuring mod_jk.
DIR is something like: /home/apache/apache_1.3.33
It builds a static Apache module.
| --enable-EAPI |
This parameter is needed when using Apache-1.3 and mod_ssl, otherwise you will get the error message:
"this module might crash under EAPI!" when loading mod_jk.so in httpd.
Not needed when --with-apxs has been used.
| --enable-maitainer-mode |
Build mod_jk enabling maintainer or DEBUG mode.
|
JNI related parameters :
Parameter | Description |
---|
--enable-jni |
Build the JNI worker and so the build process will require
some informations about your Java Environment. Most of the options are
autodetected.
| --with-java-home=DIR |
DIR is the patch to the JDK root directory. Something like: /opt/java/jdk12
| --with-os-type=SUBDIR |
SUBDIR is the os-type subdirectory,
configure should guess it correctly.
| --with-arch-type=SUBDIR |
SUBDIR is the arch subdirectory,
configure should guess it correctly.
| --with-java-platform=VAL |
VAL is the Java platform 1 is 1.1.x and 2 is for 1.2 anf higher,
configure should guess it correctly.
|
Examples of configure use :
Apache 1.3 build without JNI support [user@host] ~ $ ./configure --with-apxs=/opt/apache1/bin/apxs
[user@host] ~ $ make
[user@host] ~ $ make install
|
|
|
Building mod_jk for Apache on Windows NT/2K/XP |
The module 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:
-
Change directory to the apache 1.3 source directory.
-
If you want to build mod_jk for Apache 1.3, set an APACHE1_HOME environment variable which points
to where your Apache 1.3 is installed.
-
You can use the free Microsoft tools for building mod_jk. You will need to download the
Platform SDK and
Microsoft Visual C++ Toolkit 2003
Copy the nmake.exe from PlatformSDK\bin\Win64 to PlatformSDK\bin.
Apache 1.3 build on WIN32 using free VCToolkit c:\>C:\Vctoolkit\vcvars32.bat
c:\>C:\PlatformSDK\setenv.bat
c:\>nmake -f Makefile.vc
|
-
Copy mod_jk.so to Apache's modules directory.
An example on how to build mod_jk for Apache 1.3:
Set location for Apache 1.3 sources c:\>set APACHE1_HOME=c:\apache13
Change directory to the mod_jk module for Apache 1.3 c:\>cd c:\home\apache\jk\native\apache-1.3
Build the sources using MSDEV c:\>MSDEV mod_jk.dsp /MAKE ALL
Copy the dll to your apache modules directory c:\>cp release\mod_jk.so c:\apache13\modules\
|
If msdev is not in your path, enter the full path to msdev.exe.
Also, ApacheCore.lib is expected to exist in the ${APACHEX_HOME}\src\CoreD and
${APACHEX_HOME}\src\CoreR directories before linking will succeed.
You will need to build enough of the Apache source to create these libraries.
This will build both release and debug versions of the redirector plug-in (mod_jk).
An alternative will be to open mod_jk.dsp in msdev and build it using the build menu.
|
Building mod_jk for Apache on MacOS/X |
The configure file produced using buildconf script will create all necesary make files.
The build process is the same as for Unix platforms. Here are the Mac OS X (10.2.x) build notes :
Assuming that you are root :
For Apache 1.3: [user@host] ~ $ ./configure --with-apxs=/opt/apache1/bin/apxs
[user@host] ~ $ cd apache-1.3
[user@host] ~ $ make -f Makefile.apxs
[user@host] ~ $ make -f Makefile.apxs install
|
|
Getting mod_jk linked statically with Apache |
mod_jk allows to install mod_jk in the Apache source tree to get a statically
linked mod_jk. Having mod_jk in the httpd executable brings some performance
improvements. The configure option --with-apache prepare mod_jk to install it
in the Apache source tree.
The examples below show how to get mod_jk in the httpd process.
Installation in Apache-1.3 :
/home/apache/apache_1.3.33 is the directory where the apache-1.3 sources
are located. [user@host] ~ $ ./configure --with-apache=/home/apache/apache_1.3.33
[user@host] ~ $ make
Install the libjk library, mod_jk.c, includes and other files in
/home/apache/apache_1.3.33/src/modules/jk: [user@host] ~ $ make install
Configure in the Apache sources: [user@host] ~ $ cd /home/apache/apache_1.3.33
[user@host] ~ $ configure ... --enable-module=dir --disable-shared=dir \
--activate-module=src/modules/jk/libjk.a \
--disable-shared=jk
[user@host] ~ $ make
[user@host] ~ $ make install
|
The --enable-shared=jk is also working and builds a dso file.
Just change the configure in the Apache sources: [user@host] ~ $ configure ... --enable-module=dir --enable-shared=dir \
--activate-module=src/modules/jk/libjk.a \
--enable-shared=jk
|
|
|