<?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 - CFML</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 19:41:22 -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>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>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>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>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>
			
		 	
			
			
			<item>
				<title>Railo 3.0 on JBoss AS 4.2 via Apache 2.2 with Root Context and No Proxy</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/3/3/Railo-30-on-JBoss-AS-42-via-Apache-22-with-Root-Context-and-No-Proxy</link>
				<description>
				
				So I wanted to take a good look at the &lt;a href=&quot;http://railo.ch/en/index.cfm&quot;&gt;Railo&lt;/a&gt; 3.0 CFML engine and see what all the buzz was about. I wanted to be sure I could replicate the same basic Apache virtual host configurations I&apos;ve been using with my ColdFusion 8 multi-server configuration. I also decided to try to get this all working with the JBoss Application Server. This entry summarizes the battle that was &lt;em&gt;eventually&lt;/em&gt; won...

&lt;h2&gt;Choosing An Application Server&lt;/h2&gt;

After a great deal of reading comparisons and opinions regarding &lt;a href=&quot;http://www.caucho.com/&quot; title=&quot;Caucho Resin&quot;&gt;Resin&lt;/a&gt;, &lt;a href=&quot;http://tomcat.apache.org/&quot; title=&quot;Apache Tomcat&quot;&gt;Tomcat&lt;/a&gt; and &lt;a href=&quot;http://www.jboss.org/jbossas&quot; title=&quot;JBoss Application Server&quot;&gt;JBoss Application Server&lt;/a&gt; (also with/without Apache), I decided I wanted to shoot for running the Railo CFML engine on the &lt;a href=&quot;http://www.jboss.org/jbossas&quot; title=&quot;JBoss Application Server&quot;&gt;JBoss Application Server&lt;/a&gt;. There was plenty of good press and lots of die hard proponents for each of these application server options, so I don&apos;t feel there&apos;s a wrong decision and recommend you decide for yourself. For me, I just liked the robustness of JBoss and the full-featured community edition (Resin, for example, only provides a lot of its full-featured options in the paid licenses).

&lt;h2&gt;Basic Railo Installation/Deployment (EAR/WAR)&lt;/h2&gt;

I&apos;ll leave out a lot of the lower level details of my installations, because there are plenty of &lt;a href=&quot;http://www.railo.ch/blog/index.cfm/2009/2/16/Railo-Installation-guides&quot; title=&quot;Railo Installation Guides&quot;&gt;Railo installation guides&lt;/a&gt; out there already (and probably growing). I must, however, mention that a lot of &lt;a href=&quot;http://www.garyrgilbert.com/blog/index.cfm/Railo&quot; title=&quot;Gary Gilbert technology blog Railo category&quot;&gt;Gary Gilbert&apos;s Railo posts&lt;/a&gt; were particularly useful in my learning experience.

Using the aforementioned guides I was able to get JBoss AS installed and then deployed Railo 3.0 as a WAR and then also tried the EAR deployment alternative. I was not able to deploy Railo 3.0.2.001 on JBoss AS 5.0.1.GA, but all deployments worked fine for me on JBoss AS 4.2.3.GA. I&apos;ve noticed other folks comment on being able to deploy Railo on JBoss 5 on Ubuntu 8.04, which is my development OS, but I was not successful. The errors I received appeared to be known JBoss 5 bugs, but who knows!

&lt;h3&gt;Adding Apache HTTPD to the Stack&lt;/h3&gt;

