Uncategorized

Setup mod_jk on Ubuntu (Dapper) for Ofbiz

Here are a few of my notes on how I got ofbiz running through mod_jk on Ubuntu. It is assumed that you already have ofbiz up and running.

Install a few Ubuntu packages required prior to building mod_jk:
apt-get install libtool automake autoconf apache2-threaded-dev

Download the latest version of tomcat-connectors In my case, it was 1.2.23.

Build and install the mod_jk libraries with the following commands:
tar xvzf tomcat-connectors-1.2.23-src.tar.gz
cd tomcat-connectors-1.2.23-src/native
./buildconf.sh
./configure --with-apxs=/usr/bin/apxs2
make
make install

This installed the libraries in /usr/lib/apache2/modules.

Create /etc/apache2/mods-enabled/jk.load:
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so

Create /etc/apache2/mods-enabled/jk.conf:
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/jk.log
JkMount /ecommerce/* worker1
JkMount /images/* worker1
JkMount /content/* worker1

Create /etc/apache2/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

There are no extras defined here. This is only to get things up and running. There are extra steps that you should take to ensure that things are secure.
I haven’t looked into it in too much detail, but there are links for the shopping cart that point to https://hostname:443 which need to be handled in the ofbiz configuration.

Thanks to http://www.hishboy.com/index.php/2007/06/19/jboss-420ga-clustering-on-ubuntu-fiesty-704/ for the config help.