Oliver Hookins wrote:

I've been trying to find some decent documentation on setting up Tomcat to communicate with mod_jk2 and Apache over unix sockets. So far what I've found suggests I only need to alter jk2.properties with details of the socket, and workers2.properties with the same details. I've done this and restarted Tomcat and it still appears to be creating the TCP/IP socket on port 8009, but not creating any unix socket file.

Has anyone got a working Tomcat 5.5 mod_jk2 configuration using Unix sockets I'd love to know what you did to set it up.


Hmm, well, there are several things to consider.

First, in order to use UNIX socket, you need to have and link JNI library specially built for your OS. UNIX sockets are not a part of Java world and to use them you need JNI library which is a part of mod_jk2 source distribution. You'll also need Apache-Dev RPMs or libapr+libaprutil, if I recall correctly.

Then you need something like this (this is from my 4.1.24)

jk2.config
----------
apr.NativeSo=/usr/lib/apache2-extramodules/jkjni.so
handler.list=apr,request,channelUnix
channelUnix.file=${jkHome}/work/tomcat.sock
request.tomcatAuthentication=false

workers2.properties
---------------------
[logger]
level=DEBUG

[config:]
debug=0
debugEnv=0

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

# Alternate file logger
[logger.file:0]
level=DEBUG
file=/var/log/httpd/mod_jk2.log

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

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

[channel.un:unixsock]
info=Main socket to Tomcat engine
file=/var/tomcat4/work/tomcat.sock

[status:]
info=Status worker, displays runtime informations

[ajp13:unixsock]
info=Default AJP 1.3 worker
channel=channel.un:unixsock

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:www.elektrovojvodina.co.yu/racun]
info=Uvid u racun potrosaca
group=ajp13:unixsock
#context=/racun

It should be very similar to mod_jk.

Nix.

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

Reply via email to