Archive

Archive for June 3, 2011

Quickly connect Apache httpd to Railo on Windows


Last night I was getting a development box setup using Windows 7, Apache web server and Railo.  While I generally develop on Linux I am used to this being done automagically for me, however on Windows I did not get a prompt to install the Apache connector.  Looking into the connectors folder I did not see a way to automatically get the connector installed (forgive me if I just overlooked it, Jordan).

I have made the installation on countless Linux installations so I quickly cover getting the connector setup on Windows.  The entire process should only take a few minutes assuming you already have Apache and Railo installed and running on your machine.

Step 1: Get the correct connector for your version of Apache
You can download the connector that matches your servers architecture and Apache version here: http://tomcat.apache.org/connectors-doc/

 Step 2: Copy the connector into your {apache_dir}/modules directory
At the time of this writing, the current version is mod_jk-1.2.21-httpd-2.2.3.so.  When copying the file into your modules directory rename the file mod_jk.so

Step 3: Load the module in Apache
Fire up your favorite editor and add the following line into your httpd.conf file in the modules section:

LoadModule jk_module modules/mod_jk.so

Step 4: Setup JKMount to handle cfc/cfm files
There is one last edit to make in your httpd.conf file.  You should still be in your editor so just scroll all the way to the bottom of the file and paste in this code.  I ripped this code completely from my Linux machines httpd.conf, but on Windows you do have to modify the IfModule block to check for jk_module.  The corrected listing is below:

<IfModule jk_module>
    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 C:\Apache\logs\mod_jk.log
</IfModule>

Restart httpd and Apache should be serving your ColdFusion pages and components.  It took me about 5 minutes to get this up and running, most of that time was spent digging through the Apache website looking for the mod_jk download.  This is my preferred way of configuring Windows systems so I figured I would write this down for my future reference and for anyone else who might find it useful.

Follow

Get every new post delivered to your Inbox.

Join 765 other followers