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. Quick Start JK2 Configuration Guide Mladen Turk $Date$

This document describes the configuration files used by JK2 on the Tomcat and Web Server side:

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.

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.

jk2.properties: # The default port is 8009 but you can use another one # channelSocket.port=8019 That is all needed on the Tomcat side to configure the JK2.

workers2.properties: # 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

Start the Tomcat and Web server and browse to the http://localhost/examples/

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.

jk2.properties: # 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

workers2.properties: # 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

Start the Web server and browse to the http://localhost/examples/