<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Jamie Krug&apos;s ColdFusion Blog</title>
			<link>http://jamiekrug.com/blog/index.cfm</link>
			<description>Jamie Krug&apos;s ColdFusion blog, regarding ColdFusion/CFML and other programming adventures as well as some learning experiences. EDB: Event Driven Blogging (in the event that I actually have something worth sharing:)</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 18:53:38 -0400</pubDate>
			<lastBuildDate>Tue, 31 Aug 2010 22:27:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>jamie@jamiekrug.com</managingEditor>
			<webMaster>jamie@jamiekrug.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>jamie@jamiekrug.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Jamie Krug&apos;s ColdFusion Blog</title>
				<link>http://jamiekrug.com/blog/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>CFML on Tomcat via Apache AJP Proxy, Redux</title>
				<link>http://jamiekrug.com/blog/index.cfm/2010/8/31/cfml-tomcat-apache-ajp-proxy-redux</link>
				<description>
				
				I often use &lt;a href=&quot;http://tomcat.apache.org/&quot;&gt;Tomcat&lt;/a&gt; as my servlet container to power my CFML apps (works great for &lt;a href=&quot;http://www.adobe.com/products/coldfusion/&quot;&gt;ColdFusion&lt;/a&gt;, &lt;a href=&quot;http://www.openbluedragon.org/&quot;&gt;Open BlueDragon&lt;/a&gt; and &lt;a href=&quot;http://www.getrailo.org/&quot;&gt;Railo&lt;/a&gt;!). I&apos;ve been perfectly happy with the power and flexibility of using Apache HTTPD&apos;s mod_rewrite with an AJP proxy, as &lt;a href=&quot;http://corfield.org/blog/post.cfm/Railo_for_Dummies_Part_IV_Appendix&quot;&gt;Sean Corfield has detailed&lt;/a&gt;. Then, after repeating a lot of rewrite rules in all of my virtual host definitions, I decided to merely place the following in my main Apache configuration file:

&lt;code&gt;&lt;Proxy *&gt;
    Allow from 127.0.0.1
&lt;/Proxy&gt;
ProxyPreserveHost On
ProxyPassMatch  ^/(.+\.cf[cm])(/.*)?$  ajp://localhost:8009/$1$2&lt;/code&gt;

That&apos;s it! Now, any Apache virtual hosts for CFML application can be defined as simple as this:

&lt;code&gt;&lt;VirtualHost *:80&gt;
    ServerName myrockinapp
    DocumentRoot /var/www/myrockinapp
    DirectoryIndex index.cfm
&lt;/VirtualHost&gt;&lt;/code&gt;

I can still easily add URL rewriting to my Apache virtual hosts. For example, when using &lt;a href=&quot;http://www.getmura.com/&quot;&gt;Mura CMS&lt;/a&gt; I often set the properties siteIdInURLs=0 and indexFileInURLs=0 to make super clean looking URLs (with no siteID or index.cfm in the URLs). This then of course requires a rewrite rule to ensure the proper requests are passed to Tomcat, which is as simple as adding these lines to your virtual host (or an .htaccess file in your Web root):

&lt;code&gt;RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^([a-zA-Z0-9/-]+)$ /index.cfm%{REQUEST_URI} [PT]&lt;/code&gt;

Makes all the configuration I used in &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2009/5/22/url-rewrite-goodies-for-apache-tomcat-railo-and-mura-cms&quot;&gt;this post&lt;/a&gt; look a bit silly now :P

Also, if you&apos;re interested in a clean, production-worthy server setup running on &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt; 10.04 with Railo, Tomcat, Apache and MySQL, I have this fairly well documented in &lt;a href=&quot;http://docs.google.com/View?id=dchcmx7_70dqhqgsdw&quot;&gt;this Google Doc&lt;/a&gt;.
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Tomcat</category>				
				
				<category>Open BlueDragon</category>				
				
				<category>ColdFusion</category>				
				
				<category>Mura CMS</category>				
				
				<category>Railo</category>				
				
				<category>Apache</category>				
				
				<pubDate>Tue, 31 Aug 2010 22:27:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2010/8/31/cfml-tomcat-apache-ajp-proxy-redux</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Git Global Ignores, Can Be Overridden</title>
				<link>http://jamiekrug.com/blog/index.cfm/2010/5/27/git-global-ignores-can-be-overridden</link>
				<description>
				
				First off, I&apos;m loving &lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt; (fast/awesome/free/open-source distributed version control system). If you haven&apos;t already, check it out!

I&apos;d like to briefly mention how to ignore certain files from version control, both by project and globally. I&apos;d also like to confirm that it&apos;s very easy to add files to version control, which are normally globally ignored.

Git makes it simple to ignore certain files/directories/patterns from version control by creating a .gitignore file in your project root, and optionally in any sub-directory. Check out the &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/gitignore.html&quot;&gt;gitignore docs page&lt;/a&gt; for more.

That said, I quickly found myself ignoring the same patterns for every repository. Fortunately, Git also makes it easy to globally ignore patterns. You just set a global config property of core.excludesfile to tell Git where to look for a global gitignore file. The following two commands take care of setting the property and creating a file with a few popular ignore patterns.

&lt;code&gt;git config --global core.excludesfile ~/.gitignore
printf &quot;.project\n*.iml\n.idea/\nWEB-INF/\n&quot; &gt;&gt; ~/.gitignore&lt;/code&gt;

The above commands will work on both Linux and Mac. Windows users will likely want to locate a global .gitignore file in some common user settings directory. You can then create/edit the text file any way you&apos;d like.

For me, on &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu Linux&lt;/a&gt;, I end up with a /home/jkrug/.gitignore file that looks like this:

&lt;code&gt;.project
*.iml
.idea/
WEB-INF/&lt;/code&gt;

You can also manually edit your .gitignore file, of course, and add comments if you&apos;d like:

&lt;code&gt;# Eclipse project files
.project

# IntelliJ IDEA project files
*.iml
.idea/

# Java WAR directories
WEB-INF/&lt;/code&gt;

Now here&apos;s the bonus: if you have one repository in which you&apos;d like to add a file that is globally ignored to version control, you can do so. Simply use a standard add command with a -f flag, e.g.,

&lt;code&gt;git add -f WEB-INF/web.xml&lt;/code&gt;

The global ignores are especially useful to me when I &lt;a href=&quot;http://help.github.com/forking/&quot;&gt;fork a project&lt;/a&gt; that may not have an ignore for my primary IDE&apos;s (&lt;a href=&quot;http://www.jetbrains.com/idea/&quot;&gt;IntelliJ IDEA&lt;/a&gt;) configuration files. And when I have a custom project in which I&apos;d like to add one of those global ignores--no problem!

Happy versioned coding :)
				
				</description>
						
				
				<category>Git</category>				
				
				<category>Ubuntu</category>				
				
				<pubDate>Thu, 27 May 2010 11:06:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2010/5/27/git-global-ignores-can-be-overridden</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>cf.Objective() 2010: Intro to JEE Servlet Containers for ColdFusion Developers</title>
				<link>http://jamiekrug.com/blog/index.cfm/2010/1/27/cf-objective-2010-jee-servlet-containers-for-coldfusion-developers</link>
				<description>
				
				I am thrilled and honored to have the opportunity to speak at this year&apos;s &lt;a href=&quot;http://cfobjective.com/&quot;&gt;cf.Objective()&lt;/a&gt; 2010 conference! My session title is &quot;Intro to JEE Servlet Containers for ColdFusion Developers&quot; and here is the preliminary description I used when submitting my session topic:

