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.
Hi there. Thanks for this. I have been looking for Amazon SES examples in CF 7 or 8… However, you went the “script route.” Isn’t there another way to send using API calls right out of CF? Advantages I see:
1) This cuts out the need for an email server at all
2) This allows you to build an app that might use many different Amazon SES accounts (secret keys).
Any flaw in this thinking?
I know the sticking point is going to be the HmacSHA256 signed key. I ran into this when upgrading the Amazon Product API calls a few years ago. CF7 didn’t support this encryption, but CF8 did… Any thoughts on this?
Thx
Sorry for taking so long to comment, but I have been out for the last week or so. The component should be easy to to convert to tag-based CFML and I know at least one person who has already done this.
It should work with little modification pre-CF9, but since Railo 3.x is my production environmnent I don’t really have the time to convert/test it.
Using multiple keys would be fairly simple to implement by setting your secret keys in the application and moving it out of the awscredentials.properties file. As soon as I have a little time I may take a look at that.
Wow this was soo helpful. The other ways I saw around google wasn’t nearly this simple.
Thank you for your kind words. I am always happy to help!