Installing Railo on Tomcat via Apache on Leopard – Step by Step

After a bit of fiddling and head scratching I managed to install Railo on Tomcat via Apache on my laptop running on OS X 10.5.6.


Firstly, download Tomcat 6

extract content:

tar xvzf apache-tomcat-6.0.18.tar.gz

Move Tomcat to a more secure place:

sudo mv apache-tomcat-6.0.18 /usr/local/tomcat


Download Railo custom version

extract and move into Tomcat lib directory:

tar zxvf railo-
sudo mv railo-* /usr/local/tomcat/lib

Make Tomcat and Railo work together by modifying the web config file:

sudo nano /usr/local/tomcat/conf/web.xml

add the following inside the <web-app> element:

<description>Configuraton directory</description>

add the following inside <welcome-file-list> element:



Leopard OS comes with Apache 2, so you don't have to worry about installing it. However, you need to download The Apache Tomcat Connector source code.

Next you need to compile the source so that the resulting binary file is compatible with your Intel Mac architecture. I got this from Eric Rank's blog

cd into tomcat source:

cd tomcat-connectors-1.2.27-src/native

Edit the apache-2.0/ file.

$(APXS) -c -o $@ -Wc,"${APXSCFLAGS} ${JK_INCL}" "${JAVA_INCL}" "${APXSLDFLAGS}" mod_jk.c ${APACHE_OBJECTS}

$(APXS) -c -o $@ -Wc,"${APXSCFLAGS} -arch x86_64 ${JK_INCL}" "${JAVA_INCL}" "${APXSLDFLAGS} -arch x86_64 " mod_jk.c ${APACHE_OBJECTS}

configure the build files:

./configure --with-apxs=/usr/sbin/apxs

now go into apache-2.0 directory and build:

cd apache-2.0
make -f Makefile.apxs

Finally install

sudo make install

Now specify the connection between Apache and Tomcat. To do this you need to create file. I created mine in /etc/apache2.

sudo nano /etc/apache2/

Paste the following:



Now we need to modify the Apache httpd.conf file:

sudo nano /etc/apache2/httpd.conf

Enable The Apache Tomcat Connector:

LoadModule jk_module libexec/apache2/

Underneath that tell Apache where your file is located and add some logging info (could be useful):

# Mod_jk settings
JkWorkersFile /etc/apache2/
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
DirectoryIndex index.html index.htm index.cfm index.cfml

Back to Tomcat

To test our Railo installation, let's create a test site by adding a new virtual host in both Tomcat and Apache. We do this by modifying Tomcat server.xml file (/usr/local/tomcat/conf/server.xml )

<Host name="railo.local" appBase="webapps">
<Context path="" docBase="/Library/Webserver/Documents"/>


Now we need to create a virtual host entry in Apache as well:

<VirtualHost *:80>
JkMount /*.cfm default
ServerName railo.local
DirectoryIndex index.cfm

JkMount /*.cfm default

Tells mod_jk to use the connector specified in your file when it encounters a .cfm extension.


Notice that in my Apache VirtualHost entry there is no DocumentRoot. I originally had it in there and it was breaking my Apache-Tomcat connection. It was driving me mad. It's probably because document root is already specified in /usr/local/tomcat/conf/server.xml.

One last thing, to start your Tomcat server type in this command:


shut down


My assumption is that the above steps would be very similar on other operating systems as long as you use the correct file paths.

Good luck 🙂


Related Content

This post was posted in , , , , by on