blob: 05a5cf5535277ceae145ea3021168a41314f14e9 [file] [log] [blame]
<?xml version="1.0"?>
<document>
<copyright>
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.
</copyright>
<properties>
<title>Quick Start JK2 Configuration Guide</title>
<author email="mturk@mappingsoft.com">Mladen Turk</author>
<date>$Date$</date>
</properties>
<section name="Introduction">
<p>
This document describes the configuration files used by JK2 on the
Tomcat and Web Server side:
<ul>
<li>
<b>jk2.properties</b> is used on the Tomcat side. It's installation path in
the $TOMCAT_HOME/conf directory.
</li>
<li>
<b>workers2.properties</b> is used on the webserver side. For the Apache
servers the default path is in the ServerRoot/conf directory.
</li>
</ul>
Although JK2 has many things in common with mod_jk, the configuration is quite
different, and all the directives should be inside the workers2.properties.
This enables JK2 to have the same configuration file no mater what the web server
it's connected to.
</p>
</section>
<section name="Minimum Configuration">
<p>
Minimum configuration is the simplest one to make the JK2 working. The used
channel will be socket, and lot of options are used by default. Both the
Tomcat and web server are on the same computer.
</p>
<p>
jk2.properties:
<source>
# The default port is 8009 but you can use another one
# channelSocket.port=8019
</source>
That is all needed on the Tomcat side to configure the JK2.
</p>
<p>
workers2.properties:
<source>
# Define the communication channel
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
tomcatId=localhost:8009
# Map the Tomcat examples webapp to the Web server uri space
[uri:/examples/*]
info=Map the whole webapp
</source>
</p>
<p>
Start the Tomcat and Web server and browse to the <a>http://localhost/examples/</a>
</p>
</section>
<section name="Minimum JNI Configuration">
<p>
Minimum JNI configuration is the simplest one to make the Tomcat working
from inside the web server as inprocess. The only comunication channel used
is JNI. The JK2 will register all the native calls by itself, so there is
no need to specify the native library on Java side.
</p>
<p>
jk2.properties:
<source>
# Add the apr and channelJni to the list of handlers
handler.list=apr,request,container,channelJni
# The native libraries will be registered by JK2
apr.jniModeSo=inprocess
</source>
</p>
<p>
workers2.properties:
<source>
# Define the comunication channel
[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess
# Define the parameters for the Java Virtual Machine
[vm:]
info=Parameters used to load a JVM in the server process
OPT=-Djava.class.path=${TOMCAT_HOME}/lib/tomcat-jni.jar;${TOMCAT_HOME}/lib/tomcat.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
# JNI worker startup handler
[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
stdout=${serverRoot}/logs/stdout.log
stderr=${serverRoot}/logs/stderr.log
# JNI worker shutdown handler
[worker.jni:onShutdown]
info=Command to be executed by the VM on shutdown. This one will stop tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
# Map the Tomcat examples webapp to the Web server uri space
[uri:/examples/*]
info=Map the whole webapp
</source>
</p>
<p>
Start the Web server and browse to the <a>http://localhost/examples/</a>
</p>
</section>
</document>