I'm trying to setup Apache2 and mod_jk2 to pass Tomcat requests via JNI. After reading two or three HOWTOs and previously setting up a similar config on Windows 2000 server, I've managed to make some progress on RedHat 7.3. Unfortunately, when I start Apache2, I get an jk2 error message about every 2-5 seconds. Here is a example from a recent run.

[Tue Jun 03 21:51:35 2003] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Jun 03 21:51:36 2003] [notice] Apache/2.0.46 (Unix) mod_ssl/2.0.46 OpenSSL/0.9.6b mod_jk2/2.0.2 configured -- resuming normal operations
[Tue Jun 03 21:51:41 2003] [error] jk2_init() Can't find child 2545 in scoreboard
[Tue Jun 03 21:51:50 2003] [error] jk2_init() Can't find child 2560 in scoreboard
[Tue Jun 03 21:51:51 2003] [error] jk2_init() Can't find child 2568 in scoreboard
[Tue Jun 03 21:51:58 2003] [error] jk2_init() Can't find child 2575 in scoreboard
[Tue Jun 03 21:51:59 2003] [error] jk2_init() Can't find child 2583 in scoreboard


I've read somewhere that this might be related to the Jkstatus directive, so I removed it from my workers2.properties file. This seemed to have no effect.

Also, sending requests such as http://localhost/ stall without any additional errors any of Apache or Tomcat's log files. I'm guessing this has something to do with the scoreboard error, but may be because Tomcat isn't getting launched in-process with Apache. Removing the LoadModule directive for mod_jk2 allows the static Apache2 welcome page to load.

In brief, Apache2 was built from source using..

./configure --prefix=/usr/local/apache2 --enable-ssl --enable-module=so

mod_jk2.0.2 was also built from source using...

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-tomcat41=/usr/local/tomcat --with-java-home=$JAVA_HOME --with-jni --with-pcre

:: jk2.properties

## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.
## COMMENTS WILL BE _LOST_
## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8019
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config is working
#shm.file=/usr/local/Apache2/logs/jk2.shm
# In order to enable jni use any channelJni directive
channelJni.disabled = 0
# And one of the following directives:
# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inprocess

:: workers2.properties

[config:]
#file=${serverRoot}/conf/workers2.properties
file=/usr/local/Apache2/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=0

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/usr/local/apache2/logs/jk2.shm
size=1000000
debug=0
disabled=0


[workerEnv:]
info=Global server options
timing=1
debug=0

[lb:lb]
info=Default load balancer.
debug=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009

[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess

[vm:]
info=Parameters used to load a JVM in the server process
JVM=/usr/java/Java/jre/lib/i386/server/libjvm.so
OPT=-Djava.class.path= /usr/local/tomcat/bin/tomcat-jni.jar; /usr/local/tomcat/lib/commons-logging.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=0


[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
disabled=0
stdout=/usr/local/apache2/logs/stdout.log
stderr=/usr/local/apache2/logs/stderr.log


[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
disabled=0


[uri:/examples]
info=Example webapp in the default context.
context=/examples
debug=0

[uri:/examples/servlets/*]
info=Prefix mapping

[uri:/examples/*.jsp]
info=Extension mapping

[uri:/examples/*]
info=Map the whole webapp

[uri:/examples/servlets/HelloW]
info=Exampel with debug enabled.
debug=10

Since I was planning on creating a HOWTO on this, you can also find details of my current configuration here...

http://www.pixelfreak.net/howto/apache2_jk2_tomcat/

This document is incomplete, but shows what I've done so far.

Thanks in advance,

~Scott


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



Reply via email to