&lt;blockquote&gt;An alternate title for this session might be, &quot;What the heck is a servlet container and what does it have to do with CFML?&quot; We&apos;ll discuss the relationship between CFML &quot;engines&quot; (i.e., servlets), JEE application servers and servlet containers, and Web servers. Understanding the basics of this relationship can provide CFML developers with a greater confidence to leverage underlying Java tools, improve development environments and deployments and write more flexible and powerful applications.&lt;/blockquote&gt;

&lt;h3&gt;Why Bother?&lt;/h3&gt;

I submitted this topic because I believe there are &lt;em&gt;many&lt;/em&gt; CF developers, of all skill levels, with very little knowledge in this area. I was most certainly one of these developers for the better part of my CF career thus far! Over the past year or two I&apos;ve developed a much deeper understanding of Java Enterprise Edition (JEE/J2EE), Servlets, Servlet Containers, Java Application Servers and Web servers. Most importantly I&apos;ve learned a lot more about how &lt;a href=&quot;http://www.adobe.com/products/coldfusion/&quot;&gt;Adobe ColdFusion&lt;/a&gt;, &lt;a href=&quot;http://openbluedragon.org/&quot;&gt;Open BlueDragon&lt;/a&gt; and &lt;a href=&quot;http://www.getrailo.org/&quot;&gt;Railo&lt;/a&gt; leverage the power of these Java platform specifications.

Much of my learning has been out of necessity -- and I feel like I had to do it the hard way (on my own)! But looking back, had I possessed some base knowledge in the right areas, I really think I may have put all the puzzle pieces together much more quickly. So I&apos;m hoping to provide these building blocks in my cf.Objective() session this year.

You don&apos;t need to become a Java guru to grok these concepts, but they can greatly increase your toolset as a ColdFusion developer, allowing you to design and develop more robust applications and gain greater marketability in the job market. Here are some points that I hope to provide attendees:

&lt;ul&gt;
&lt;li&gt;10,000-foot view of how CFML Engines, Servlet Containers, Java Applications Servers and Web Servers interact to make the magic we&apos;ve all come to know and love&lt;/li&gt;
&lt;li&gt;Understanding the many options the Adobe ColdFusion installer provides and what you can (and might want to) do on your own&lt;/li&gt;
&lt;li&gt;Confidence and flexibility in CF development environments (application isolation, starting app servers from your IDE, super-simple portability, etc.)&lt;/li&gt;
&lt;li&gt;Configuration options to keep both development and production environments running smoothly&lt;/li&gt;
&lt;li&gt;Understanding and leveraging EAR/WAR deployments&lt;/li&gt;
&lt;li&gt;Awareness of the many options and not being afraid to check them out!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Lots to talk about, feedback needed!&lt;/h3&gt;

As you can imagine, there is a lot that can be covered here. My goal for this session is to provide an understanding of the important pieces of the big picture, tools you can put to immediate use, and a confidence to safely explore more deeply. If any of the concepts or buzz words I&apos;ve mentioned in this post are scary, please know that they&apos;re not -- not if you start in the right place.

If you feel any one area or concept that I&apos;ve mentioned would be of greatest value to you... If you have a more specific question that keeps coming up, or something that you continue to avoid... If you know this stuff cold, but see common problem points out in the CFML community... I would highly value your feedback as I continue to refine my session preparation. Please comment on this blog post or use my &lt;a href=&quot;http://jamiekrug.com/blog/contact.cfm&quot;&gt;contact form&lt;/a&gt; to contact me directly.

Whether you&apos;re already grokking some or none of what I&apos;ve discussed here, I hope you can make it to my cf.Objective() session and take away some useful bits!
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Open BlueDragon</category>				
				
				<category>ColdFusion</category>				
				
				<category>Java</category>				
				
				<category>Railo</category>				
				
				<pubDate>Wed, 27 Jan 2010 15:23:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2010/1/27/cf-objective-2010-jee-servlet-containers-for-coldfusion-developers</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Bash Script to Set Sensible Directory/File Permissions</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/12/28/bash-script-to-set-sensible-directory-file-permissions</link>
				<description>
				
				Every once in a while a directory structure&apos;s permissions just get messy (or an archive I download and extract has stupid permissions, like making every single file executable). So I&apos;ll occasionally want to &lt;em&gt;chmod 755&lt;/em&gt; all directories and &lt;em&gt;chmod 644&lt;/em&gt; all files. If you&apos;re new to file system permissions in Linux, let me translate that goal. For every directory I want the owner to be able to read/write/execute (execute allows to cd into directory) and both group and all others to have read/execute permissions. For every file I want the owner to have read/write permissions and both the group and all others to have read-only permission. The Ubuntu Community Documentation has a good &lt;a href=&quot;https://help.ubuntu.com/community/FilePermissions&quot;&gt;&lt;em&gt;File&lt;/em&gt; Permissions page&lt;/a&gt; that covers this in more detail.

That same documentation has a &lt;em&gt;&lt;a href=&quot;https://help.ubuntu.com/community/FilePermissions#Recursive%20chmod%20using%20find,%20pipemill,%20and%20sudo&quot;&gt;Recursive chmod using find, pipemill, and sudo&lt;/a&gt;&lt;/em&gt; section that details precisely the two commands I need, but I hate to waste time finding this link and carefully remembering what I want to do. So, I&apos;ve whipped up a simple &lt;a href=&quot;http://en.wikipedia.org/wiki/Bash&quot;&gt;Bash&lt;/a&gt; script that simply accepts a directory path as its only parameter and prompts me to confirm before making the permission changes. Here it is.

&lt;code&gt;#!/bin/bash

# exit this bash script if any statement returns a non-true return value (same as: set -e)
set -o errexit

if [ -z &quot;$1&quot; ]; then
	echo
	echo &quot;ERROR: Must pass parameter of path to directory (which will have permissions set accordingly; 755 directories and 644 files).&quot;
	echo &quot;USAGE: $0 /path/to/directory&quot;
	echo
	exit 1
fi

echo
echo &quot;Working recursively with directory $1 this script will chmod 755 all directories and chmod 644 all files.&quot;

read -p &quot;Okay to continue (y/n)? &quot;
if [ &quot;$REPLY&quot; != &quot;y&quot; ]; then
	echo
	echo &quot;EXITING -- NO ACTION TAKEN.&quot;
	echo
	exit 1
fi

echo
echo &quot;Starting...&quot;
echo

find &quot;$1&quot; -type d -print0 | xargs -0 chmod 755
find &quot;$1&quot; -type f -print0 | xargs -0 chmod 644

echo &quot;Done.&quot;
echo

exit 0&lt;/code&gt;

Since I&apos;ll often need to run this script as root, I&apos;ve taken a few extra steps to protect it by making it owned and executable only by root:

&lt;code&gt;sudo chown root:root setperms.sh
sudo chmod 744 setperms.sh&lt;/code&gt;

So, from the directory containing this script (as you can see I&apos;ve named mine &lt;em&gt;setperms.sh&lt;/em&gt;), here&apos;s an example usage:

&lt;code&gt;sudo ./setperms.sh ~/directory-to-clean-up-permissions&lt;/code&gt;

If your directory has strange owners and/or groups set, you can quickly clean that up recursively as well. For example:

&lt;code&gt;sudo chown -R jkrug:jkrug ~/directory-to-clean-up-permissions&lt;/code&gt;
				
				</description>
						
				
				<category>Linux</category>				
				
				<category>Bash</category>				
				
				<pubDate>Mon, 28 Dec 2009 15:57:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/12/28/bash-script-to-set-sensible-directory-file-permissions</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>SvnAnt Task/Type Definition Import</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/10/13/svnant-task-type-definition-import</link>
				<description>
				
				I&apos;m finally getting wise and leveraging &lt;a href=&quot;http://ant.apache.org/&quot;&gt;ANT&lt;/a&gt; more, and yesterday was my first attempt at integrating some &lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;Subversion&lt;/a&gt; tasks. I discovered &lt;a href=&quot;http://subclipse.tigris.org/svnant.html&quot;&gt;SvnAnt&lt;/a&gt; rather quickly, but didn&apos;t have a good sense for the best way to leverage it. Marc Esher kindly helped with a response to my &lt;a href=&quot;http://blog.mxunit.org/2009/09/using-svnant-in-your-ant-build-files.html&quot;&gt;comment here&lt;/a&gt;.

Rather than repeating a bunch of path/fileset/typedef lines in every build file that requires SVN tasks, I decided to create a simple build file that would handle this type definition and allow me to place just one import line into each build file that requires SVN tasks.