After getting Railo 3.0 running on JBoss 4.2, I then wanted to integrate Apache 2.2, which was relatively straightforward using the mod_jk module for Apache HTTPD (again, this stuff is already well documented). At this point, however, I could either have only one Railo Web root and/or needed to use specific context paths for each Web site/context (e.g., http://localost/app1-context, http://localhost/app2-context, etc.).

&lt;h2&gt;Railo on JBoss via Apache, &lt;em&gt;as I really wanted it to be&lt;/em&gt;&lt;/h2&gt;

I then wanted to be able to run multiple Apache virtual hosts as multiple Railo web contexts on the same instance of Railo, but without needing a unique context path for each and without needing to proxy from Apache. After hours of experimentation and searching for help, I just could not find a way to make this happen.

Just as I was about to give up, I was reassured that this could be done when I read a couple installation guides that used Tomcat virtual hosts and a Railo installation using the JARs download only (not an EAR or WAR deployment): &lt;a href=&quot;http://www.jamesconstable.co.uk/web-development/installing-railo-3-on-tomcat-6-via-apache-2-on-ubuntu-804/&quot; title=&quot;James Constable: Installing Railo 3 on Tomcat 6 via Apache 2 on Ubuntu 8.04&quot;&gt;this one by James Constable&lt;/a&gt; and &lt;a href=&quot;http://www.garyrgilbert.com/blog/index.cfm/2009/2/20/Installing-Railo-3-on-SUSE-10-with-Apache2-and-Tomcat-Part-2&quot; title=&quot;Gary Gilbert: Installing Railo 3 on SUSE 10 with Apache 2 and Tomcat&quot;&gt;this one by Gary Gilbert&lt;/a&gt;.

These guys were doing exactly what I wanted to do, simply with Tomcat instead of JBoss, and since I knew JBoss AS uses Tomcat as its Web server, I knew there must be a way! I simply needed to identify the JBoss deployment directory in which to locate the Railo jars, and which web.xml and server.xml files to modify within the JBoss deployment directory structure. Here they are:

&lt;span style=&quot;color: gray; text-decoration: line-through;&quot;&gt;&lt;strong&gt;{JBOSS_HOME}/lib&lt;/strong&gt; -- Drop the Railo jar files in here.&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;{JBOSS_HOME}/server/default/lib&lt;/strong&gt; -- Drop the Railo jar files in here.

&lt;strong&gt;{JBOSS_HOME}/server/default/deploy/jboss-web.deployer/conf/web.xml&lt;/strong&gt; -- Define the Railo servlet, servlet mappings and welcome files in this file.

&lt;strong&gt;{JBOSS_HOME}/server/default/deploy/jboss-web.deployer/server.xml&lt;/strong&gt; -- Define Host entries for each application/virtual host in this file (to match up with Apache virtual hosts).

&lt;h2&gt;Next Steps&lt;/h2&gt;

I would like to learn a bit more about JBoss AS administration and be sure my environment is configured for high performance and sensible security. I&apos;ll also want to run JBoss as a daemon that starts automatically at boot. I&apos;m running Ubuntu 8.04 as my main development environment and I found what promises to be a &lt;a href=&quot;http://chiralsoftware.com/linux-system-administration/jboss-server-deployment.seam&quot; title=&quot;Installing JBoss Application Server on Ubuntu Linux&quot;&gt;fantastic article on a proper JBoss AS installation on Ubuntu&lt;/a&gt;!

I&apos;m also looking for some sort of confirmation that my basic method of configuring this Railo/JBoss/Apache stack makes sense, or whether there&apos;s a preferred alternative (using WAR, EAR, proxy, etc.). I hope to get a lot of answers in the near future since Railo just recently joined forces with JBoss (read the &lt;a href=&quot;http://railo.ch/en/index.cfm?treeID=357&quot; title=&quot;Railo joins JBoss&quot;&gt;Railo announcement here&lt;/a&gt; or the &lt;a href=&quot;http://www.jboss.org/railo/&quot; title=&quot;Railo comes to JBoss.org&quot;&gt;JBoss.org announcement here&lt;/a&gt;).
				
				</description>
						
				
				<category>JBoss</category>				
				
				<category>CFML</category>				
				
				<category>Ubuntu</category>				
				
				<category>Tomcat</category>				
				
				<category>Railo</category>				
				
				<pubDate>Tue, 03 Mar 2009 13:11:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/3/3/Railo-30-on-JBoss-AS-42-via-Apache-22-with-Root-Context-and-No-Proxy</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>cfmailpart order for HTML display in Gmail</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/2/13/cfmailpart-order-for-HTML-display-in-Gmail</link>
				<description>
				
				It seems that Gmail only renders the HTML part of my multi-part messages from cfmail when the text cfmailpart is before the html cfmailpart.

For example, Gmail will render the text version if I do this:

&lt;code&gt;&lt;cfmail from=&quot;#from#&quot; to=&quot;#to#&quot; subject=&quot;Multi-part, html first&quot;&gt;
    &lt;cfmailpart type=&quot;html&quot;&gt;&lt;h1&gt;HTML Message Part&lt;/h1&gt;&lt;/cfmailpart&gt;
    &lt;cfmailpart type=&quot;text&quot;&gt;Text Message Part&lt;/cfmailpart&gt;
&lt;/cfmail&gt;&lt;/code&gt;

But if I just swap the order of the cfmailpart entries, then Gmail renders the HTML version:

&lt;code&gt;&lt;cfmail from=&quot;#from#&quot; to=&quot;#to#&quot; subject=&quot;Multi-part, text first&quot;&gt;
    &lt;cfmailpart type=&quot;text&quot;&gt;Text Message Part&lt;/cfmailpart&gt;
    &lt;cfmailpart type=&quot;html&quot;&gt;&lt;h1&gt;HTML Message Part&lt;/h1&gt;&lt;/cfmailpart&gt;
&lt;/cfmail&gt;&lt;/code&gt;

I had a friend test on Outlook and that client appears to show the HTML part, regardless of the ordering of the text/html parts in the message body. Though I haven&apos;t tested any other mail clients yet, I&apos;ll keep the text part first and html part second in my multi-part e-mails. I know they&apos;ll display as intended in both Gmail and Microsoft Outlook (and I&apos;m guessing most other clients behave like Outlook, in that they&apos;ll default to an HTML part if one is there).
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Gmail</category>				
				
				<pubDate>Fri, 13 Feb 2009 08:59:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/2/13/cfmailpart-order-for-HTML-display-in-Gmail</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>cfmail using Gmail SMTP</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/2/13/cfmail-using-Gmail-SMTP</link>
				<description>
				
				I wanted to have a cfmail tag use my Gmail SMTP to send mail, which was relatively straightforward, but there is some vague language in the Google help doc that didn&apos;t immediately translate to cfmail attribute settings. I did find plenty of search results on the topic, but most threads were a little confusing and noted differing experiences between developers. So I&apos;ve taken a little time to experiment and thought I&apos;d share the results.

From both my gmail.com account and my Google Apps for Your Domain mail (gmail for custom domain name) accounts I was able to find the same &lt;a href=&quot;http://mail.google.com/support/bin/answer.py?answer=13287&quot;&gt;help doc&lt;/a&gt; for standard POP/SMTP configuration.

We can quickly deduce that the username attribute should be your full e-mail address (including @gmail.com or @your_domain.com), and the password is of course your Gmail password.

The help doc provides the following information for the outgoing/SMTP server configuration:

&lt;blockquote&gt;smtp.gmail.com (use authentication)&lt;br /&gt;
Use Authentication: Yes&lt;br /&gt;
Use STARTTLS: Yes (some clients call this SSL)&lt;br /&gt;
Port: 465 or 587&lt;/blockquote&gt;

So, how does the above information translate to relevant cfmail tag attributes (server, port, username, password, useSSL, useTLS)? It&apos;s a bit more specific than the Gmail help doc suggests...
				 [More]
				</description>
						
				
				<category>CFML</category>				
				
				<category>Open BlueDragon</category>				
				
				<category>Gmail</category>				
				
				<category>ColdFusion</category>				
				
				<category>Railo</category>				
				
				<pubDate>Fri, 13 Feb 2009 07:35:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/2/13/cfmail-using-Gmail-SMTP</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion round() function bug when operation performed on argument</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/2/12/ColdFusion-round-function-bug-when-operation-performed-on-argument</link>
				<description>
				
				&lt;em&gt;&lt;strong&gt;UPDATE (July 15, 2009):&lt;/strong&gt; This &quot;bug&quot; still exists in &lt;a href=&quot;http://labs.adobe.com/technologies/coldfusion9/&quot; title=&quot;Adobe ColdFusion&quot;&gt;Adobe ColdFusion 9 beta 1&lt;/a&gt;. It also seems to behave the same in &lt;a href=&quot;http://openbluedragon.org/&quot; title=&quot;Open BlueDragon CFML Engine&quot;&gt;OpenBD 1.1&lt;/a&gt;. This bug does not seem to exist in &lt;a href=&quot;http://www.getrailo.org/&quot; title=&quot;Railo CFML Engine&quot;&gt;Railo&lt;/a&gt; (I can&apos;t reproduce any similar problems in Railo 3.0 or Railo 3.1). For example, round(4.0005*1000) outputs 4000 from both AdobeCF and OpenBD while Railo outputs the expected 4001. There may very well be other scenarios where a floating point representation causes similar unexpected results in Railo as well, but I have not been able to find it yet (nor have I performed an absolutely thorough test, maybe soon if time permits).&lt;/em&gt;

Have you ever used a CFML trick like this to round a number to the nearest hundredth?

&lt;code&gt;&lt;cfoutput&gt;#round(someNumber*100)/100#&lt;/cfoutput&gt;&lt;/code&gt;

I have, and I never had a problem, until...

&lt;code&gt;&lt;cfscript&gt;
	valueA = 4000.5;
	valueB = 4.0005*1000;
	roundedA = round(valueA);
	roundedB = round(valueB);
&lt;/cfscript&gt;&lt;/code&gt;

You&apos;d be perfectly sane to expect the first two variables to output as 4000.5 and the second two (rounded) to output 4001. Unfortunately, &lt;em&gt;roundedB&lt;/em&gt; is output as &lt;em&gt;4000&lt;/em&gt;, &lt;strong&gt;not&lt;/strong&gt; &lt;em&gt;4001&lt;/em&gt;!

This definitely appears to be a bug, but I do have a rather simple workaround...
				 [More]
				</description>
						
				
				<category>CFML</category>				
				
				<category>Open BlueDragon</category>				
				
				<category>ColdFusion</category>				
				
				<category>Railo</category>				
				
				<pubDate>Thu, 12 Feb 2009 21:44:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/2/12/ColdFusion-round-function-bug-when-operation-performed-on-argument</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Hello, [blog] world!</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/2/12/Hello-blog-world</link>
				<description>
				
				Yes, it was probably at least two years ago when I first thought, &quot;I should start blogging,&quot; and here, finally, is my first ever post. Since this will be a blog about ColdFusion development and other programming related topics, I couldn&apos;t resist a &quot;hello world&quot; style title for my first post. That said, I&apos;d like to share a little about why I decided to start blogging, what I hope to share and what I hope to gain from blogging.

First, my relevant geek background, in a nutshell:

&lt;ul&gt;&lt;li&gt;First program written in BASIC on a TRS-80 to calculate my baseball batting average at approximately 10 years old.&lt;/li&gt;
&lt;li&gt;Geeked out in MS-DOS, C programming and a touch of Perl (1989-1994).&lt;/li&gt;
&lt;li&gt;Finally made the switch from DOS to Windows 95 in 1996.&lt;/li&gt;
&lt;li&gt;Entered the University of Rochester as a computer science major -- a little too disinterested in many of the non-programming topics -- graduated with a music degree and a minor in mathematics, but also got a good little dose of data structures, Java and C++.&lt;/li&gt;
&lt;li&gt;HTML, MS Access and other general computer-related gigs for a couple years (1998-1999).&lt;/li&gt;
&lt;li&gt;Web development using ASP scripting with MS Access and SQL Server databases (1999-2002).&lt;/li&gt;
&lt;li&gt;Fell in love with ColdFusion around 2001 (using ColdFusion 4.52 at first) and used it to build and maintain dozens of sites (2001-2003).&lt;/li&gt;
&lt;li&gt;Really started digging in to object oriented CFML development and helped build, grow and maintain a group of large-scale applications primarily running Mach-II and ColdSpring (with a touch of Transfer, Reactor and Model-Glue) (2004-2008).&lt;/li&gt;
&lt;li&gt;Read on for present-day geekiness...&lt;/li&gt;&lt;/ul&gt;

In October of 2008 I decided to go solo and freelance develop again to have a better opportunity to code and learn and code and learn (as opposed to management and meetings and management and meetings). I&apos;ve spent the last few months doing nothing but coding and learning, and I&apos;m loving it! My main project right now is &lt;a href=&quot;http://www.mortgages.com/&quot;&gt;www.mortgages.com&lt;/a&gt;, which I&apos;ve built up from a blank slate, using &lt;a href=&quot;http://www.adobe.com/products/coldfusion/&quot;&gt;ColdFusion&lt;/a&gt; 8 Enterprise on Linux, &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; 8.3, &lt;a href=&quot;http://model-glue.com/&quot;&gt;Model-Glue&lt;/a&gt; 3 (Gesture, bleeding edge release), &lt;a href=&quot;http://coldspringframework.org/&quot;&gt;ColdSpring&lt;/a&gt;, &lt;a href=&quot;http://transfer-orm.com/&quot;&gt;Transfer ORM&lt;/a&gt;, &lt;a href=&quot;http://www.mxunit.org/&quot;&gt;MXUnit&lt;/a&gt;, &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; and and I even wrote a little code myself :) I also decided to ditch Microsoft entirely and I&apos;m running Ubuntu 8.04 on my development laptop, along with a Windows XP VM via &lt;a href=&quot;http://www.virtualbox.org/&quot;&gt;VirtualBox&lt;/a&gt; virtualization to allow for IE testing (will be looking to setup a Mac testing ground as well). This project has helped me ask and answer a lot of questions around good object oriented design, best practices, using the right tools, etc. Though I feel I&apos;ve had a great sprint of learning over the past few months, I&apos;m hungry to absorb so much more!

That brings me back to my main point, this blog. From many other bloggers I&apos;ve learned a lot through finding countless answers, great tips, great examples and tutorials, etc. I&apos;ve also solved a number of problems either on my own or with the help of tid-bits from various online resources. So, I&apos;d like to have a platform to share when I think I have something worth sharing, and that will be this blog. I will also likely blog about some of my own learning experiences, when I think it might help others embarking on a similar learning path. If I&apos;m lucky, some folks might actually read my blog and share some feedback, which will help me and other readers learn more and better ourselves as programmers.

Well, thanks for reading. Cheers to blogging!
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>Ubuntu</category>				
				
				<category>Personal</category>				
				
				<category>Programming</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 12 Feb 2009 14:53:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/2/12/Hello-blog-world</guid>
				
			</item>
			
		 	
			</channel></rss>