tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric J. Pinnell" <e...@iCky.org>
Subject Re: Problems with mod_jk2
Date Tue, 24 Jun 2003 23:52:50 GMT
Here is a simple config to get if off the ground for a TCP connection:

After you have loaded mod_jk2.so in the modules directory of apache add:

LoadModule jk2_module modules/mod_jk2.so
JkSet config.file /path/to/apache/conf/workers2.properties

to your httpd.conf file.

Then in /path/to/apache/conf/workers2.properties put:

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:ip.number.goes.here:8009]
port=8009
host=ip.number.goes.here

# define the worker
[ajp13:ip.number.goes.here:8009]
channel=channel.socket:ip.number.goes.here:8009

# Uri mapping
[uri:*.jsp]
worker=ajp13:ip.number.goes.here:8009

You can also use tomcatId instead of calling out the host and the port.

Then use the jk2.properties file that comes with tomcat.  This is the one
that has everything commented out.  You don't need it because apache is
doing the work.

Use the default Connector entry in server.xml for the Coyote/JK2
connector.

This creates a simple single worker, non-loadbalanced connection.  You can
look at the example workers2.properties that comes with the connectors
source and get an idea how to do loadbalancing.  But basically you create
loadbalancing workers and add workers to the load balancer group.  Then
you map the URI to the loadbalancer group and it uses the workers you
defined in that have in that group to connect to Tomcat.

At least that's what I have been working with.  Seems to work.

-e




On Tue, 24 Jun 2003, Nikola Milutinovic wrote:

> Hi all.
>
> "mod_jk2" is bugging me properly. It is not working right now and it never did. I could
have made a number of mistakes, so if someone could point at them, I'd be grateful. This are
the relevant files:
>
> jk2.properties
> --------------
> handler.list=request,container,channelSocket
>
> channelSocket.port=8009
> channelSocket.address=192.168.61.16
> --------------
>
> server.xml
> ----------
> [SNIP]
>
> <Service name="Tomcat-Apache-JK2">
>     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
>     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8009" minProcessors="5"
>        maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0"
>        connectionTimeout="0" useURIValidationHack="false"
>        protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
>
>     <Engine name="ajp13" debug="0"/>
>     <Host name="Kerberos-1.ev.co.yu" appBase="/usr/users/test/webapp">
>       <Context docBase="/usr/local/java/jakarta-tomcat-4.1.24/webapps/tomcat-docs"
>                path="/tomcat-docs" />
>       <Context docBase="evracun" path="/evracun">
>   </Host>
> </Service>
> ------------
>
> worker2.properties
> --------------------
> [logger]
> level=DEBUG
>
> [config:]
> file=${serverRoot}/conf/add-on/workers2.properties
> debug=0
> debugEnv=0
>
> [uriMap:]
> info=Maps the requests. Options: debug
> debug=0
>
> # Alternate file logger
> [logger.file:0]
> level=DEBUG
> file=${serverRoot}/logs/jk2.log
>
> [shm:]
> info=Scoreboard. Required for reconfiguration and status with multiprocess servers
> file=${serverRoot}/logs/jk2.shm
> size=1000000
> debug=0
> disabled=0
>
> [workerEnv:]
> info=Global server options
> timing=1
> debug=0
> logger=logger.file:0
>
>
> [channel.socket:Test.ev.co.yu:8009]
> info=Ajp13 forwarding over socket
> debug=0
> host=Test.ev.co.yu
> port=8009
>
> [ajp13:Test.ev.co.yu:8009]
> channel=channel.socket:Test.ev.co.yu:8009
>
> [status:status]
> info=Status worker, displays runtime information
>
> [uri:Kerberos-1.ev.co.yu/jkstatus]
> info=Display status information and checks the config file for changes.
> group=status:status
>
> [uri:Kerberos-1.ev.co.yu/evracun-jk2/*]
> info=EVracun application on Test.ev.co.yu
> context=/evracun
> group=ajp13:Test.ev.co.yu:8009
> -------------------------
>
> apache_error.log
> ------------------
> [Tue Jun 24 14:22:20 2003] [notice] mod_jk.post_config() first invocation
> [Tue Jun 24 14:22:22 2003] [notice] LDAP: Built with OpenLDAP LDAP SDK
> [Tue Jun 24 14:22:22 2003] [notice] LDAP: SSL support unavailable
> [Tue Jun 24 14:22:23 2003] [notice] Digest: generating secret for digest authentication
...
> [Tue Jun 24 14:22:23 2003] [notice] Digest: done
> [Tue Jun 24 14:22:24 2003] [notice] mod_jk.post_config() second invocation
> [Tue Jun 24 14:22:24 2003] [error] jk2_init() Can't find child 26827 in scoreboard
> [Tue Jun 24 14:22:24 2003] [error] jk2_init() Can't find child 26576 in scoreboard
> ------------------
>
> jk2.log
> -------
> [Tue Jun 24 14:22:19 2003] ( info ) [jk_logger_file.c (184)]  Initializing log file /usr/opt/Apache-2.0.46W/logs/jk2.log
> [Tue Jun 24 14:22:22 2003] ( info ) [jk_logger_file.c (184)]  Initializing log file /usr/opt/Apache-2.0.46W/logs/jk2.log
> [Tue Jun 24 14:22:24 2003] (error ) [jk_logger_file.c (172)]  Can't open log file /usr/opt/Apache-2.0.46W/logs/jk2.log
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (377)]  uriMap.init() Fixing Host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri null context
null host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /jkstatus context
null host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /evracun-jk2/*
context /evracun host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] ( info ) [jk_uriMap.c (490)]  uriMap: creating context Kerberos-1.ev.co.yu/evracun
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri null context
null host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri / context /
host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri / context /
host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /evracun context
/evracun host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] ( info ) [jk_workerEnv.c (403)]  workerEnv.init() ok /usr/opt/Apache-2.0.46W/config/add-on/workers2.prop
> erties
> [Tue Jun 24 14:22:24 2003] (error ) [mod_jk2.c (557)]  mod_jk child init 1 -2
> [Tue Jun 24 14:22:24 2003] (error ) [jk_logger_file.c (172)]  Can't open log file /usr/opt/Apache-2.0.46W/logs/jk2.log
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (377)]  uriMap.init() Fixing Host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri null context
null host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /jkstatus context
null host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /evracun-jk2/*
context /evracun host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] ( info ) [jk_uriMap.c (490)]  uriMap: creating context Kerberos-1.ev.co.yu/evracun
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri null context
null host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri / context /
host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri / context /
host *
> [Tue Jun 24 14:22:24 2003] (debug ) [jk_uriMap.c (464)]  uriMap: fix uri /evracun context
/evracun host Kerberos-1.ev.co.yu
> [Tue Jun 24 14:22:24 2003] ( info ) [jk_workerEnv.c (403)]  workerEnv.init() ok /usr/opt/Apache-2.0.46W/config/add-on/workers2.prop
> erties
> [Tue Jun 24 14:22:24 2003] (error ) [mod_jk2.c (557)]  mod_jk child init 1 -2
> ----------------
>
> Any idea?
>
> Nix.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message