Connect Apache HTTPD To Railo On Windows

Published: {ts '2013-01-01 00:00:00'}
Author: Steven Neiland
Site Url: http://www.neiland.net/article/connect-apache-httpd-to-railo-on-windows/

With the recent release of Railo4 I have decided to switch from ColdFusion to Railo as my primary development cfml engine. This comes at a good time for me as I just built myself a new development machine so I am starting with a clean environment.

Now I have installed Railo on linux multiple times without any issue, and likewise on windows machines running IIS. However my new development machine runs on windows but uses Apache httpd instead of IIS. This is a problem as it seems the windows installer does not have an option for installing the apache connector. So here is how you install the connector manually.

PreRequisites

This guide assumes you have already installed apache httpd and railo using their installers.

Step 1: Get the connector

The first step is obviously to get the The Apache Tomcat Connector from the tomcat website. Note that there are different connectors for different versions of Apache. I run apache 2.2 so I downloaded tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip file from the Windows Binaries section.

Step 2: Extract And Install The Module File

Extract the downloaded zip file and then copy mod_jk{version number}.so to "{apache install dir}/modules/mod_jk.so"

Step 3: Load The Module

With the module file saved open the httpd.conf file and add the follow code block to the LoadModules section.

LoadModule jk_module modules/mod_jk.so

Step 4: Configure "jk_module" To Handle ".cf*" Files

With the httpd.conf file still open, go to the bottom of the file and copy in this code block to configure apache to pass cfml files to tomcat for processing.

JkMount /*.cfm ajp13 JkMount /*.cfc ajp13 JkMount /*.do ajp13 JkMount /*.jsp ajp13 JkMount /*.cfchart ajp13 JkMount /*.cfres ajp13 JkMount /*.cfm/* ajp13 JkMount /*.cfml/* ajp13 JkMountCopy all JkLogFile logs/mod_jk.log JkShmFile logs/mod_jk.shm

Step 5: Configure Apache To Serve index.cfm by Default

One final step. Still in the httpd.conf file, locate the DirectoryIndex command and add index.cfm to the list of files to server as a directory index.

DirectoryIndex index.cfm index.html

Save these changes and restart the httpd service. You should now be up and running.

Note To Self: Confirm Directory Access

This is not really related to this problem but I'm putting it in as a note for myself.

I created a "test.localhost" domain with the folder being located in my user workspace. When I accessed the site with http://test.localhost/ i got a 403, yet when I went to http://test.localhost/index.cfm it worked. The problem was I had not allowed indexes for my workspace folder where I normally put my projects.

Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all