Deploying Pebble 2.0 with Apache/Tomcat

First, Pebble is a Java/JSP based weblog software. It requires some kind of servet container, in my case, I choosed Tomcat 5.5.x. However, I will likely switch to glassfish at some point.

Second, the Tomcat container runs on x86 Solaris 10, each application is integrated with the SMF, more on that later.

Third, www.alopi.com is a virtual domain served by apache 2.2.x. The communication between Apache and Tomcat is using AJP 1.3. However, Apache and Tomcat run on the same machine, without load balancers

The steps for implementing this solution are:

  • install mod_jk along with apache
  • configure the workers (in my case, only one, on localhost)
  • configure the virtual host, mod_jk, and workers in the apache httpd.conf
  • unzip pebble.war inside a directory
  • change Tomcat's server.xml to redefine the default path to point to the pebble directory

Below are the extracts of the relevant configuration elements :
apache mod-jk.conf (included at the end of httpd.conf)

# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info

apache extra/httpd-vhosts.conf (included in httpd.conf)

<VirtualHost *:80>
ServerName www.alopi.com
DocumentRoot /usr/local/alopi/pebble
JkMount /* localWorker
</VirtualHost>

apache workers.properties (referenced in mod-jk.conf)
worker.list=localWorker

worker.localWorker.port=8009
worker.localWorker.host=localhost
worker.localWorker.type=ajp13
Tomcat server.xml The following code snipet assume that the default application for the tomcat deployment is pebble. Identical result could have been achieved by deploying the pebble war in the ROOT directory under webapps. This code goes into the default virtual host in my case:
<Context path="" docBase="/usr/local/alopi/pebble" debug="0" />

Here you have it, I cannot guarantee that this will work for you, but it should give you some hints. I've not re-verified that these instructions work from scratch, I hope that I did not forgot something.

Tags :



Add a comment

TrackBack