To start, I downloaded the proper SvnAnt distribution (&lt;a href=&quot;http://subclipse.tigris.org/svnant.html&quot;&gt;from here&lt;/a&gt;), unzipped the folder under my /opt directory (I&apos;m running &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu&lt;/a&gt;), and created a symbolic link to the folder so I can reference it as /opt/svnant.

Then, under my /opt/svnant folder I created a build file called svnant-typedef.xml with the following:

&lt;code&gt;&lt;!--
	This build file serves to map SvnAnt&apos;s task and type names to their implementing classes.
	This file should be located in the SvnAnt distribution folder root (parent directory of /lib).
	It can be imported to any build file, rather than repeating, for example:
	&lt;import file=&quot;/opt/svnant/svnant-typedef.xml&quot; /&gt;
--&gt;
&lt;project name=&quot;svnant-typedef&quot; basedir=&quot;.&quot;&gt;

	&lt;!-- get directory of current build file --&gt;
	&lt;dirname property=&quot;svnant.basedir&quot; file=&quot;${ant.file.svnant-typedef}&quot; /&gt;

	&lt;!-- file set for SVNAnt classpath reference --&gt;
	&lt;path id=&quot;svnant.classpath&quot;&gt;
		&lt;fileset dir=&quot;${svnant.basedir}/lib&quot;&gt;
			&lt;include name=&quot;*.jar&quot; /&gt;
		&lt;/fileset&gt;
	&lt;/path&gt;

	&lt;!-- task/type definitions for SVNAnt library --&gt;
	&lt;typedef resource=&quot;org/tigris/subversion/svnant/svnantlib.xml&quot; classpathref=&quot;svnant.classpath&quot; /&gt;

&lt;/project&gt;&lt;/code&gt;

You can read about the ANT import task and its special properties &lt;a href=&quot;http://ant.apache.org/manual/CoreTasks/import.html&quot;&gt;here&lt;/a&gt;.

Now I need only import the above file in build file&apos;s that will use SVN tasks. Here&apos;s an example:

&lt;code&gt;&lt;project name=&quot;example&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;

	&lt;import file=&quot;/opt/svnant/svnant-typedef.xml&quot; /&gt;

	&lt;target name=&quot;main&quot;&gt;
		&lt;svn svnkit=&quot;true&quot; javahl=&quot;false&quot;&gt;
			&lt;export srcurl=&quot;file:///home/svn/example/trunk&quot; destpath=&quot;/tmp/example&quot; /&gt;
		&lt;/svn&gt;
	&lt;/target&gt;

&lt;/project&gt;&lt;/code&gt;
				
				</description>
						
				
				<category>ANT</category>				
				
				<category>Subversion</category>				
				
				<pubDate>Tue, 13 Oct 2009 15:05:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/10/13/svnant-task-type-definition-import</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Apache Authentication with Proxy</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/8/6/apache-authentication-with-proxy</link>
				<description>
				
				I&apos;ve enjoyed leveraging Apache mod_rewrite and mod_proxy to leverage both the power of URL rewriting and the APJ proxy to proxy CFML requests to &lt;a href=&quot;http://getrailo.org/&quot;&gt;Railo&lt;/a&gt; running on &lt;a href=&quot;http://tomcat.apache.org/&quot;&gt;Tomcat&lt;/a&gt;. I allow Apache to still handle requests for static assets (images, javascript, etc.). Today, I ran into a problem when I wanted to slap some basic authentication on a site. Requests handled entirely by Apache (static assets) were challenged for authentication, but CFML requests were proxied to Tomcat without requiring authentication. It makes perfect sense, as did the solution once I found it, but it just didn&apos;t occur to me at first.

First, here&apos;s a quick example of a basic virtual host that I&apos;d use:

&lt;code&gt;&lt;VirtualHost *:80&gt;
	ServerName mysite
	DocumentRoot /var/www/mysite/webroot/
	DirectoryIndex index.cfm

	&lt;Proxy *&gt;
		Allow from 127.0.0.1
	&lt;/Proxy&gt;

	ProxyPreserveHost On
	ProxyPassReverse  /  ajp://mysite:8009/

	RewriteEngine On

	RewriteRule  ^(.+\.cf[cm])(/.*)?$  ajp://%{HTTP_HOST}:8009$1$2  [P]
&lt;/VirtualHost&gt;&lt;/code&gt;

After creating a password file using the htpasswd command, I thought I&apos;d simply add the following inside my VirtualHost to provide basic authentication.

&lt;code&gt;&lt;Directory /var/www/mysite/webroot/&gt;
	AuthType Basic
	AuthName &quot;Restricted Files&quot;
	AuthUserFile /usr/local/etc/apache/mysite.passwd
	Require user someusername
&lt;/Directory&gt;&lt;/code&gt;

Unfortunately, as I mentioned, this only protected non-proxied requests. Fortunately, I found the tip for my solution relatively quickly at stackoverflow, &lt;a href=&quot;http://stackoverflow.com/questions/724599/setting-up-an-apache-proxy-with-authentication&quot;&gt;here&lt;/a&gt;. I simply needed to apply the same authentication directives within the Proxy context.

Here&apos;s the revised virtual host with basic authentication for both static assets and those proxied to Tomcat:

&lt;code&gt;&lt;VirtualHost *:80&gt;
	ServerName mysite
	DocumentRoot /var/www/mysite/webroot/
	DirectoryIndex index.cfm

	&lt;Directory /var/www/mysite/webroot/&gt;
		AuthType Basic
		AuthName &quot;Restricted Files&quot;
		AuthUserFile /usr/local/etc/apache/mysite.passwd
		Require user someusername
	&lt;/Directory&gt;

	&lt;Proxy *&gt;
		Allow from 127.0.0.1
		AuthType Basic
		AuthName &quot;Restricted Files&quot;
		AuthUserFile /usr/local/etc/apache/mysite.passwd
		Require user someusername
	&lt;/Proxy&gt;

	ProxyPreserveHost On
	ProxyPassReverse  /  ajp://mysite:8009/

	RewriteEngine On

	RewriteRule  ^(.+\.cf[cm])(/.*)?$  ajp://%{HTTP_HOST}:8009$1$2  [P]
&lt;/VirtualHost&gt;&lt;/code&gt;
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Tomcat</category>				
				
				<category>Railo</category>				
				
				<category>Apache</category>				
				
				<pubDate>Thu, 06 Aug 2009 22:53:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/8/6/apache-authentication-with-proxy</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Catch-all Apache Virtual Host to Force WWW Redirect on Canonical Hostnames</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/8/6/catch-all-apache-virtual-host-to-force-www-redirect-on-canonical-hostnames</link>
				<description>
				
				I find myself doing the same thing with nearly every Web site that I launch on my VPS (and client VPS/dedicated servers). I was to use http://www.domain.com as the primary host and have http://domain.com permanently redirect (301) while keeping the request URI intact.

Today, I decided to simplify this configuration by using a single Apache virtual host to handle all &quot;www redirects.&quot; I thought I&apos;d share this simple little tip.

When using name based hosting with Apache, this is very simple with mod_rewrite:

&lt;code&gt;
&lt;VirtualHost *:80&gt;
	ServerName  jamiekrug.com
	ServerAlias thekrugs.com

	RewriteEngine On
	RewriteRule  .  http://www.%{HTTP_HOST}%{REQUEST_URI}  [R=301,NE,L]
&lt;/VirtualHost&gt;
&lt;/code&gt;

Now, as I add other virtual hosts to the server, I need only add a ServerAlias line to the above virtual host and I&apos;m good to go.
				
				</description>
						
				
				<category>Apache</category>				
				
				<pubDate>Thu, 06 Aug 2009 16:07:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/8/6/catch-all-apache-virtual-host-to-force-www-redirect-on-canonical-hostnames</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFC Creation Time in ColdFusion 8/9, Open BlueDragon 1.1 and Railo 3.1</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/7/21/cfc-creation-time-in-coldfusion-8-9-open-bluedragon-11-and-railo-31</link>
				<description>
				
				There&apos;s lots of chatter about CFC creation performance in the popular CFML engines (&lt;a href=&quot;http://www.adobe.com/products/coldfusion/&quot;&gt;Adobe ColdFusion&lt;/a&gt;, &lt;a href=&quot;http://openbluedragon.org/&quot;&gt;Open BlueDragon&lt;/a&gt; and &lt;a href=&quot;http://www.getrailo.org/&quot;&gt;Railo&lt;/a&gt;), and plenty of others have ran their own tests, but I&apos;m just curious and had to see some tests for myself. 

I do not intend to encourage anyone to choose any one engine over another solely based on these tests. This is just one small indicator of the many performance considerations! In a real world application, there are &lt;strong&gt;many&lt;/strong&gt; other performance considerations (hardware, operating system, application server, JVM tuning, CFML engine admin settings, various cache mechanisms, database server, database tuning, etc.).

I&apos;m just focused on the speed of CFC creation here. In many small or medium sized apps, this is not much of a factor, but in larger applications where large sets of objects need to be created, this can potentially become crippling to application performance.

Also keep in mind that not all CFML applications are guaranteed or even likely to migrate flawlessly between any two CFML engines, despite lots of great progress towards compatibility and a core CFML spec. There are also lots of vendor specific features that may sway a particular developer or team to a particular CFML engine, and this may vary from project to project.

I could ramble on with more disclaimers, but let&apos;s get to the good stuff!
				 [More]
				</description>
						
				
				<category>CFML</category>				
				
				<category>Open BlueDragon</category>				
				
				<category>ColdFusion</category>				
				
				<category>Railo</category>				
				
				<pubDate>Tue, 21 Jul 2009 16:50:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/7/21/cfc-creation-time-in-coldfusion-8-9-open-bluedragon-11-and-railo-31</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>&quot;Does anyone have an opinion on Adobe Coldfusion?&quot;</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/7/2/opinion-on-adobe-coldfusion-cfml</link>
				<description>
				
				&lt;p&gt;A (very) brief list of ColdFusion/CFML resource links in response to Tweet from &lt;a href=&quot;http://twitter.com/ryanmaurodesign&quot;&gt;@ryanmaurodesign&lt;/a&gt;: &amp;quot;Does anyone have an opinion on Adobe Coldfusion?&amp;quot;&lt;/p&gt;
&lt;p&gt;The short answer: yes :) There is a vibrant CFML community and many will be excited to tell you why it&apos;s so fantastic!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.adobe.com/products/coldfusion/evangelism_kit/&quot;&gt;Adobe ColdFusion Evangelism Kit&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other major (open source and free) CFML engines:&lt;br /&gt;
&lt;a href=&quot;http://www.openbluedragon.org/&quot;&gt;Open BlueDragon&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.getrailo.org/&quot;&gt;Railo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.opencfml.org/&quot;&gt;CFML Advisory Committee&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ColdFusion is a Java EE application... &lt;a href=&quot;http://en.wikipedia.org/wiki/Coldfusion#ColdFusion_and_Java&quot;&gt;http://en.wikipedia.org/wiki/Coldfusion#ColdFusion_and_Java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just a few of the very many busy bloggers:&lt;br /&gt;
&lt;a href=&quot;http://forta.com/&quot;&gt;Ben Forta&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://bennadel.com/&quot;&gt;Ben Nadel&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.carehart.org/&quot;&gt;Charlie Arehart&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://halhelms.com/&quot;&gt;Hal Helms&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.coldfusionjedi.com/&quot;&gt;Ray Camden&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://corfield.org/&quot;&gt;Sean Corfield&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;...and a bunch more ;-)&lt;br /&gt;
&lt;a href=&quot;http://coldfusionbloggers.org/&quot;&gt;http://coldfusionbloggers.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A bunch of open source ColdFusion apps (as well as other Adobe RIA related stuff):&lt;br /&gt;
&lt;a href=&quot;http://riaforge.org/&quot;&gt;RIAForge&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Popular MVC frameworks (there are more):&lt;br /&gt;
&lt;a href=&quot;http://www.coldboxframework.com/&quot;&gt;ColdBox&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.fusebox.org/&quot;&gt;Fusebox&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mach-ii.com/&quot;&gt;Mach-II&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.model-glue.com/&quot;&gt;Model-Glue&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other popular frameworks (there are more):&lt;br /&gt;
&lt;a href=&quot;http://coldspringframework.org/&quot;&gt;ColdSpring (&amp;quot;Spring framework for ColdFusion&amp;quot;)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://reactorframework.com/&quot;&gt;Reactor (ORM)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.transfer-orm.com/&quot;&gt;Transfer ORM&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There&apos;s a ton of other great information out there, so go check it out! (Ignore the occasional/ignorant &amp;quot;ColdFusion is dead&amp;quot; nonsense that somehow still creeps up from time to time, despite continued growth!:)&lt;/p&gt;
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>ColdFusion</category>				
				
				<category>Railo</category>				
				
				<pubDate>Thu, 02 Jul 2009 23:08:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/7/2/opinion-on-adobe-coldfusion-cfml</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Support Flex/Flash Builder for Linux</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/6/4/support-flex-flash-builder-for-linux</link>
				<description>
				
				It was &lt;a href=&quot;http://gruchalski.com/2009/04/22/flex-builder-3-for-linux-on-hold/&quot; title=&quot;Flex Builder 3 for Linux on hold&quot;&gt;reported that Flex Builder for Linux is on hold&lt;/a&gt;.

Rather than go into a lengthy discourse here on why I feel Flex/Flash Builder should be available to Linux desktop developers, I&apos;ll direct those interested to &lt;a href=&quot;http://bugs.adobe.com/jira/browse/FB-19053&quot;&gt;this Adobe issue/bug report&lt;/a&gt;, which contains plenty of great comments and lots of votes in support.

If you agree, please be sure to &lt;strong&gt;&lt;a href=&quot;http://bugs.adobe.com/jira/browse/FB-19053&quot;&gt;vote for this issue&lt;/a&gt;&lt;/strong&gt;.

I would also like to draw attention to a &lt;a href=&quot;http://arstechnica.com/open-source/news/2009/05/eclipse-survey-results-show-growth-in-linux-open-source.ars&quot;&gt;recent survey by the Eclipse Foundation&lt;/a&gt;.

So...

The number of developers using Eclipse on Linux workstations has grown from 20% in 2007 to 27% in 2009...&lt;br /&gt;
+&lt;br /&gt;
Eclipse is likely the most popular open source IDE (certainly for Java/CFML developers)...&lt;br /&gt;
+&lt;br /&gt;
Adobe has open-sourced the Flex SDK...&lt;br /&gt;
+&lt;br /&gt;
Linux likely has the most vibrant open source software community of developers...&lt;br /&gt;
+&lt;br /&gt;
Adobe has a Flex Builder Eclipse plug-in...&lt;br /&gt;
+&lt;br /&gt;
Adobe provides no means for a developer using Eclipse on Linux to become a Flex developer???&lt;br /&gt;
=&lt;br /&gt;
I will be happy to spend $249 on &lt;a href=&quot;http://www.jetbrains.com/idea/&quot;&gt;IntelliJ IDEA&lt;/a&gt;, which appears to provide &lt;a href=&quot;http://www.jetbrains.com/idea/training/demos/flex.html&quot;&gt;great Flex support out of the box&lt;/a&gt;.
				
				</description>
						
				
				<category>IDE</category>				
				
				<category>Flex</category>				
				
				<category>Linux</category>				
				
				<pubDate>Thu, 04 Jun 2009 15:24:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/6/4/support-flex-flash-builder-for-linux</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Mura CMS bug and mod_rewrite workaround: 200 OK instead of 404 error</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/6/4/mura-cms-bug-200-ok-instead-of-404-error</link>
				<description>
				
				I&apos;ve discovered a bit of a bug in the way &lt;a href=&quot;http://www.getmura.com/&quot;&gt;Mura CMS&lt;/a&gt; handles 404s and wanted to share my workaround. Valid path_info for Mura pages consist of only letters, numbers, hyphens and forward slashes. If you browse to a path that doesn&apos;t exists, Mura properly throws a 404 error -- well, &lt;strong&gt;sometimes&lt;/strong&gt;...

If it&apos;s a valid Mura formatted URL, you&apos;ll get a 404. For example:

&lt;a href=&quot;http://www.getmura.com/index.cfm/i-do-not-exist/&quot; target=&quot;blank&quot;&gt;http://www.getmura.com/index.cfm/i-do-not-exist/&lt;/a&gt;

...however, if the path_info is not &quot;valid,&quot; Mura seems to ignore it and display the home page -- for example:

&lt;a href=&quot;http://www.getmura.com/index.cfm/i-do-not-exist.html&quot; target=&quot;blank&quot;&gt;http://www.getmura.com/index.cfm/i-do-not-exist.html&lt;/a&gt;

On some sites, you might not care about this, but Google and other spiders can become very suspicious when non-existent URLs return a 200 response instead of a 404. I discovered this when our SEO/content guru was having trouble getting Google Webmaster tools to verify after I uploaded the specified uniquely-named html file. Google refused to authenticate us, because they were attempting to &quot;test&quot; for a 404 and instead got 200 responses. I assume they just make up a random file name or path and expect a 404. It makes sense that they want to ensure that the site doesn&apos;t return a 200 OK for &lt;em&gt;everything&lt;/em&gt;, because they can not count on the 200 from the authenticity file/URL to be true.

You can leverage URL rewriting as one workaround, as I have. Based on the standard default site URL format of Mura CMS, you can use something like the following with Apache mod_rewrite to force a Mura 404 when an &quot;invalid&quot; path_info exists:

&lt;code&gt;RewriteEngine On
RewriteRule ^/default/index.cfm/([^a-zA-Z0-9/-]+)$ /default/index.cfm/force-a-404-error/ [PT,L]&lt;/code&gt;
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Mura CMS</category>				
				
				<category>Apache</category>				
				
				<pubDate>Thu, 04 Jun 2009 14:35:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/6/4/mura-cms-bug-200-ok-instead-of-404-error</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>URL Rewrite Goodies for Apache, Tomcat, Railo and Mura CMS</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/5/22/url-rewrite-goodies-for-apache-tomcat-railo-and-mura-cms</link>
				<description>
				
				&lt;em&gt;&lt;strong&gt;UPDATE, 8/31/2010:&lt;/strong&gt; I&apos;m going with a simplified approach these days, as &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2010/8/31/cfml-tomcat-apache-ajp-proxy-redux&quot;&gt;posted here&lt;/a&gt;.&lt;/em&gt;

I&apos;ve worked with &lt;a href=&quot;http://httpd.apache.org/docs/2.2/rewrite/&quot;&gt;Apache mod_rewrite&lt;/a&gt; quite a bit in the past, but never got into any terribly complex rewrite rules. On average, I&apos;ve probably leveraged about 2% of the incredible potential power that mod_rewrite offers. More recently I finally had the opportunity to learn a bit more and leverage this handy tool. My rewrite rules evolved over the past couple months as I got into testing out the &lt;a href=&quot;http://www.getrailo.org/&quot;&gt;Railo CFML engine&lt;/a&gt; a bit more, and then while setting up my first &lt;a href=&quot;http://www.getmura.com/&quot;&gt;Mura CMS&lt;/a&gt; powered site. I thought I&apos;d share what I&apos;ve learned, as others may be likely to use some or all of this type of Apache virtual host configuration.

Here&apos;s a run-down of the &quot;end goal,&quot; if you will, which I will walk through step by step to recap the problems and solutions I discovered along the way:

&lt;ul&gt;
&lt;li&gt;Apache will proxy CFML requests to Tomcat servlet engine, for Railo to handle (while Apache handles all other static content, PHP, etc.)&lt;/li&gt;
&lt;li&gt;Tomcat will properly have Railo handle this common SES style URL (leveraging cgi.path_info): http://host/index.cfm/path-info/&lt;/li&gt;
&lt;li&gt;Protect Railo Admin URLs from public access (well, actually &lt;em&gt;hide&lt;/em&gt; them to mitigate hacking attempts)&lt;/li&gt;
&lt;li&gt;Run a Mura CMS site with super SEO friendly URLs (e.g., http://host/a-cms-page/ instead of the default http://host/siteid/index.cfm/a-cms-page/), while still allowing for standard CFML requests (for custom app integration under same host as CMS)&lt;/li&gt;
&lt;/ul&gt;

Please note that the following Apache modules must be activated in your Apache configuration: mod_rewrite, mod_proxy and mod_proxy_ajp.

&lt;h2&gt;Apache Proxy CFML Request to Tomcat/Railo&lt;/h2&gt;

I&apos;ll simply direct you to existing resources for this first bit and then show my basic example virtual hosting configuration. First, I&apos;m running Railo in a multi-web setup on a single instance of Tomcat, which &lt;a href=&quot;http://corfield.org/entry/Railo_on_Tomcat__multiweb&quot;&gt;Sean Corfield has nicely outlined here&lt;/a&gt; (including a kind nod to &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2009/4/1/railo-jars-on-jboss-or-tomcat-tips-and-tricks&quot;&gt;a prior blog post of mine&lt;/a&gt; :). I learned a very nice means of proxying CFML requests from Apache to Tomcat thanks to &lt;a href=&quot;http://corfield.org/entry/Railo_for_Dummies_Part_IV_Appendix&quot;&gt;this Sean Corfield post&lt;/a&gt;, which was prompted by some helpful comments from &lt;a href=&quot;http://www.barneyb.com/barneyblog/&quot;&gt;Barney Boisvert&lt;/a&gt; on Sean&apos;s &lt;a href=&quot;http://corfield.org/entry/Railo_for_Dummies_Part_IV&quot;&gt;prior post&lt;/a&gt;.

So here is an example Apache virtual host:

&lt;code&gt;&lt;VirtualHost *:80&gt;
	ServerName railocmstest
	DocumentRoot /var/www/railocmstest/webroot
	DirectoryIndex index.cfm

	&lt;Proxy *&gt;
		Allow from 127.0.0.1
	&lt;/Proxy&gt;

	ProxyPreserveHost On
	ProxyPassReverse / ajp://railocmstest:8009/

	RewriteEngine On

	# If it&apos;s a CFML (*.cfc or *.cfm) request, just proxy it to Tomcat:
	RewriteRule  ^(.+\.cf[cm])$  ajp://%{HTTP_HOST}:8009$1  [P]
&lt;/VirtualHost&gt;&lt;/code&gt;

&lt;h2&gt;SES URLs with path_info&lt;/h2&gt;

Okay, the above gets Apache proxying standard *.cfm/*.cfc requests to Tomcat for Railo to handle, but a request to http://railocmstest/index.cfm/some-path-info/ will simply throw a 404 error, because Apache finds neither file nor directory at /var/www/railocmstest/webroot/index.cfm/some-path-info/. Plus, the current rewrite rule is not even proxying this type of request to Tomcat, because the regular expression used only looks for any URI that &lt;em&gt;ends&lt;/em&gt; with &quot;.cfc&quot; or &quot;.cfm&quot;.

Simply change this line:

&lt;code&gt;RewriteRule  ^(.+\.cf[cm])$  ajp://%{HTTP_HOST}:8009$1  [P]&lt;/code&gt;

...to this:

&lt;code&gt;RewriteRule  ^(.+\.cf[cm])(/.*)?$  ajp://%{HTTP_HOST}:8009$1$2  [P]&lt;/code&gt;

Okay, now if we reload Apache the http://railocmstest/index.cfm/some-path-info/ will indeed be proxied to Tomcat, however, now we just get the 404 error from Tomcat instead of Apache! Not a problem -- I picked up another trick from a comment by &lt;a href=&quot;http://www.objectivebias.com/blog/&quot;&gt;Tony Garcia&lt;/a&gt; on, again, &lt;a href=&quot;http://corfield.org/entry/Railo_for_Dummies_Part_IV_Appendix&quot;&gt;this Sean Corfield post&lt;/a&gt;. In either our Tomcat&apos;s conf/server.xml file or in our Web root&apos;s WEB-INF/web.xml (you can create one if it doesn&apos;t exist) file, add the following servlet mapping:

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/index.cfm/*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

Just be sure the servlet name you use here matches the one used for Railo, which is &lt;em&gt;CFMLServlet&lt;/em&gt; by default, but I change mine to &lt;em&gt;GlobalCFMLServlet&lt;/em&gt; in my multi-web setup as explained &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2009/4/1/railo-jars-on-jboss-or-tomcat-tips-and-tricks&gt;here&lt;/a&gt; and &lt;a href=&quot;http://corfield.org/entry/Railo_on_Tomcat__multiweb&quot;&gt;here&lt;/a&gt;.

We can now restart our Tomcat service and http://railocmstest/index.cfm/some-path-info/ is now good to go -- no more 404 error and cgi.path_info will now properly return &lt;em&gt;/some-path-info/&lt;/em&gt;.

You may be inclined to try a URL pattern of /*.cfm/* in your servlet mapping, as I was, but it will not work as expected. If you also need URLs ending with /other.cfm/path-info/ and /app/index.cfm/path-info/, for example, you&apos;ll have to add two more servlet mappings with URL patterns &lt;em&gt;/other.cfm/*&lt;/em&gt; and &lt;em&gt;/app/index.cfm/*&lt;/em&gt;.

&lt;h2&gt;Hide Railo Admin URLs&lt;/h2&gt;

A simple way to hide your Railo Admin URLs is to use one rewrite rule to forbid access to any paths beginning with /railo-context/admin/ and use some unusual URL to proxy in its place:

&lt;code&gt;RewriteRule  ^/railo-context/admin/(.*)  -  [F]

RewriteRule  ^/SOMETHING-DIFFICULT-TO-GUESS/admin/(.*\.cf[cm])$  ajp://%{HTTP_HOST}:8009/railo-context/admin/$1  [P]&lt;/code&gt;

After an Apache reload, the above rewrite rules will cause a 403 (Forbidden) error to be thrown at http://railocmstest/railo-context/admin/index.cfm, but you can find what you&apos;re looking for at http://railocmstest/SOMETHING-DIFFICULT-TO-GUESS/admin/index.cfm with no problem. In &lt;a href=&quot;http://groups.google.com/group/railo/browse_thread/thread/b3e536a924477116/83868f3feb0cf1c1&quot;&gt;this Railo Google Groop thread&lt;/a&gt; Sean Corfield also suggests using a separate virtual host to access your admin, which can listen on an unusual port. You could also use SSL to encrypt transmissions at the admin URLs.

&lt;h2&gt;Super SES CMS URLs&lt;/h2&gt;

&quot;Out of the box,&quot; &lt;a href=&quot;http://www.getmura.com/&quot;&gt;Mura CMS&lt;/a&gt; has relatively friendly, SES URLs of the form http://host/siteid/index.cfm/something-friendly/, but we can do better. In the &lt;a href=&quot;http://www.getmura.com/forum/&quot;&gt;helpful Mura forums&lt;/a&gt; I quickly found the information I needed to make very quick changes to the Mura code to get rid of the &lt;em&gt;/siteid/index.cfm&lt;/em&gt; portion of the URLs generated. Since there were two steps, in two different threads, plus one other tweak I found necessary, I posted a &lt;a href=&quot;http://www.getmura.com/forum/messages.cfm?threadid=4EE1B98E-BA4E-4A2D-8CCACFD78269E26C&quot;&gt;summary thread to a Mura forum&lt;/a&gt;. The rewrite rule example I provide in the form thread is more generic, intended to work without consideration for Tomcat proxying, Railo Admin hiding, etc., so here&apos;s what I&apos;ve actually done for my first Mura CMS powered site...

I found that I needed to cover a few extra use cases. These four situations must be covered:

&lt;ol&gt;
&lt;li&gt;If there&apos;s a trailing slash and it resolves to an existing physical directory, then we&apos;ll assume there should be an index.cfm in there and proxy to Tomcat.&lt;/li&gt;
&lt;li&gt;If it&apos;s an existing file, just let Apache serve it -- this takes care of all static and non-CFML requests.&lt;/li&gt;
&lt;li&gt;If rewrite rules are still processing, then we must be looking for a Mura CMS powered URL, which must have a trailing slash, so we&apos;ll permanently redirect with an appended trailing slash if it&apos;s missing.&lt;/li&gt;
&lt;li&gt;Finally, if rewrite rules are still processing, then we&apos;ll just prepend &quot;index.cfm&quot; in front of the REQUEST_URI.&lt;/li&gt;
&lt;/ol&gt;

...and here it is:

&lt;code&gt;# If trailing slash and real directory, then append index.cfm and proxy it to Tomcat/Railo:
RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  -d
RewriteRule  ^(.+/)$  ajp://%{HTTP_HOST}:8009%{REQUEST_URI}index.cfm  [P]

# If it&apos;s a real file (and we haven&apos;t proxied to Tomcat, so it must be static), just serve it:
RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  -f
RewriteRule  .  -  [L]

# Require trailing slash at this point:
RewriteRule  ^(.+[^/])$  $1/  [R=301,L]

# Everything else must be a CMS URL path, which is rewritten and proxied to Tomcat/Railo:
# MUST COME AFTER ANY OTHER FIXED/EXPECTED REWRITES!
RewriteRule  .  ajp://%{HTTP_HOST}:8009/index.cfm%{REQUEST_URI}  [NE,P]&lt;/code&gt;

If you&apos;re wondering why I have rewrite conditions with &lt;em&gt;%{DOCUMENT_ROOT}%{REQUEST_URI}&lt;/em&gt; instead of &lt;em&gt;%{REQUEST_FILENAME}&lt;/em&gt; when checking for file/directory existence, it&apos;s because the latter just didn&apos;t work for me! All examples I&apos;ve seen suggest the latter, but it just didn&apos;t work -- possibly something Ubuntu-specific, or something that I changed elsewhere in my Apache configuration? I don&apos;t know, but what I&apos;ve used should work on any setup.

&lt;h3 style=&quot;color: red;&quot;&gt;UPDATE (2009-06-04)&lt;/h3&gt;

I&apos;ve discovered &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2009/6/4/mura-cms-bug-200-ok-instead-of-404-error&quot;&gt;a little bug in Mura CMS&lt;/a&gt; regarding the handling of would-be 404 pages, so the last two rewrite rules from above must be changed to be less broad and an additional final rule can be added to still leverage the friendly/skinned Mura 404 page (rather than Apache&apos;s default 404):

&lt;code&gt;# Require trailing slash at this point, if otherwise valid CMS URL:
RewriteRule  ^([a-zA-Z0-9/-]+[^/])$  $1/  [R=301,L]

# Valid CMS URL path is proxied to Tomcat/Railo:
# MUST COME AFTER ANY OTHER FIXED/EXPECTED REWRITES!
RewriteRule  ^([a-zA-Z0-9/-]+)$  ajp://%{HTTP_HOST}:8009/index.cfm%{REQUEST_URI}  [NE,P]

# Anything else must be a 404 error:
RewriteRule  .  ajp://%{HTTP_HOST}:8009/index.cfm/this-will-force-a-404/  [NE,P]&lt;/code&gt;

I&apos;ve also updated the following &lt;em&gt;Complete Package&lt;/em&gt; section to reflect these updates...

&lt;h2&gt;The Complete Package&lt;/h2&gt;

So, here is the complete virtual host example, incorporating all of the above:

&lt;code&gt;&lt;VirtualHost *:80&gt;
	ServerName railocmstest
	DocumentRoot /var/www/railocmstest/webroot
	DirectoryIndex index.cfm

	&lt;Proxy *&gt;
		Allow from 127.0.0.1
	&lt;/Proxy&gt;

	ProxyPreserveHost On
	ProxyPassReverse / ajp://railocmstest:8009/

	RewriteEngine On

	# Forbid access to Railo Admin URLs:
	RewriteRule  ^/railo-context/admin/(.*)  -  [F]

	# Proxy &quot;secret&quot; Railo Admin URLs to &quot;real&quot; Railo Admin URLs on Tomcat:
	RewriteRule  ^/SOMETHING-DIFFICULT-TO-GUESS/admin/(.*\.cf[cm])$  ajp://%{HTTP_HOST}:8009/railo-context/admin/$1  [P]

	# If it&apos;s a CFML (*.cfc or *.cfm) request, just proxy it to Tomcat:
	RewriteRule  ^(.+\.cf[cm])(/.*)?$  ajp://%{HTTP_HOST}:8009$1$2  [P]

	# If trailing slash and real directory, then append index.cfm and proxy it to Tomcat/Railo:
	RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  -d
	RewriteRule  ^(.+/)$  ajp://%{HTTP_HOST}:8009%{REQUEST_URI}index.cfm  [P]

	# If it&apos;s a real file (and we haven&apos;t proxied to Tomcat, so it must be static), just serve it:
	RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  -f
	RewriteRule  .  -  [L]

	# NOTE: Everything else must be a CMS URL path (letters/numbers/hyphens/slashes only), or a 404...

	# Require trailing slash at this point, if otherwise valid CMS URL:
	RewriteRule  ^([a-zA-Z0-9/-]+[^/])$  $1/  [R=301,L]

	# Valid CMS URL path is proxied to Tomcat/Railo:
	# MUST COME AFTER ANY OTHER FIXED/EXPECTED REWRITES!
	RewriteRule  ^([a-zA-Z0-9/-]+)$  ajp://%{HTTP_HOST}:8009/index.cfm%{REQUEST_URI}  [NE,P]

	# Anything else must be a 404 error:
	RewriteRule  .  ajp://%{HTTP_HOST}:8009/index.cfm/this-will-force-a-404/  [NE,P]
&lt;/VirtualHost&gt;&lt;/code&gt;

Cheers!
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Tomcat</category>				
				
				<category>Mura CMS</category>				
				
				<category>Railo</category>				
				
				<category>Apache</category>				
				
				<pubDate>Fri, 22 May 2009 23:33:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/5/22/url-rewrite-goodies-for-apache-tomcat-railo-and-mura-cms</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFFormProtect Rocks!</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/5/12/cfformprotect-rocks</link>
				<description>
				
				&lt;a href=&quot;http://www.briankotek.com/blog/index.cfm/2009/3/20/Finally-Using-CFFormProtect-And-Getting-Zero-Spam&quot;&gt;Others&lt;/a&gt; have praised &lt;a href=&quot;http://cfformprotect.riaforge.org/&quot;&gt;CFFormProtect&lt;/a&gt;, but I wanted to share a couple quick stats and give another shout out to Jake Munson for the very useful CFFormProtect. If you&apos;re not familiar with CFFormProtect, here is a snippet from the description at RIAForge:

&lt;blockquote&gt;CFFormProtect is a fully accessible, invisible to users form protection system to stop spam bots, and even human spammers. CFFormProtect works like some email spam protection systems, in that it uses a series of tests to find out if a form submission is from a spammer or not. Each test is given an amount of points, and each test that is failed accumulates points. Once a form submission passes the threshold of &apos;spamminess&apos;, the message is flagged as spam and is not posted. The points assigned to each test and the failure limit are easily configurable by you.&lt;/blockquote&gt;

It is quite simple to implement, and the code is rather simple and lightweight, but brilliantly useful and powerful! The latest version of &lt;a href=&quot;http://blogcfc.riaforge.org/&quot;&gt;BlogCFC&lt;/a&gt; ships with CFFormProtect and you can optionally enable it to block comment spam. I rarely see any comment spam get through on my blog, but this morning I had a flurry of 10 or more, from the same spammer. I was quickly able to tweak my INI file for CFFormProtect so this particular spam would be blocked from now on. I also decided to peak at the log file for CFFormProtect (you can optionally have CFFormProtect log blocked spam occurrences) and noticed that my blog gets a *LOT* of comment spam, but I never have to deal with it, thanks to CFFormProtect!

This morning was the first comment spam I&apos;ve had get through in months, but it turns out that CFFormProtect has quietly blocked more than 80 spam attempts for me in just the last 24 hours! If you&apos;re a CFML developer and you&apos;d like to protect any form from spam without bothering with CAPTCHA, I highly encourage you to check out &lt;a href=&quot;http://cfformprotect.riaforge.org/&quot;&gt;CFFormProtect&lt;/a&gt;.
				
				</description>
						
				
				<category>CFML</category>				
				
				<pubDate>Tue, 12 May 2009 11:38:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/5/12/cfformprotect-rocks</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Railo JARs on JBoss (or Tomcat) - Tips and Tricks</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/4/1/railo-jars-on-jboss-or-tomcat-tips-and-tricks</link>
				<description>
				
				As a follow up to a &lt;a href=&quot;http://jamiekrug.com/blog/index.cfm/2009/3/3/Railo-30-on-JBoss-AS-42-via-Apache-22-with-Root-Context-and-No-Proxy&quot; title=&quot;Railo 3.0 on JBoss AS 4.2 via Apache 2.2 with Root Context and No Proxy&quot;&gt;previous related post&lt;/a&gt;, I wanted to share a couple potentially helpful tricks that I&apos;ve since learned. Everything I document here has been tested with both Railo 3.0.2.004 (current stable) and Railo 3.1.0.012 (current beta), both of which can be &lt;a href=&quot;http://www.getrailo.org/index.cfm/download/&quot; title=&quot;Railo download page&quot;&gt;downloaded from here&lt;/a&gt;, on &lt;a href=&quot;http://www.jboss.org/jbossas/downloads/&quot; title=&quot;JBoss Application Server Downloads&quot;&gt;JBoss Application Server (AS) 4.2.3.GA&lt;/a&gt;.

The purpose (as I see it) of a Railo JARs installation is to provide an alternative to using a full-blown Railo WAR for each of your Railo CFML applications. This allows you to define your Railo CFML servlet &quot;globally&quot; in JBoss/Tomcat and then use virtual hosts for multiple CFML apps. Each CFML app is then leveraging the same Railo instance, one copy of the jars and one Railo server admin (but still multiple Web contexts with unique Railo Web Admin for each Web site/context).

Also keep in mind that JBoss AS leverages Tomcat as its Web server, so just about everything here should directly translate. Here are the locations of key configuration files and directories in both JBoss 4.2 and Apache Tomcat 6:

&lt;span style=&quot;color: gray; text-decoration: line-through;&quot;&gt;{JBOSS_HOME}/lib/&lt;/span&gt; {JBOSS_HOME}/server/default/lib/&lt;br /&gt;
or&lt;br /&gt;
{TOMCAT_HOME}/lib/

{JBOSS_HOME}/server/default/deploy/jboss-web.deployer/conf/web.xml&lt;br /&gt;
or&lt;br /&gt;
{TOMCAT_HOME}/conf/web.xml

{JBOSS_HOME}/server/default/deploy/jboss-web.deployer/server.xml&lt;br /&gt;
or&lt;br /&gt;
{TOMCAT_HOME}/conf/server.xml

&lt;h2&gt;Quick Review of Railo JARs Install on JBoss/Tomcat&lt;/h2&gt;

I will first give a very brief outline of the steps required to install Railo (jars) on JBoss/Tomcat here. There are, however, some potential problems with this configuration, which I&apos;ll outline below, with a solution/workaround for each.
				 [More]
				</description>
						
				
				<category>JBoss</category>				
				
				<category>CFML</category>				
				
				<category>Tomcat</category>				
				
				<category>Railo</category>				
				
				<pubDate>Wed, 01 Apr 2009 17:00:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/4/1/railo-jars-on-jboss-or-tomcat-tips-and-tricks</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Sitemaps.org Data Driven Sitemap XML Generator (sitemap.xml for Google, Yahoo!, MSN and others)</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/3/20/sitemaps-org-google-yahoo-msn-others-data-driven-sitemap-xml-generator</link>
				<description>
				
				&lt;strong&gt;Update:&lt;/strong&gt; Get SitemapCFC &lt;a href=&quot;http://code.google.com/p/sitemapcfc/&quot; title=&quot;SitemapCFC project home at Google Code&quot;&gt;at Google Code&lt;/a&gt; or &lt;a href=&quot;http://sitemapcfc.riaforge.org/&quot; title=&quot;SitemapCFC project home at RIAForge&quot;&gt;at RIAForge&lt;/a&gt;.

If you&apos;re not familiar with &lt;em&gt;Sitemaps&lt;/em&gt;, visit the &lt;a href=&quot;http://sitemaps.org/&quot; title=&quot;Sitemaps.org home - What are Sitemaps?&quot;&gt;sitemaps.org home page&lt;/a&gt;, which provides an overview of the &lt;a href=&quot;http://sitemaps.org/protocol.php&quot; title=&quot;Sitemaps.org Protocol - Sitemaps XML Format&quot;&gt;Sitemaps protocol&lt;/a&gt; (adopted by Google, Yahoo! and Microsoft, among others).

I wanted to generate a sitemap.xml file to submit to Google, Yahoo!, etc. based on data from a simple CMS application&apos;s database. I ran some quick searches and was surprised to not quickly find a CFC that did exactly what I was looking for. There are a few sitemap generators out there that crawl site links to produce a sitemap XML file, but I didn&apos;t find any that generated an XML file based on data. I know there are a number of applications that have built-in site generator support (like &lt;a href=&quot;http://blogcfc.riaforge.org/&quot;&gt;BlogCFC&lt;/a&gt; and probably most modern blog and CMS apps), but I didn&apos;t find anything generic and flexible enough for my needs. &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2006/11/16/Sitemap-Generator&quot;&gt;Ray Camden did share a UDF&lt;/a&gt; that handles the basics very nicely, but I wanted to be able to pass in different URL collection types with flexible key/column names. I&apos;d already cooked up two different (albeit simple) application-specific sitemap generators for apps that I maintain, so it was time to genericize and reuse!

I&apos;ll outline the Sitemap.cfc I created, its features and some examples. &lt;span style=&quot;text-decoration: line-through;&quot;&gt;I will update this post with a link to &lt;a href=&quot;http://sitemapcfc.riaforge.org/&quot; title=&quot;RIAForge - Open Source projects built on Adobe technology&quot;&gt;RIAForge&lt;/a&gt; once I have the project approved for upload there.&lt;/span&gt; If you&apos;re &lt;em&gt;not&lt;/em&gt; looking for a data-driven sitemap generator, but rather a &lt;em&gt;crawler&lt;/em&gt; or &lt;em&gt;spider&lt;/em&gt; style sitemap generator, then check out &lt;a href=&quot;http://googlesitemapxmlgenerator.riaforge.org/&quot;&gt;this &amp;quot;Google Sitemap XML Generator&amp;quot;&lt;/a&gt;. For a &lt;em&gt;data driven&lt;/em&gt; sitemap generator (or, if you want to use your own crawler and just need to model and generate a valid sitemap.xml file), read on...

I quickly put together a relatively simple Sitemap.cfc to suit my needs, but then I found myself adding more and more little enhancements. Since the sitemaps.org protocol is relatively simple, it wasn&apos;t too difficult to create a CFC to model the protocol. I tried to keep it simple, but flexible enough to take a collection of URLs (and relevant meta data) in just about any form and spit out a valid sitemap.xml file.

&lt;h2&gt;SitemapCFC Feature Overview&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use a list, query or array (of structs) to initialize a sitemap object.&lt;/li&gt;
&lt;li&gt;Query column or struct key names used to initialize a Sitemap.cfc object are not important; an optional init() argument can be used to map to standard sitemaps.org protocol tag names.&lt;/li&gt;
&lt;li&gt;Write your sitemap.xml file to disk or dynamically send a sitemap XML document to the browser as binary page output (cfcontent type text/xml).&lt;/li&gt;
&lt;li&gt;Debugging methods available to access a Sitemap.cfc object&apos;s URL collection in the form of an array, an XML object or the raw XML string.&lt;/li&gt;
&lt;li&gt;XML document is schema validation ready.&lt;/li&gt;
&lt;li&gt;All initialization data values are cleaned (entity escaping, date/time format, valid string values, etc.) and validated.&lt;/li&gt;
&lt;li&gt;Date(/time) values for the &amp;lt;lastmod&amp;gt; tags can be passed in as any valid date/time string or object; they will be automatically converted to UTC in proper W3C Datetime format (again, per sitemaps.org protocol).&lt;/li&gt;
&lt;/ul&gt;

Read on for an [] of examples...
				 [More]
				</description>
						
				
				<category>CFML</category>				
				
				<category>SitemapCFC</category>				
				
				<pubDate>Fri, 20 Mar 2009 09:24:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/3/20/sitemaps-org-google-yahoo-msn-others-data-driven-sitemap-xml-generator</guid>
				
			</item>
			
		 	
			</channel></rss>