tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pérez Velo, Pedro Isabelo" <pedro...@sevillana.grupoendesa.com>
Subject Connecting Multiple Tomcat instances with Apache (mod_jk2)
Date Tue, 02 Sep 2003 08:31:45 GMT


Hello, 
I'm trying to connect by the jk2 connector, several Tomcat v4.1.18 instances
with one Apache v2.0. We have Suse 2.4.19 as O.S. The problem arise when we
connect several instances of Tomcat with Apache, note that we have changed
the CATALINA_BASE variable to enable multiple tomcat instances. I don't know
exactly what is happening, but it's looks like there are some problems
defining multiple workers.
Next I attach several configuration files both tomcat, as Apache and the
mod_jk2 connector.
This is a fragment of the server.xml file in which you define the connector.
/entornos/pds-pi/conf/server.xml
----------------------------------------------------------------------------
---------------------------------------------------------------------
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="41880" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="41843"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
----------------------------------------------------------------------------
---------------------------------------------------------------------
We have installed two Tomcats, one in /usr/local/jakarta-tomcat-4.1.18 owned
by root (which is normally stopped), and another in /usr/local/tomcat-4.1.18
owned by a specific user tomcat4118. We accomplished this without many
problems, however the connector don't work with these tomcat instances. We
need to have different Tomcat instances for not interfering distinct develop
equipments when we stop Tomcat.
/entornos/pds-pi/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=41809
# 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
----------------------------------------------------------------------------
---------------------------------------------------------------------
/usr/local/apache/conf/workers2.properties
----------------------------------------------------------------------------
---------------------------------------------------------------------
#---- workers2.properties
worker.list=worker1,worker2
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=41809
[logger]
level=DEBUG
file=/usr/local/apache/logs/jk2.log 
[config]
file=/usr/local/apache/conf/workers2.properties
debug=0
debugEnv=0
# Shared memory handling. Needs to be set.
[shm]
file=/usr/local/apache/logs/shm.file
size=1048576
debug=0
disabled=0

[channel.socket.local_8009:localhost:8009]
port=8009
host=127.0.0.1
debug=0

[channel.socket.local_41809:localhost:41809]
port=41809
host=127.0.0.1
debug=0
# Example socket channel, explicitly set port and host.
# [channel.socket:localhost:8009]
# port=8009
# host=127.0.0.1
# Example UNIX domain socket
# [channel.un:/usr/local/tomcat/work/jk2.socket]
# tomcatId=localhost:8009
# debug=0
# define the worker
[ajp13:localhost:8009]
#channel=channel.un:/usr/local/pds/tomcat/work/jk2.socket
# To use the TCP/IP socket instead, just comment out the above
# line, and uncomment the one below
#channel=channel.socket:localhost:8009
channel=channel.socket.local_8009:localhost:8009
# define the worker
[ajp13:localhost:41809]
#channel=channel.un:/usr/local/pds/tomcat/work/jk2.socket
# To use the TCP/IP socket instead, just comment out the above
# line, and uncomment the one below
#channel=channel.socket:localhost:41809
channel=channel.socket.local_41809:localhost:41809
# Announce a "status" worker
[status:status]
# Uri mapping
[uri:/examples/*]
worker1=ajp13:localhost:8009
# worker=ajp13:/usr/local/pds/tomcat/work/jk2.socket
# Uri mapping
[uri:/pds-pi/*]
worker2=ajp13:localhost:41809
#worker=ajp13:localhost:8009
# worker=ajp13:/usr/local/pds/tomcat/work/jk2.socket
# Uri mapping
[uri:/pds-pi2/*]
worker1=ajp13:localhost:8009
# worker=ajp13:/usr/local/pds/tomcat/work/jk2.socket
# Uri mapping
[uri:/pds-mc/*]
worker1=ajp13:localhost:8009
# worker=ajp13:/usr/local/pds/tomcat/work/jk2.socket
# Uri mapping
[uri:/pdsinet/*]
worker1=ajp13:localhost:8009
# worker=ajp13:/usr/local/pds/tomcat/work/jk2.socket
[uri:/status/*]
worker=status:status
[uri:/TSWeb/*]
worker=ajp13:localhost:8009
#---- end of workers2.properties
----------------------------------------------------------------------------
---------------------------------------------------------------------
I am no interested in Load Balancing at the moment, only in connecting
multiple Tomcat instances via mod_jk2 with one Apache. 
I can see the next error messages in the Apache log file:
[Thu Aug 28 09:05:41 2003] [error] env.createBean2(): Error getting factory
for [worker.list] (null)
[Thu Aug 28 09:05:41 2003] [error] config.update(): Can't create worker.list
[Thu Aug 28 09:05:41 2003] [error] env.createBean2(): Error getting factory
for [worker.worker2.type] (null)
[Thu Aug 28 09:05:41 2003] [error] config.update(): Can't create
worker.worker2.type
[Thu Aug 28 09:05:41 2003] [error] env.createBean2(): Error getting factory
for [worker.worker2.host] (null)
[Thu Aug 28 09:05:41 2003] [error] config.update(): Can't create
worker.worker2.host
[Thu Aug 28 09:05:41 2003] [error] env.createBean2(): Error getting factory
for [worker.worker2.port] (null)
[Thu Aug 28 09:05:41 2003] [error] config.update(): Can't create
worker.worker2.port
Could anyone help my?
Regards.

	Pedro Isabelo Pérez Velo
	Tel. 954417311-954536609 Ext.514115
	Implantaciones e Infraestructura
	Dirección de Sistemas y Telecomunicaciones
	ENDESA SERVICIOS
	mailto:pedroisa@sevillana.grupoendesa.com





	Pedro Isabelo Pérez Velo
	Tel. 954417311-954536609 Ext.514115
	Implantaciones e Infraestructura
	Dirección de Sistemas y Telecomunicaciones
	ENDESA SERVICIOS
	mailto:pedroisa@sevillana.grupoendesa.com




Mime
View raw message