integrating Tomcat with Apache
843841Jan 17 2005 — edited Mar 13 2005Hi there,
I'm really stuck here. I'm trying to integrate Apache with Tomcate. Not having much luck. I have a number of things that aren't quite right. For whatever reason the connector (mod_jk2) between Apache and Tomcat isn't doing its thing. First things first however. I'm not so sure about the log from Tomcat:
17-Jan-2005 3:56:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 6517 ms
17-Jan-2005 3:56:08 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
17-Jan-2005 3:56:08 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.4
17-Jan-2005 3:56:08 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
17-Jan-2005 3:56:14 PM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
17-Jan-2005 3:56:16 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
17-Jan-2005 3:56:16 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
17-Jan-2005 3:56:17 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
17-Jan-2005 3:56:17 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
17-Jan-2005 3:56:21 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
17-Jan-2005 3:56:21 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/632 config=null
17-Jan-2005 3:56:22 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 14657 ms
Shouldn't this line: INFO: JK2: ajp13 listening on /0.0.0.0:8009
read like this: INFO: JK2: ajp13 listening on /127.0.0.1:8009
or: INFO: JK2: ajp13 listening on /localhost:8009
If I'm right, then how do I make it listen on the localhost address 127.0.0.1?
Please help,
Alan
My configuration files under tomcat are like so:
*******************************************************
# file://usr/local/tomcat/conf/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=${jkHome}/work/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
#
# Socket Configuration
#
channelSocket.port=8009
channelSocket.address=127.0.0.1
channelSocket.maxPort=port+10
**********************************************************************
# file://usr/local/tomcat/conf/workers.properties
...
#
#------ DEFAULT worket list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=ajp13
# , inprocess
...
#
#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#
#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=50
#
# Specify the size of the open connection cache.
worker.ajp13.cachesize=10
...
*************************************************
# file://usr/local/tomcat/conf/workers2.properties
...
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
...