One year ago I was moving my first steps with Java webservices and today with Java annotations the task to write a webservice is easier.
I’ve already talked about installing mod_jk but it was with Java 1.4 and Tomcat 4.1. Today I’m trying with Java 1.6 and Tomcat 5.5 with apache 1.3.
From http://www.apache.org/dist/tomcat/tomcat-connectors/jk/source/ I get the source code of the current stable (1.2.21).
$ tar xfvz tomcat-connectors-1.2.21-src.tar.gz
$ cd tomcat-connectors-1.2.21-src/native
$ ./configure –with-apxs=/usr/local/bin/apxs
$ make
$ sudo make install
Libraries have been installed in:
/usr/local/libexec
$ vi /usr/local/conf/workers.properties
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
In /usr/local/conf/httpd.conf I add the following line
Include conf/mod_jk.conf
$ vi /usr/local/conf/mod_jk.conf
# Load mod_jk module
LoadModule jk_module libexec/mod_jk.so
# Declare the module for <IfModule directive> (remove this line on Apache 2.x)
# AddModule mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /usr/local/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /usr/local/logs/mod_jk.shm
# Where to put jk logs
JkLogFile /usr/local/logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] “
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /kines_api/* worker1
JkMount /private_api/* worker1
After the tests, JKMount will be defined in apache VirtualHost context.