<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sid's FishNet</title>
	<atom:link href="http://sidfishes.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sidfishes.wordpress.com</link>
	<description>Where Coldfusion Is Usually The Catch Of The Day</description>
	<lastBuildDate>Wed, 18 Jan 2012 16:34:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sidfishes.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sid's FishNet</title>
		<link>http://sidfishes.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sidfishes.wordpress.com/osd.xml" title="Sid&#039;s FishNet" />
	<atom:link rel='hub' href='http://sidfishes.wordpress.com/?pushpress=hub'/>
		<item>
		<title>The Mysterious Spy.log &#8211; Coldfusion &amp; JDBCSpy</title>
		<link>http://sidfishes.wordpress.com/2012/01/18/the-mysterious-spy-log-coldfusion-jdbcspy/</link>
		<comments>http://sidfishes.wordpress.com/2012/01/18/the-mysterious-spy-log-coldfusion-jdbcspy/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 16:07:09 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=250</guid>
		<description><![CDATA[A couple of week ago, I found a file on my internal web server called spy.log, which gave me a bit of a scare (but then I realized nobody spying on me is likely to call a file spy.log) This file was almost 20G in size. What&#8217;s up with that? After finding a viewer to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=250&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple of week ago, I found a file on my internal web server called spy.log, which gave me a bit of a scare (but then I realized nobody spying on me is likely to call a file spy.log) This file was almost 20G in size. What&#8217;s up with that? After finding a <a href="http://www.swiftgear.com/ltfviewer/features.html" target="_blank">viewer</a> to open a 20G text file, I determined that this was a legitimate file belonging to JDBCSpy, which is an extension of the Coldfusion JDBC driver which can optionally be enabled. To enable it, you just have to add a reference to the Coldfusion Datasource Connection String in the Advanced section.</p>
<pre>SpyAttributes=(log=(file)C:\\temp\\spy.log;logTName=yes;timestamp=yes)</pre>
<p>Thing is I don&#8217;t remember enabling it.  I found some more information on <a href="http://www.carehart.org/blog/client/index.cfm/2009/11/14/spy_on_orm" target="_blank">Charlie Areharts&#8217; blog</a> which reminded me that at one point I had installed a demo version of Fusion Reactor to diagnose some performance issues. I&#8217;m not sure if the version of FR I installed modified the connection string and did not remove it when I uninstalled the program, or if I added it (note to self: make better changelog notes please).</p>
<p>In any case, the fix was simple, delete the connection string attribute and restart the CF services.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/250/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=250&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2012/01/18/the-mysterious-spy-log-coldfusion-jdbcspy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>A Simple Way to Clean Up Your InBox</title>
		<link>http://sidfishes.wordpress.com/2012/01/04/a-simple-way-to-clean-up-your-inbox/</link>
		<comments>http://sidfishes.wordpress.com/2012/01/04/a-simple-way-to-clean-up-your-inbox/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 17:09:51 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=242</guid>
		<description><![CDATA[I don&#8217;t know about you, but I manage 3 different email accounts at work. These accounts have been around for a very long time (+10 years) and over this time they&#8217;ve have showed up on many, many email marketing lists. One account was getting 30-50 emails per day from marketers, auto-added newsletters and other sundry [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=242&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about you, but I manage 3 different email accounts at work. These accounts have been around for a very long time (+10 years) and over this time they&#8217;ve have showed up on many, many email marketing lists. One account was getting 30-50 emails per day from marketers, auto-added newsletters and other sundry sources. Every day I would dutifully open up my email client, then play the delete game. Then one morning last month I had a revelation. I don&#8217;t read any of this stuff. Most of these emails are coming from legitimate sources. Many use SafeUnsubscribe or similar services.</p>
<p>UNSUBSCRIBE!</p>
<p>Wow. What a concept. Why did it take me so long to figure this out? A couple of reasons I guess. Habit &amp; Creep. Back in the bad old days clicking on an unsubscribe link often was simply a way for spammers to verify an address so I got in the habit of simply trashing everything. (And I don&#8217;t make a habit of clicking on links in emails &#8211; we all know that&#8217;s a really bad idea right???) Since most of the emails I was getting were from obviously legitimate sources using services like Constant Contact (who provide the SafeUnsub system), I could be assured that I could with a careful click (hovering over the link, verifying that it was pointing to a site I expected, etc) I could rid myself of these emails. Aside from habit, creep is the other reason. A newsletter here, a weekly sales blast there and suddenly you&#8217;ve got 50 marketing emails a day.</p>
<p>So there you go. Make a resolution for 2012 to clean up your inbox. It&#8217;s dead easy. And my InBox &#8211; down to 4 marketing emails today (unSUBBED!) and 6 from friendly suppliers in China &#8211; which I guess I&#8217;m stuck with.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=242&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2012/01/04/a-simple-way-to-clean-up-your-inbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>Project Honeypot &amp; Coldfusion Part 2</title>
		<link>http://sidfishes.wordpress.com/2011/12/06/project-honeypot-coldfusion-part-2/</link>
		<comments>http://sidfishes.wordpress.com/2011/12/06/project-honeypot-coldfusion-part-2/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:22:27 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=241</guid>
		<description><![CDATA[One of my more popular posts has been Stopping Comment Spammers &#38; Email Harvesters with Coldfusion &#38; Project Honeypot. This code has been working very well for me and I have seen a noticeable decrease in comment spam. It also seems to be working for Project Honeypot, at least in a small way. My Stats Harvester [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=241&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my more popular posts has been <a title="Stopping Comment Spammers &amp; Email Harvesters with Coldfusion &amp; Project Honeypot" href="http://sidfishes.wordpress.com/2011/06/09/stopping-comment-spammers-email-harvesters-with-coldfusion-project-honeypot/">Stopping Comment Spammers &amp; Email Harvesters with Coldfusion &amp; Project Honeypot</a>. This code has been working very well for me and I have seen a noticeable decrease in comment spam. It also seems to be working for Project Honeypot, at least in a small way.</p>
<p>My Stats</p>
<ul>
<li>Harvester visits to your site(s): <strong>42</strong></li>
<li>Recent visits (this week): <strong>3</strong></li>
<li>Recent visits (this month): <strong>9</strong></li>
<li>Spam traps issued on your sites: <strong>304</strong></li>
<li>Spam received at your addresses: <strong>1,089</strong></li>
<li>Received this week: <strong>112</strong></li>
<li>Received this month: <strong>417</strong></li>
<li>Comment spam posts to your site(s): <strong>0</strong></li>
</ul>
<p><strong>A code update.</strong></p>
<p>One of the things I noticed since implementing the code in my previous post, my site page load times were up quite a bit. The reason is that the code uses http:Bl to do a DNS look up to the project servers for every page load. This takes -time-. I decided to add my own white list table and some code to eliminate these multiple look-ups.</p>
<p>The table is simple, just</p>
<pre>visitor_ip_addys [varchar(15)]
visitdate [datetime]</pre>
<p>I added the following function to my Honeypot CFC</p>
<pre>&lt;cffunction name="newVisitorCheck" returntype="string"&gt;
   &lt;cfargument name="ip" required="yes" type="string"&gt;
   &lt;cfset var vQry = ""&gt;

  &lt;cfquery name="vQry" datasource="myDSN"&gt;
    select ipaddy from visitor_ip_addys where ipaddy = &lt;cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.ip#"&gt;
  &lt;/cfquery&gt;

 &lt;cfif vQry.recordcount eq 0&gt;&lt;!--- then it's a new visitor  ---&gt;
   &lt;cfset result = "new"&gt;
 &lt;cfelse&gt;
   &lt;cfset result ="existing"&gt;
 &lt;/cfif&gt;
&lt;cfreturn result&gt;
&lt;/cffunction&gt;</pre>
<p>And changed my honeyPotCheck function to</p>
<pre>&lt;cffunction name="honeypotcheck" returntype="struct" hint="Check Project HoneyPot http:BL"&gt;
  &lt;cfargument name="ip" required="yes" type="string"&gt;
  &lt;cfset var aVal = ""&gt;
  &lt;cfset var hpkey = "MyKey"&gt;
  &lt;cfset var stRet = structNew()&gt;

&lt;!---jb: added check to see if this ip has visited in the last 3 months. We have a table to track ips which is retained for 3 months. IP's that check as clean
against http:BL are added to this table to increase page load performance. The table is cleared every 3 months to revalidate visitors (in case they may have been
compromised in that time and to keep table size reasonable ---&gt;

&lt;cfinvoke method="newVisitorCheck" returnvariable="result"&gt;
&lt;cfinvokeargument name="ip" value="#arguments.ip#"&gt;
&lt;/cfinvoke&gt;

&lt;cfif result eq "new"&gt;
  &lt;!--- Get the different IP values ---&gt;
  &lt;cfset aVal = listToArray(gethostaddress("#hpkey#.#reverseip(arguments.ip)#.dnsbl.httpbl.org"),".")&gt;

        &lt;cfif aVal[1] eq "IP-Address not known"&gt;&lt;!--- jb: added evaluation of array for good addresses ---&gt;
        &lt;!--- set a value indicating ok address ---&gt;
            &lt;cfset stRet = {type=99}&gt;
            &lt;!--- insert into visitor_ip_addys table as this is a clean IP ---&gt;

            &lt;cfquery name="iQry" datasource="MyDSN"&gt;
            insert into visitor_ip_addys (ipaddy, visitdate) values
            (&lt;cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.ip#"&gt;,
            &lt;cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#"&gt; )
            &lt;/cfquery&gt;

        &lt;cfelse&gt;
          &lt;!--- there was a match so set the return values ---&gt;
          &lt;cfset stRet.days = aVal[2]&gt;
          &lt;cfset stRet.threat = aVal[3]&gt;
          &lt;cfset stRet.type = aVal[4]&gt;

          &lt;!--- Get the HP info message ie: threat level ---&gt;
          &lt;cfswitch expression="#aVal[4]#"&gt;
           &lt;cfcase value="0"&gt;
            &lt;cfset stRet.message = "Search Engine (0)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="1"&gt;
            &lt;cfset stRet.message = "Suspicious (1)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="2"&gt;
            &lt;cfset stRet.message = "Harvester (2)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="3"&gt;
            &lt;cfset stRet.message = "Suspicious &amp; Harvester (1+2)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="4"&gt;
            &lt;cfset stRet.message = "Comment Spammer (4)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="5"&gt;
            &lt;cfset stRet.message = "Suspicious &amp; Comment Spammer (1+4)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="6"&gt;
            &lt;cfset stRet.message = "Harvester &amp; Comment Spammer (2+4)"&gt;
           &lt;/cfcase&gt;
           &lt;cfcase value="7"&gt;
            &lt;cfset stRet.message = "Suspicious &amp; Harvester &amp; Comment Spammer (1+2+4)"&gt;
           &lt;/cfcase&gt;
          &lt;!---  &lt;cfdefaultcase&gt; jb: moved to top of function as we can't eval the array if there is no lookup response ie: not match in http:BL
            &lt;cfset stRet.message = "IP-Address not known"&gt;
           &lt;/cfdefaultcase&gt; ---&gt;
          &lt;/cfswitch&gt;

        &lt;/cfif&gt;
  &lt;cfelse&gt;
    &lt;!--- good address  ---&gt;
    &lt;cfset stRet = {type=99}&gt;
&lt;/cfif&gt;
  &lt;cfreturn stRet&gt;
 &lt;/cffunction&gt;</pre>
<p>As you can see from the comments in the code, I do the look-up (newVisitorCheck) when honeypotcheck is invoked, which is on each page load. The check does a query to see if that IP is in our white list table. If it is, then we skip the rest of the check and do not do a http:Bl DNS query. If it does not exist in our white list, that either means that the IP is new so we need to check it, or that it is a known bad IP. This means that new visitors have a slightly longer wait on first page load as we are doing the look-up, but then if they pass the look-up, we add them to the white list* and do not slow them down for subsequent page loads. As noted in the comments, we keep entries in the white list for 3 months (an arbitrary number).</p>
<p>After 3 months, we remove the IP from the white list so we can recheck it to make sure the IP hasn&#8217;t been compromised.</p>
<p>The code to do this is:</p>
<pre>&lt;cffunction name="ipTableCleanup" access="Remote"&gt;
&lt;cfquery name="deleteIP" datasource="myDSN"&gt;
    delete from visitor_ip_addys where visitdate &lt;= DATE_ADD(CURRENT_TIMESTAMP, INTERVAL -90 day)
&lt;/cfquery&gt;
&lt;/cffunction&gt;</pre>
<p>This is run every day via a schedule task set up in CFAdmin.</p>
<p>All in all, this seems to be working quite well as page load times are back to where they were before the Honeypot implementation and the Honeypot is still doing its job.</p>
<p>*Note that since you are capturing &amp; storing IP addresses, your privacy policy should reflect this fact.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=241&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/12/06/project-honeypot-coldfusion-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>QR Code Generator Update</title>
		<link>http://sidfishes.wordpress.com/2011/11/29/qr-code-generator-update/</link>
		<comments>http://sidfishes.wordpress.com/2011/11/29/qr-code-generator-update/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 15:33:06 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=234</guid>
		<description><![CDATA[I&#8217;ve just found a bug in the way I wrote the original code for my QR Code Generator Update 2: Thanks to a comment from Michael, I&#8217;ve found another way to fix the issue by adding encodeURIComponent to the JS function. See the comments for details. Now you have 2 ways to do it The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=234&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just found a bug in the way I wrote the original code for my <a href="http://sidfishes.wordpress.com/2011/06/22/quick-dirty-qr-code-generator-using-coldfusion-cfimage-tag/">QR Code Generator</a></p>
<p><strong>Update 2:</strong> Thanks to a comment from Michael, I&#8217;ve found another way to fix the issue by adding <em>encodeURIComponent</em> to the JS function. See the comments for details. Now you have 2 ways to do it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The problem is that by using the url scope you can only get one url parameter to pass to the Chart API from the variable #url.siteurl#.</p>
<p>If you enter</p>
<p>http://www.testserv.com?foo=1&#038;bar=2</p>
<p>as the input value of the text box, the value of url.siteurl becomes <strong>http://www.testserv.com?foo=1</strong> and then CF creates -another- URL variable called <strong>bar</strong> with a value of 2.</p>
<p>This had me stumped for a while. but what is happening is that the url being passed as</p>
<pre>dsp_qrcodeGen.cfm?siteurl=http://www.testserv.com?foo=string1&amp;bar=string2</pre>
<p>W<strong></strong>hat we get when we do a &lt;cfdump var=&#8221;#url#&#8221;&gt; is</p>
<p>param1 (siteurl) = http://www.testserv.com?foo=string1</p>
<p>param2 (bar) = string2</p>
<p>See what happened there? Everything after the first <strong>?</strong> (dsp_qrcodeGen.cfm?) up to the first &amp; (&amp;bar) becomes a param pair and then everything after the <strong>&amp;</strong> becomes a pair. Problem is we don&#8217;t -want- to pass 2 url params. as we&#8217;d have to handle them by doing something like</p>
<pre>&lt;cfhttp url="http://chart.apis.google.com/chart?chs=200x200&amp;cht=qr&amp;chl=#url.siteurl#<strong>&amp;someparamname=#url.someparamname#</strong>" result="qrcode" getasbinary="yes"&gt;</pre>
<p>This gives us the proper string to pass but it requires us to hand code the cfhttp call making it very inflexible.  It becomes even more difficult as we need to pass additional params. You could probably code up a parsing loop of some kind but there is a much simpler method.</p>
<p>CF does not  parse form variables in the same way it does URL params, so by using the form scope, CF doesn&#8217;t break apart the string that we feed it.</p>
<pre>&lt;cfoutput&gt;
&lt;div style="margin:auto; width: 700px; height:450px;padding:25px;text-align:center;border:1px solid;"&gt;
    &lt;form method="post" action="dsp_qrcodegen.cfm"&gt;
        &lt;h3&gt;QR Code Generator&lt;/h3&gt;
        &lt;hr&gt;
        Input URL
        &lt;input type="text" name="siteurl" id="siteurl" style="width:500px;margin:50px 0 50px 0;"&gt;&lt;br&gt;
        &lt;input type="submit"&gt;
    &lt;/form&gt;
    &lt;cfif structkeyexists(form, "siteurl")&gt;
        &lt;div style="margin:auto;"&gt;
        &lt;cfhttp url="http://chart.apis.google.com/chart?chs=200x200&amp;cht=qr&amp;chl=#urlencodedformat(form.siteurl)#&amp;chld=H|0" result="qrcode" getasbinary="yes"&gt;
        &lt;cfimage action="writeToBrowser"  
                 source="#qrcode.filecontent#" /&gt;
            &lt;br&gt;
            #form.siteurl#
        &lt;/div&gt;
    &lt;/cfif&gt;
&lt;/div&gt;
&lt;/cfoutput&gt;</pre>
<p>#form.siteurl# stays <strong>siteurl=http://www.testserv.com?foo=string1&amp;bar=string2</strong> so all our params get passed and you can add as many additional params as you like.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=234&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/11/29/qr-code-generator-update/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows 7 regional settings &amp; Microsoft Access Errors</title>
		<link>http://sidfishes.wordpress.com/2011/10/12/windows-7-regional-settings-microsoft-access-errors/</link>
		<comments>http://sidfishes.wordpress.com/2011/10/12/windows-7-regional-settings-microsoft-access-errors/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 14:02:24 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Sides]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=195</guid>
		<description><![CDATA[We&#8217;ve recently been swapping out our old XP machines for new Win7 machines and for the most part things have been pretty smooth (except you HP1020 printer &#8211; yes I&#8217;m looking at you). However, we did start to run into to some unexplained weirdness. We run an in-house order system built on an Access ADE/Access [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=195&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve recently been swapping out our old XP machines for new Win7 machines and for the most part things have been pretty smooth (except you HP1020 printer &#8211; yes I&#8217;m looking at you). However, we did start to run into to some unexplained weirdness. We run an in-house order system built on an Access ADE/Access 2003 Runtime front end &amp; a MSSQL backend. With the latest couple of new machines we started to see some errors, specifically when a user tried to use the MSCAL.OCX Datepicker. (it turns out we hadn&#8217;t run into the error before as the new machines were going to non-orderdesk people who didn&#8217;t use mscal) Now because users have Runtime &amp; not a full version of Access, debugging these kinds of errors can be a challenge. I have lots of validation &amp; error handling built in for user input issues but Runtime does not provide meaningful error messages on its own so when you run into a system related error, you just get a generic error message (yes there probably are ways to handle those kinds of errors too but not in -my- apps).</p>
<p>Things became even stranger as we found that User A had the error but when User B logged on to the same machine, they were able to use the app just fine. My initial thought was that it was a permissions problem for User A. We checked folder permissions for our app folder and everything seemed fine. We also checked to make sure both users had perms to the Access Program folder (where the OCX resides) and that checked out OK as well. I was tied up with some things so I had my assistant investigate a bit more. After some muttering &amp; swearing (I may be projecting here), he returned to my office and said triumphantly, &#8220;Regional settings!&#8221;</p>
<p>For some reason User A had regional settings that were different than User B (who had the correct setup) Calendar control didn&#8217;t know what to do with the format it was being given so it threw an error.</p>
<p>Firstly, it&#8217;s awesome that &#8220;my guy&#8221; figured this one. In a very long series of assistants, he is the first one even remotely capable of the kind of thinking that finds these kinds of solutions. If you&#8217;ve ever uttered the words, &#8220;never mind, I&#8217;ll fix it myself&#8221;, you know what I&#8217;m talking about.</p>
<p>Secondly, I ran into this exact error when we made the switch from win200 to XPpro years ago but I didn&#8217;t make note of it. Now I have and I&#8217;ll be able to find a solution when we make the switch from win7 to win10 in 8 years time. :0</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=195&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/10/12/windows-7-regional-settings-microsoft-access-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Railo/Tomcat on 64 bit Windows Server 2008 R2 with IIS 7.5 and Plesk &#8211; The Correct Way</title>
		<link>http://sidfishes.wordpress.com/2011/09/13/installing-railotomcat-in-windows-server-2008-r2-iis-7-5-with-plesk-the-correct-way/</link>
		<comments>http://sidfishes.wordpress.com/2011/09/13/installing-railotomcat-in-windows-server-2008-r2-iis-7-5-with-plesk-the-correct-way/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 04:43:59 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=181</guid>
		<description><![CDATA[This is an update of the post on setting up my new server and my struggle to get Railo installed. After a few tips from Google Groups for Railo and specifically Mark Drew (CEO Railo UK &#38; original author of cfeclipse, my favourite CFML editor) &#38; Jordan Michaels (Community Deployments Coordinator &#8211; ie: the install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=181&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is an update of the post on setting up my new server and my <a href="http://sidfishes.wordpress.com/2011/09/05/installing-railo-tomcat-iis-7-5-on-ms-server-2008-r2-64bit-with-plesk-thrown-in-to-make-it-interesting/">struggle to get Railo installed</a>. After a few tips from Google Groups for Railo and specifically Mark Drew (CEO Railo UK &amp; original author of cfeclipse, my favourite CFML editor) &amp; Jordan Michaels (Community Deployments Coordinator &#8211; ie: the install guy), I decided to reprovision (ie: reinstall) my virtual server and give it another try. I actually did this final setup twice, once to get it to work and once to document it. I&#8217;m getting pretty good at it now <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Basically, the problems I experienced in the first few times around were due to 2 things; Plesk and my confusion (or IIS 7.5 lack of clarity) as to what Enable 32 Bit Applications means. Plesk does quite a few funky things to IIS since it is a web based management tool. Much of my grief stemmed from the fact that Plesk is a 32 bit App and my server install is 64 bit. Plesk also uses but doesn&#8217;t expose a version of Tomcat. My confusion in the original post as to why the Railo Tomcat was installing itself on a different port than normal was likely due to the Plesk instance. Now we don&#8217;t want to break Plesk (I&#8217;m paying for it every month!) so we need a procedure to make it play nice and undo some of the problems it causes with IIS. The following outlines the steps needed to get Plesk, Railo, Tomcat &amp; iis 7.5 all running happily.</p>
<p>The first section of my previous post outlines how to set up the server and a single website using Plesk on a GoDaddy VPS (virtual private server). I&#8217;m assuming Plesk operates pretty much the same on all II 7.5 setups so it should be pretty standard. That setup walkthrough is still valid however, as I found out, the remaining part of the post dealing with Railo &amp; IIS is incorrect (well, not exactly incorrect &#8211; it did get things working, just not in the best way) and superseded by this. I&#8217;ve also changed the order in which I did some things so let&#8217;s get started.</p>
<p><strong>Fixing what Plesk Hath Wrought</strong></p>
<p>Once we&#8217;ve created our website via the Plesk panel we need to go and make some changes in IIS so fire up inetmgr</p>
<p>Select <strong>Application Pools </strong>under the main node of your site. You&#8217;ll notice there a couple of the standard and a couple added by Plesk.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo1.jpg"><img class="aligncenter size-medium wp-image-182" title="railo1" src="http://sidfishes.files.wordpress.com/2011/09/railo1.jpg?w=712&#038;h=201" alt="" width="712" height="201" /></a></p>
<p>Click <strong>Set Application Pool Defaults</strong> from the right column. Here we see that Plesk has set <em>Enable 32 Bit Applications</em> to <strong>True</strong>. We need to set this to false.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4a.jpg"><img class="aligncenter size-medium wp-image-198" title="railo4a" src="http://sidfishes.files.wordpress.com/2011/09/railo4a.jpg?w=470&#038;h=305" alt="" width="470" height="305" /></a></p>
<p>This was a big stumbling block for me on the first couple tries as I did not have a clear understanding as to what <strong>Enable</strong> means. For IIS 7.5 Enable means<strong> Only Allow</strong>.  So If you have this set in defaults it will create all new AppPools with 32 bit enabled preventing 64 bit apps from running. You will get an error: <strong>HTTP Error 500.0 &#8211; Internal Server Error</strong><strong> Calling LoadLibraryEx on ISAPI filter &#8220;C:\railo\connector\isapi_redirect-1.2.31.dll&#8221; failed. </strong></p>
<h3></h3>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4b.jpg"><img class="aligncenter size-medium wp-image-199" title="railo4b" src="http://sidfishes.files.wordpress.com/2011/09/railo4b.jpg?w=682&#038;h=146" alt="" width="682" height="146" /></a></p>
<p>The other very confusing thing is that this seems to <strong>override individually set AppPool settings and break all 64 bit websites if 32 bit is enabled in Application Pool Defaults.</strong>  In order to have a <em>mixed 32/64 bit environment you MUST have Application Pool Enabled 32 bit Application set to FALSE.</em> To allow an individual site to run 32 bit apps, you need to click on the appPool you want to change and click <strong>Advanced Settings</strong> from the right column.Change the drop down from False (the default) to True</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4c.jpg"><img class="aligncenter size-medium wp-image-200" title="railo4c" src="http://sidfishes.files.wordpress.com/2011/09/railo4c.jpg?w=475&#038;h=171" alt="" width="475" height="171" /></a></p>
<p>For Plesk to work we need to set  both<em> plesk(default)(2.0)(pool)</em> and <em>PleskControlPanel</em> to use 32 bit applications. Once you have done this, browse to your Plesk panel and verify everything is working.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4d.jpg"><img class="aligncenter size-medium wp-image-201" title="railo4d" src="http://sidfishes.files.wordpress.com/2011/09/railo4d.jpg?w=300&#038;h=175" alt="" width="300" height="175" /></a></p>
<p>Now that we&#8217;ve got Plesk in a 64 bit environment, we need to add an AppPool for our new website. Click Add Application Pool in the right column and give your pool a meaningful  name. The name of the website works well. Leave the other settings as they are.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo2.jpg"><img class="aligncenter size-full wp-image-183" title="railo2" src="http://sidfishes.files.wordpress.com/2011/09/railo2.jpg?w=630" alt=""   /></a></p>
<p>Now that we&#8217;ve got that set up, we need to associate the new AppPool with the new website. Select the website in the left column and then click Advanced Settings from the right. You&#8217;ll note that the website is set up by Plesk to use <em>plesk(default)(2.0)(pool).</em> Click on this and then<em> </em> click on the [...]<em> </em>Select your new AppPool and click OK.</p>
<p><strong>Install Railo</strong></p>
<p>Not much to say here. Run the setup routine, making note of your Tomcat admin password. The installer may request that you choose a port for Tomcat. If you don&#8217;t get asked, it means that Tomcat can use the default port. If you do, it means that something is using that port. I assume it&#8217;s Plesk&#8217;s version of Tomcat? This happened twice and the rest of the time it didn&#8217;t on the various installs I&#8217;ve tried. Does Plesk choose different ports at setup? I don&#8217;t know. Remember, my install is based on an OS image with Plesk pre-installed so I don&#8217;t have any control over it&#8217;s install.</p>
<p>Once the install is complete and you get the first run page, set your Server &amp; Web Admin Passwords for Railo.<a href="http://sidfishes.files.wordpress.com/2011/09/railo7.jpg"><br />
</a></p>
<p>Now we need to fix one more issue introduced by Plesk. This one was another stumbling block in my initial tries. Because I installed Railo immediately, I did not know that Plesk had already set up a jakarta virtual directory pointing to its own version (32 bit) isapi connector for use by its own version of Tomcat. Without going into too much detail about that, the jakarta vDir in any application that uses railo needs to be pointed at the railo isapi 64bit  connector (on a 64 bit OS). Click on the jakarta subdirectory of your website, Click Advanced Settings in the left column and  point the physical path of the Railo connector</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4e.jpg"><img class="aligncenter size-medium wp-image-204" title="railo4e" src="http://sidfishes.files.wordpress.com/2011/09/railo4e.jpg?w=414&#038;h=111" alt="" width="414" height="111" /></a></p>
<p>Now we&#8217;ve cleared up all the issues caused by Plesk and it&#8217;s time to move on to the final set up of IIS 7.5</p>
<p><strong>The Home Stretch</strong></p>
<p>The Railo install does a lot of the work for you but we do have to do a few things. The server root node will have a Handler Mapping for *.cfm files set up, but it doesn&#8217;t seem to set it up for individual sites. Click on your website node and then Handler Mappings. Click Add Script Map from the right column. Set the Request Path to *.cf*. All the Railo walkthroughs I&#8217;ve seen only seem to add one for *.cfm. The installer only adds *.cfm but I&#8217;m not sure if it will process CFC&#8217;s if only *.cfm is set up.<del> I assume it will but it won&#8217;t hurt to use *.cf* to cover both right?</del></p>
<p><em>edit: While I don&#8217;t think it will do any harm to set it to *.cf*, setting/leaving the Handler Mapping as *.cfm is fine. Now that I have an actual operating system, I was able to verify that CFCs were processed correctly with only a mapping for *.cfm</em></p>
<p>Point the executable to the {installPath}\connector\isapi_redirect-xx.xx.xx.dll and give it a name.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo7.jpg"><img class="aligncenter size-medium wp-image-188" title="railo7" src="http://sidfishes.files.wordpress.com/2011/09/railo7.jpg?w=738&#038;h=348" alt="" width="738" height="348" /></a></p>
<p>*note: some of the more eagle eyed of you may notice that the path in the handler mapping screen cap above shows I&#8217;m adding the Handler Mapping in the {website} &gt; jakarta section. This was not intentional. You should be in the root node of your website when you add an handler mapping. In this case it should have been railoinstalltest.ca</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo5.jpg"><br />
</a>Now double check that there is an entry for the isapi connector in the Isapi Filters section. This should be added by the installer but if not you can add it easily.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo8.jpg"><img class="aligncenter size-medium wp-image-189" title="railo8" src="http://sidfishes.files.wordpress.com/2011/09/railo8.jpg?w=443&#038;h=256" alt="" width="443" height="256" /></a></p>
<p>One final thing to do is to make sure that index.cfm is at the top of the Default Documents list (not necessary but I&#8217;d do it in any case). Index.cfm should be added by the installer, but if not you can add it.</p>
<p><strong>Adding a Tomcat Webcontext</strong></p>
<p>Click on Start Menu &gt;All Programs  &gt; Railo &gt;Tomcat Host Config to open up the Tomcat<strong> Server.xml</strong> file (a nice touch added by the installer). Scroll to the bottom of this file to add your &#8220;webcontext&#8221;; basically tell Tomcat what directory to watch under what website. There is a template to use which is commented out with &lt;!&#8211; &#8211;&gt;</p>
<p>&lt;!&#8211;<br />
&lt;Host name=&#8221;[ENTER DOMAIN NAME]&#8221; appBase=&#8221;webapps&#8221;&gt;<br />
&lt;Context path=&#8221;" docBase=&#8221;[ENTER SYSTEM PATH]&#8221; /&gt;<br />
&lt;/Host&gt;<br />
&#8211;&gt;</p>
<p>Copy that <del>twice</del> and modify it to add the Hostnames of your site and the path to the document root.</p>
<p><del>&lt;Host name=&#8221;railoinstalltest.ca&#8221; appBase=&#8221;webapps&#8221;&gt;</del><br />
<del> &lt;Context path=&#8221;" docBase=&#8221;C:\inetpub\vhosts\railoinstalltest.ca\httpdocs&#8221; /&gt;</del><br />
<del> &lt;/Host&gt;</del></p>
<p><del>Note that there are two instances for a single site; one for www.railoinstalltest.ca and one for railoinstalltest.ca. You would need to repeat this for each binding your site has that you want to process cfm files. You wouldn&#8217;t need to add one for ftp.railoinstalltest.ca but you probably would for admin.railoinstalltest.ca</del></p>
<p><em>edit: Thanks to Spills in the comments for pointing me to the use of Alias. Add an alias for each binding of your site that you want to process cfm files. Saves a few lines and if you have a lot of sites, it keeps the file cleaner.</em></p>
<p>&lt;Host name=&#8221;www.railoinstalltest.ca&#8221; appBase=&#8221;webapps&#8221;&gt;<br />
&lt;Context path=&#8221;" docBase=&#8221;C:\inetpub\vhosts\railoinstalltes.ca\httpdocs&#8221; /&gt;<br />
<span style="color:#000080;">&lt;Alias&gt;railoinstalltest.ca&lt;/Alias&gt;</span><br />
&lt;/Host&gt;</p>
<p>Save the file and restart Tomcat using Start Menu &gt;All Programs  &gt; Railo &gt; Railo-Tomcat Service Control</p>
<p>Now at this point we -should- be able to browse our first cfm file. (but I bet you&#8217;re guessing maybe, just maybe we can&#8217;t?)</p>
<p>Create a simple one <a href="http://sidfishes.files.wordpress.com/2011/09/railo4g1.jpg"><br />
</a><em>&lt;cfoutput&gt; &lt;h1&gt;Hello World!&lt;/h1&gt;&lt;br&gt; The time is #now()#&lt;/cfoutput&gt;</em></p>
<p>and save it to the httpdocs folder of your website and browse to the site and&#8230;</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo4f.jpg"><img class="aligncenter size-medium wp-image-207" title="railo4f" src="http://sidfishes.files.wordpress.com/2011/09/railo4f.jpg?w=666&#038;h=270" alt="" width="666" height="270" /></a></p>
<p>You&#8217;ll note the error detail <em>Cannot read configuration file due to insufficient permissions</em>. Now we know that the website configuration file is web.config and it is located in the document root of each website. So the error message tells us that for some reason, IIS doesn&#8217;t have permission to read that file, or more accurately, the website&#8217;s AppPool doesn&#8217;t. In IIS 7.5 the appPool is an isolated security context for each website, provided you set them up that way as we did. We need to give the appPool permissions to access the directory. Open Explorer and browse to your webroot, in this case inetpub\vhosts and select your website. Right click and select the security tab. Click Edit and then Add. In the Object Names box enter <strong>IIS AppPool\{nameof yourAppPool}</strong> or in this case IIS AppPool\railotest. Click ok.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo10.jpg"><img class="aligncenter size-medium wp-image-191" title="railo10" src="http://sidfishes.files.wordpress.com/2011/09/railo10.jpg?w=477&#038;h=424" alt="" width="477" height="424" /></a></p>
<p>Now at this point (again) you&#8217;d think we&#8217;d be done, but I discovered that granting permissions at the topmost level of the site doesn&#8217;t propagate the changes to lower directories like you&#8217;d expect. I&#8217;m not sure if this is a Server 2008R2 thing or something related to IIS AppPool objects but we need to do one more thing. From the Security Tab of the properties box, click Advanced &gt; Change Permissions. Click in the Permission Entries box and select all of the entries, including the AppPool entry you just added. This step is important and failure to do so can mess up the permissions for the site. Click the Replace All Child Object Permissions With Inheritable Permissions From this Object check box. This will set the permissions of all of the subdirectories of the root website based on the permissions of the root directory (ie: the one we just added the AppPool permission). It does this for each Permission Entry in the list. As such all of the subdirectories will have permissions Read &amp; Execute, List Folder Contents and Read set for your website AppPool.</p>
<p><a href="http://sidfishes.files.wordpress.com/2011/09/railo11.jpg"><img class="aligncenter size-medium wp-image-192" title="railo11" src="http://sidfishes.files.wordpress.com/2011/09/railo11.jpg?w=437&#038;h=348" alt="" width="437" height="348" /></a></p>
<p>Finally, back to the browser and &#8230;..</p>
<p style="text-align:center;"><a href="http://sidfishes.files.wordpress.com/2011/09/railo4g1.jpg"><img class="aligncenter" title="railo4g" src="http://sidfishes.files.wordpress.com/2011/09/railo4g1.jpg?w=285&#038;h=135" alt="" width="285" height="135" /></a></p>
<p>Ahhh, I love it when a plan (and 2 weeks, 5 OS reinstalls and several hundred cups of coffee) come together.</p>
<p>Unlike my previous post, I&#8217;m pretty confident that this is the correct way to get these various pieces of code to live on my webserver in glorious harmony. I didn&#8217;t realize when I started this project that I would be spending this much time just getting the server set up, but in retrospect, I&#8217;m glad it did. I have a much better understanding of how all the various pieces work and feel much better about the way my server is set up. My initial attempts led to so much random clicking of settings that I could have easily compromised the security of the server. I&#8217;m very glad that I have a VPS so flattening the server and starting again was a simple, 2-3 hours automated process which required none of my time.</p>
<p>As before, If you&#8217;ve got any corrections or suggestions, let me know about them in the comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=181&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/09/13/installing-railotomcat-in-windows-server-2008-r2-iis-7-5-with-plesk-the-correct-way/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo1.jpg?w=300" medium="image">
			<media:title type="html">railo1</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4a.jpg?w=300" medium="image">
			<media:title type="html">railo4a</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4b.jpg?w=300" medium="image">
			<media:title type="html">railo4b</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4c.jpg?w=300" medium="image">
			<media:title type="html">railo4c</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4d.jpg?w=300" medium="image">
			<media:title type="html">railo4d</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo2.jpg" medium="image">
			<media:title type="html">railo2</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4e.jpg?w=300" medium="image">
			<media:title type="html">railo4e</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo7.jpg?w=300" medium="image">
			<media:title type="html">railo7</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo8.jpg?w=300" medium="image">
			<media:title type="html">railo8</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4f.jpg?w=300" medium="image">
			<media:title type="html">railo4f</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo10.jpg?w=300" medium="image">
			<media:title type="html">railo10</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo11.jpg?w=300" medium="image">
			<media:title type="html">railo11</media:title>
		</media:content>

		<media:content url="http://sidfishes.files.wordpress.com/2011/09/railo4g1.jpg" medium="image">
			<media:title type="html">railo4g</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Railo, Tomcat &amp; IIS 7.5 on MS Server 2008 r2 64bit (with Plesk thrown in to make it interesting)</title>
		<link>http://sidfishes.wordpress.com/2011/09/05/installing-railo-tomcat-iis-7-5-on-ms-server-2008-r2-64bit-with-plesk-thrown-in-to-make-it-interesting/</link>
		<comments>http://sidfishes.wordpress.com/2011/09/05/installing-railo-tomcat-iis-7-5-on-ms-server-2008-r2-64bit-with-plesk-thrown-in-to-make-it-interesting/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 15:57:34 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=156</guid>
		<description><![CDATA[UPDATE: Thanks to some input from the Railo folks at GoogleGroups, I&#8217;ve got a couple more ideas to try. One thing mentioned was that my &#8220;solution&#8221; doesn&#8217;t work very well in a production situation. It&#8217;s not much of a solution if that&#8217;s the case. I&#8217;ll keep you posted. UPDATE 2: I&#8217;ve written a Part 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=156&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>UPDATE: Thanks to some input from the <a href="http://groups.google.com/group/railo">Railo folks at GoogleGroups</a>, I&#8217;ve got a couple more ideas to try. One thing mentioned was that my &#8220;solution&#8221; doesn&#8217;t work very well in a production situation. It&#8217;s not much of a solution if that&#8217;s the case. I&#8217;ll keep you posted.</em></p>
<p>UPDATE 2: I&#8217;ve written a <a href="http://sidfishes.wordpress.com/2011/09/13/installing-railotomcat-in-windows-server-2008-r2-iis-7-5-with-plesk-the-correct-way/">Part 2</a> post with the -proper- way to set up Railo and get it working on a 64 bit Windows server with Plesk. You can still read up on how to setup your server and website using plesk in this post. The Part 2 post only deals with getting Railo running</p>
<p><strong>Initial Server Set up</strong></p>
<p>Several months ago I had an idea for a website which I think is going to be very interesting. All the posts on this blog so far have been on things I&#8217;ve discovered at my day job, this project is a personal one. Part of personal means I needed to find a server to host the thing. I looked at shared Coldfusion hosting plans but I&#8217;ve grown so used to having complete control over my co-located server at work I was reluctant to give that up. I decided on goDaddy&#8217;s (GD from now on) &#8220;Value&#8221; Virtual Dedicated Server offering.</p>
<p>The server (virtual) specs are:</p>
<div id="ctl00_ContentPlaceHolder1_ctl00_dpOperatingSystem">
<div>Operating System: Windows Server 2008 r2 64 bit</div>
</div>
<div id="ctl00_ContentPlaceHolder1_ctl00_dpRAM">
<div>Processor: Intel Xeon L5609 @ 1.87 GHz</div>
<div>RAM: 2 GB</div>
</div>
<div>
<div>Total Disk Space: 30 GB</div>
</div>
<div id="ctl00_ContentPlaceHolder1_ctl00_dpBW">
<div>
<div>Bandwidth Quota: 1000 GB</div>
</div>
<div id="ctl00_ContentPlaceHolder1_ctl00_divBandwidthQuotaUsed">
<div>
<div>Quota Used:1 GB</div>
</div>
</div>
</div>
<div>
<div>Control Panel Type: PleskDomains:30</div>
</div>
<p>Nothing to write home about but it&#8217;s a respectable package for $40 a month. There are also systems available with CentOS &amp; Fedora for about the same price. There are 2 bits of fine rpint you need to know about</p>
<blockquote><p><em>Only CentOS and Fedora plans can be upgraded without reprovisioning. To upgrade a Windows server, you must purchase a new plan, backup your data, and cancel your existing server.</em></p>
<p><em>Disk space includes operating system files, which can be close to 1 GB in a CentOS/Fedora server or 11 GB on a Windows server. Please take that into consideration when choosing a server size that best fits your needs.</em></p></blockquote>
<p>So I knew that the 30G might end up being too small and that it wasn&#8217;t easily expandable (reprovisioning means your VM and everything on it is deleted and replaced with the default VM). However, I&#8217;m not sure if this project is going to go anywhere so I decided to take a conservative approach. BTW, the 11G used noted is only for OS space by the time I was finished with the various installs to get me up and running, I&#8217;m at 11.6G -free- space. If traffic &amp; use grows, I&#8217;ll look at an upgrade. That&#8217;s one of the reasons I&#8217;m writing this today. I want a record of how I did it as it has taken a full week of evenings to get to a &#8220;hello world &#8221; server status.</p>
<p>I expect many of you will be here looking for help with Railo &amp; IIS 7.5. If so, you can skip the next bit and start reading HERE. Since I&#8217;m mostly writing this for me, I&#8217;m going to document the entire server setup procedure.</p>
<p>According to GD, after you&#8217;ve made your purchase, it takes up to 48 hours for your server to be provisioned. In my case it was about 6 hours.</p>
<p><strong>Request an Additional IP</strong></p>
<p>The first thing we need to do is set up our DNS so we can resolve the domain.  Well not quite. We need to set up the domain first but GD has a different way of handling Nameservers than my provider at work. My work provider has 2 dedicated Nameservers so their control panel takes care of most of the work. We just need to fill out a couple of forms. With GD, every vServer is its own NameServer so we need to set that up. To do this (for NetSol at least) we need 2 IP addresses. By default, when your server is provisioned you only get one. Fortunately, you can easily request another and the additional IP doesn&#8217;t appear to cost anything. I don&#8217;t know if GD has a limit to how many IP&#8217;s you can request but I only need 2 at the moment.</p>
<div>Log in to your Hosting Control Center</div>
<p>Select My Products &gt; Server &gt; Click on Request Additional IP  in the Account Summary tab. You just have to confirm that in fact you want one.</p>
<p>The issue here is that it takes 6-8 hours for one to be generated so it&#8217;s a good idea to get on this right away since without it, you&#8217;re not going to be able to get DNS set up.</p>
<p><strong>Setting up your domain using Plesk</strong></p>
<p>I&#8217;m not going to document how to do this if your domain is hosted by goDaddy, I expect it&#8217;s pretty simple. My registrar has been NetSol since the 90&#8242;s so this will be how to set up a domain provided by a 3rd party. Plesk is new to me and it has some interesting options and features. It also throws in an additional layer of complexity which had me a bit confused at various points in the build.</p>
<p>Log in to your Hosting Control Center</p>
<p>Select My Products &gt; Server &gt; Support Tab in the central panel &gt; Launch Plesk (Note: You can also log in to Plesk from your desktop if you are logged on via RDP. )</p>
<p>Plesk is designed for resellers, which I may end up being at some point, however here I&#8217;m basically setting myself up as a &#8220;customer&#8221;.  To create a new domain you first create a Subscription. Fill out the form provided with your  Domain Name, Select your primary IP address,  Username &amp; Strong password. You can also choose a service plan level (which relates to a level you set  for your customer). Submit the form &amp; wait a couple of minutes and Plesk will set up a wesite in IIS based on a basic template, Most of the DNS entries you will require and Account information (for your customer) You can also create a Subscription at the same time as you create a Customer. I&#8217;m not going to go into that as I didn&#8217;t need to do it.</p>
<p><strong>Setting Up Your Nameservers </strong></p>
<p><strong></strong>(Just to clarify here, Plesk has 2 different control panels. Hosting Control &amp; Domain Control. The HC Panel admins the details of each of the Customer accounts &amp; their domains. The DC panel controls the setting of the Domain itself.</p>
<p>Assuming you now have 2 IP addresses, you can now set up your Nameservers. From HC Panel select Domains and then the Control Panel link of the domain. From the DC Panel select Websites &amp; Domain &gt; More &gt; DNS Settings</p>
<p>(I&#8217;m not going to go into the details of DNS records. You can read about what the following means on <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia</a>.) By default, Plesk creates a single Nameserver (ns.domain.com) when the domain is created. We need 2 so we need to click Add Record. The form gives us a drop down to select resource type and a few fields to fill out based on what kind of resource.</p>
<p>Select A from the list</p>
<p>The Domain field will look like [       ].yourdomain.com &gt; Enter NS2</p>
<p>In the IP Address field &gt; Enter the second IP address you received from GD</p>
<p>Click OK</p>
<p>Click Add Record again</p>
<p>Select NS from the List.</p>
<p>The Domain field will look like [       ].yourdomain.com &gt; Enter NS2</p>
<p>In the Nameserver field &gt; Enter ns2.yourdomain.com</p>
<p>Click OK</p>
<p>Now you need to click Update to save the changes.</p>
<p>Now you can update your Nameserver pointers at your Domain Name provider. This is pretty straightforward. Log in to your provider, select your domain and modify DNS settings, add ns.yourdomain.com &amp; ns2.yourdomain.com, click through the dire warnings about rendering your website unreachable and save. Now you&#8217;ll wait a few hours for the DNS to propagate.</p>
<p>Now on to setting up the server.</p>
<p><strong>Basic Server Setup<br />
</strong></p>
<p>We abandon Plesk now &amp; get messy with the server itself via rdp</p>
<p>When you login via RDP you need to enter your primary IP as the Computer. When RDP asked for credentials, you enter them in the format <em>servernameuser</em>.  You set these up when you provisioned the server.</p>
<p>Now you have a brand spanking new MS Server 2008 r2 desktop to look at. First thing you&#8217;ll want to do is have a look at the Initial Configuration Tasks window which should run when you log on. By Default, most things like auto updates, roles &amp; features are setup by provisioning but one thing that is not is Windows Firewall. You should enable the Public Networks location. This server has the full Windows Firewall  with Advanced Security suite and you can tweak to your hearts content but that&#8217;s another post. (by someone who knows a lot more about 2008 WFAS than I do)</p>
<p>The next thing I do is to install Firefox and the NoScript plugin. IE is locked down and is a real pain to use to download what we need. There is a real risk of server compromise by browsing sites so NoScript is a -must install- and no browsing Facebook!</p>
<p>Now you can fire up either Server Manager console and go to Roles &gt; WebServer &gt;IIS Manager or IIS Manager directly. For those of you who are used to IIS6 you&#8217;re going to be in for a bit of a shock. There&#8217;s nothing much familiar. I&#8217;m not going to go into much detail here other than to get you up and running with it.</p>
<p>First thing to do is expand the tree to view Sites. You&#8217;ll see that Plesk has set up a basic website for you. If your DNS has updated, you can browse to the site and see the Plesk default welcome site.If we were setting up a static site we&#8217;d be done however we&#8217;re Coldfusion coders so we&#8217;re not done yet.<br />
<a name="railo"></a><br />
<strong>Railo vs Coldfusion</strong></p>
<p>As I noted before, this is a personal project which may or may not go anywhere. I couldn&#8217;t justify $1300 for a <a href="http://www.adobe.com/products/coldfusion-family.html">CF9 Standard</a> install for this so I&#8217;ve decided to go with <a href="http://getrailo.org">Railo</a>. I could have also chosen <a href="http://www.openbluedragon.org/">Open BlueDragon</a>. Both of these are open source CFML Servers. I&#8217;ve read that Railo is the fastest of the 3 but I don&#8217;t really know. I have installed CF8 Standard on 2008 r2 64bit and while there were some issues, it was up and running in a couple of hours. Railo? Not so much.</p>
<p>UPDATE 2: I&#8217;ve written a <a href="http://sidfishes.wordpress.com/2011/09/13/installing-railotomcat-in-windows-server-2008-r2-iis-7-5-with-plesk-the-correct-way/">Part 2</a> post with the -proper- way to set up these various bits. You can still read up on how to setup you server and website using plesk in this post. The Part 2 post only deals with getting Railo running.</p>
<p><span style="color:#ff0000;">Important! Everything from here to the end of this is superseded by the Part 2 post. My solution at the end of this post, while it works, would not be suitable for a production environment. Read on to feel my pain, but don&#8217;t use the rest of this post for anything but a nice yet tragic work of fiction.</span></p>
<p><strong>Installing Railo</strong></p>
<p>The only walkthrough guide I&#8217;ve found to installing Railo on 2008 r2 64 is from <a href="http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7--Part-1-of-2.cfm">2008</a>, refers to IIS 7 and not IIS 7.5 and does not account for the improvements in the installer that the Railo team have made. It wasn&#8217;t a lot of help. Grab the latest install package from <a href="http://www.getrailo.org/index.cfm/download/">getRailo.org</a>. Choose <em>Railo Server with Tomcat 6.xx.xx</em>. This download contains both 32 &amp; 64 bit packages. run the install and walk through the wizard. Just keep the defaults unless you have compelling reason to change them. Make note of the Tomcat Port in my case it was suggested to be 8888. Most of the docs available online suggest it runs on 8009. I&#8217;m not sure why it was different but it may be that 8009 was in use. In any case, this is important as we need to make some changes later on and we need to know the port number.Make sure Railo is set to start at boot and let the installer run.</p>
<p>Once complete, you&#8217;ll be asked if you want to go to the initial Admin page. Do so and you should get the welcome page at http://localhost:8888/index.cfm. From there you should immediately click the links for Railo Server Manager &amp; Railo Website Manager and set admin passwords.</p>
<p>Pretty simple so far. We&#8217;ve verified that both Tomcat &amp; Railo are working on Port 8888. However, we don&#8217;t want to be adding 8888 to every url so we need to set up Tomcat and IIS so we can intercept CFM &amp; CFC files for processing by the Railo/Tomcat engine. This is where the problems started. Now let me be clear here. The install may work out of the box. It did not work for me. I believe I followed the step by step guides found on the Railo site and it did not work. The guides may have been written for IIS 7 and not 7.5 or perhaps I just missed something (for 6 days of evenings and multiple reinstalls) In any case, the following outlines some tof the issues I had and how to I got it running finally. Unfortunately, I didn&#8217;t record actual error messages I was getting so they&#8217;ll be a bit generic (and perhaps wrong in the context but it&#8217;s what I remember). I also may not have set this up entirely correctly. I&#8217;m writing this as I go, so I may add updates or corrections. If you spot anything I missed or a glaring un-fact, please let me know in the comments.</p>
<p><strong>Setting up a Tomcat Website Context<br />
</strong></p>
<p>First thing we need to do is go to C:railotomcatconf and edit server.xml to add a &#8220;website context&#8221;. This lets Tomcat know which sites to process.</p>
<p>&lt;Host name=&#8221;www.yourdomain.com&#8221; appBase=&#8221;webapps&#8221;&gt;<br />
&lt;Context path=&#8221;" docBase=&#8221;C:inetpubvhostsyourdomain.comhttpdocs&#8221; /&gt;<br />
&lt;/Host&gt;<br />
&lt;Host name=&#8221;yourdomain.com&#8221; appBase=&#8221;webapps&#8221;&gt;<br />
&lt;Context path=&#8221;" docBase=&#8221;C:inetpubvhostsyoudomain.comhttpdocs&#8221; /&gt;<br />
&lt;/Host&gt;</p>
<p>Notice that there is an entry for each website binding If you only have  and entry for yourdomain.com, browsers pointing to www.yourdomain.com will not have pages parsed by Railo.  (ie: your website will be broken for them). The httpdocs folder is created by Plesk and that&#8217;s where all your CF files will go.</p>
<p>Save this file and restart tomcat. To make restarts simple, Railo creates a shortcut on the start menu Railo-Tomcat Service Control. Launch it the click Stop &amp; Start</p>
<p><strong>Now Serving CFML</strong></p>
<p>At this point we&#8217;re almost ready to start serving files, but of course we need something to serve.  Create a file in your httpdocs folder called index.cfm and add the follwing code.</p>
<p>&lt;cfoutput&gt;Hello World. The time is now: #now()#&lt;/cfoutput&gt;</p>
<p>Using NOW() is a good idea as it changes at every page load and will make sure you&#8217;re not viewing a cached page. We also need to add index.cfm as a document type in IIS, so open Default Document in IIS Manager, add it and move it to the top of the list.</p>
<p>At this point we need to check to see if we can serve pages. browse to http://youdomain.com:8888/index.cfm. All things going well, you&#8217;ll get our welcome page. Now try http://youdomain.com/index.cfm and you&#8217;ll get an error. (If you don&#8217;t you were luckier than and and you&#8217;re done!)</p>
<p><strong>Tomcat and IIS 7.5 Connector</strong></p>
<p>The Railo install includes isapi_redirect-1.2.31.64-bit.dll in the Railoconf directory (it also includes a 32 bit version). The install guide says to add that to ISASPI filters and add it as a Script Map in Handler Mapping for *.cf*.  The typical steps (with pictures for those who like that kind of thing) are on <a href="http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7--Part-3-of-3.cfm">Doug Boude&#8217;s site</a>. However this is the site I referred to that outlines the steps prior to the upgraded installer. The installer takes care of all the steps prior to &#8220;<span style="font-size:small;"><span style="font-size:small;">Tell IIS It&#8217;s Okay To Run the DLL&#8221;</span></span>. Complete the remaining steps except for adding the jakarta vDirectory (it&#8217;s added by the installer), restart and theoretically, you&#8217;re done. Not so with me. Browsing from my laptop, I got a generic 404 error but browsing on the server, I got a more detailed message. A couple actually. First (I think),was a <em>500.19 Cannot read configuration file due to insufficient permissions.</em> It may have been another error but it was a permissions error<em>.<br />
</em></p>
<p><strong>A Whole New Identity</strong></p>
<p>IIS 7.5 changes the way that permissions are granted to the webserver. The new security context is per <a href="http://blogs.iis.net/webdevelopertips/archive/2009/10/02/tip-98-did-you-know-the-default-application-pool-identity-in-iis-7-5-windows-7-changed-from-networkservice-to-apppoolidentity.aspx"><em>Application Pool</em></a> rather than for the <em>Network Service</em>. I&#8217;ve read this is a big improvement in security and application isolation seems like a good thing to me. In any case, we need to deal with it to make our website work. When you create a website in Plesk as we have done, Plesk creates and Application pool with the followoing attributes</p>
<p>Name: <em>plesk(default)(2.0)(pool)</em></p>
<p>.NET Framework: v2.0.5xxxx</p>
<p>Managed Pipeline Mode: Integrated</p>
<p>I&#8217;m a fuzzy on whether I created an AppPool for my website manually or not, but I have one set up.</p>
<div>Name: myDomain.com<em></em></div>
<div>.NET Framework: v2.0.5xxxx</div>
<div>Managed Pipeline Mode: Integrated</div>
<p>To make the site run under that context, you click on your site in IIS Manager and click Basic Settings from the right hand column. Select the AppPool you want to use. Restart the website. Now you need to give your AppPool permissions for the website. In Explorer, browse to your site in inetpub, right click and select the security tab. Click Edit and then Add. In the Object Names box type IIS AppPool{theAppPoolName}, and click ok.Try to browse your site. If you still get the 500.19 error (as I did) there is one more step. For some reason the permissions propagation to the entire folder contents didn&#8217;t seem to take place. To fix this, go back into the Security tab of the properties dialog and click Advanced. Click Change Permissions. Select all of the items in the Permission Entries section (IMPORTANT: don&#8217;t proceed until all are selected. failure to do so can mess up your folder permissions for this folder entirely!) Click the R<em>eplace All Child Object Permissions with the inheritable permissions from this object</em> check box and click ok. This will apply the permission settings of the root folder of your website (which now includes your new AppPool context) to all objects below it. Click out of the dialogs and browse your site. All things having gone well, the 500.19 error should be gone. And replaced by another.</p>
<p><strong>404.17 and the Temple of Doom</strong></p>
<p>This is where things really started to get frustrating. The 404.17 error is <em>The requested content appears to be script and will not be served by the static file handler.</em> Well duh. Of course it&#8217;s a script. CFML is a scripting language. What this is telling us is that IIS doesn&#8217;t know how to handle the file and therefore the redirect to Tomcat/Railo is not working. After scouring the web for solutions and finding none using the isapi_redirect supplied with the install, I began to look at other options. I found a potential fix at one of my favourite code repositories, RiaForge in the <a href="http://tomcatiis.riaforge.org/">TomcatIIS Connector</a> which is based on the BonCode AJP. I ran the installer, and things started to look promising however I ended up with a new error: <em> System.Security.SecurityException: Request for the permission of type &#8216;System.Web.AspNetHostingPermission</em>. This error occurs when the system tries to process a dll that it doesn&#8217;t know about, ie: one downloaded from the internet. The fix is to Unblock the DLL (<a href="http://blogs.msdn.com/b/friis/archive/2010/06/09/system-security-securityexception-request-for-the-permission-of-type-system-web-aspnethostingpermission-failed.aspx">how-to</a>) for the 2 BonCode DLL&#8217;s. If you elected to add the connector to every IIS site during install, you have to manually unblock them in every directory that they occur. On the Riaforge notes, the author suggests you can also get around this by switching the Security model from AppPool back to Network Service. I think it&#8217;s better to stay with the AppPool and fix it -properly- and not revert to a less secure state. Once the DLL&#8217;s were unblocked and everything was restarted, I hit the browse button and&#8230;.. 404.17 <em>The requested content appears to be script and will not be served by the static file handler. </em>Sigh.</p>
<p>So what to do now. In my browsing, I saw one mention  of tossing the Tomcat connector (because it was such a cumbersome and miserable thing to get working with IIS. really?!@)  and using Application Request Routing. There a basic set up walk through which includes how to install it at <a href="http://blogs.iis.net/eokim/archive/2010/03/09/arr-with-tomcat.aspx">IIS.net</a>  However, I&#8217;ll walk you through how I set the thing up.</p>
<p><strong>A Light at the End</strong></p>
<p>Once ARR is installed, it will show up in IIS Manager with a new entry called <em>Server Farms</em>. Right Click and Create New. Call it RailoTomcat or whatever. For server address enter <em>localhost</em>. Click the Advanced Settings link and enter the Tomcat port for the httpPort entry, 8888 in my case. Click through until you&#8217;ve got a new &#8220;server farm&#8221; of one server called localhost. Restart IIS &amp; Tomcat and browse to http://youdomain.com/index.cfm.</p>
<p>Hello World. The time is now: {ts &#8217;2011-09-05 08:39:03&#8242;}</p>
<p>Success!</p>
<p>It works. It works. Once more time. It works.</p>
<p>Alright. We can start setting up our website. Back to Plesk. Oops. Why is the Tomcat Admin page there. Hmm. Seems that we need to add some routing rules as -everything- going to localhost is passed through 8888 (to Tomcat) at this point. Click on you Server Farm and open the Routing Rules.Open Advanced routing URLRewrite, Click on the Inbound Rule and under Inbound Rules in the right column. Add *.cf* as a pattern. You can also  add exclusions for *.jpg, *.html, *.php, *.css, *.asp. This will prevent passing  files to tomcat that it doesn&#8217;t need to process. You don&#8217;t have to add exclusions but it will probably help server performance.</p>
<p>And that pretty much wraps it up. I&#8217;m now serving CFML on IIS 7.5 using Railo and Tomcat.</p>
<p>As I said, at the beginning, you may not have any of these issues. I did. This was my solution. Hopefully it works for you. If you&#8217;ve got any suggestions or corrections on any of what I&#8217;ve written, please post in the comments. Most of this is all new territory for me so I may have gone down a few wrong paths to get to my working solution.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=156&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/09/05/installing-railo-tomcat-iis-7-5-on-ms-server-2008-r2-64bit-with-plesk-thrown-in-to-make-it-interesting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>Coldfusion CFCs, Ajax &amp; the dreaded Parsing Error: The value returned could not be evaluated.</title>
		<link>http://sidfishes.wordpress.com/2011/08/09/coldfusion-cfcs-ajax-the-dreaded-parsing-error-the-value-returned-could-not-be-evaluated/</link>
		<comments>http://sidfishes.wordpress.com/2011/08/09/coldfusion-cfcs-ajax-the-dreaded-parsing-error-the-value-returned-could-not-be-evaluated/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 18:31:14 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=150</guid>
		<description><![CDATA[I have a bit of code I was working on today. Basically it&#8217;s a CFC function that creates an access code for a partner website  &#60;cffunction name="manageAccessRequest" returntype="string"  access="remote"&#62;     &#60;cfargument name="partnermasterid" required ="true"&#62;     &#60;cfargument name="type" required ="true"&#62;     &#60;cfset var manageAccessRequests = ""&#62;     &#60;cftry&#62;     &#60;cfquery name="manageAccessRequests" datasource="dsn"&#62;         update partner_master [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=150&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a bit of code I was working on today. Basically it&#8217;s a CFC function that creates an access code for a partner website</p>
<pre> &lt;cffunction name="manageAccessRequest" returntype="string"  access="remote"&gt;
    &lt;cfargument name="partnermasterid" required ="true"&gt;
    &lt;cfargument name="type" required ="true"&gt;
    &lt;cfset var manageAccessRequests = ""&gt;
    &lt;cftry&gt;
    &lt;cfquery name="manageAccessRequests" datasource="dsn"&gt;
        update partner_master set approved = &lt;cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.type#"&gt;,
         dateapproved = &lt;cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#"&gt;
        where partnermasterid = &lt;cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.partnermasterid#"&gt;
    &lt;/cfquery&gt;
    &lt;cfif arguments.type eq "9"&gt;    
        &lt;cfset result="AccessRejected"&gt;
    &lt;cfelse&gt;
        &lt;cfinvoke method="sendApprovalNotice"&gt;
            &lt;cfinvokeargument name="partnermasterid" value="#arguments.partnermasterid#"&gt;
        &lt;/cfinvoke&gt;
            &lt;cfset result="AccessGranted"&gt;
    &lt;/cfif&gt;
&lt;cfcatch type="any"&gt;
    &lt;cfset result = "#cfcatch.type# - #cfcatch.message# - #cfcatch.detail#"&gt;
&lt;/cfcatch&gt;
&lt;/cftry&gt;
&lt;cfreturn result&gt;
&lt;/cffunction&gt;</pre>
<p>The sendApprovalNotice function is a local call. Basically, it does a query or the partner table and formats a cfmail to send the access code. Pretty simple stuff.</p>
<p>&lt;cffunction name=&#8221;sendApprovalNotice&#8221; &gt;</p>
<p>You&#8217;ll note that manageAccessRequest is returning a string &#8211; either AccessRejected or AccessGranted to use in a simple alert box on the calling page</p>
<pre>function manageReq_response(obj)
{
    alert(obj)
}</pre>
<p>Again nothing complex here. Except it wasn&#8217;t working. Whenever I submitted a  cfargument type of 9 which is DENY, I got my AccessRejected alert box. However, when I submitted a value of 1  APPROVED, the browser popped up with the dreaded generic ajax <strong>Parsing Error: The value returned could not be evaluated.</strong> (note: this is a &#8220;friendly&#8221; error thrown by <a href="http://www.lalabird.com/">JSMX </a>but the following should apply to all ajax parsing errors) This showed me the manageAccessRequest was working correctly and whatever was failing was happening in the sendApprovalNotice function</p>
<p>Hmmm. Open up Firebug,and what do I see</p>
<div>
<pre><code>&lt;br&gt; </code><code>&lt;wddxPacket version='1.0'&gt;&lt;header/&gt;&lt;data&gt;&lt;string&gt;AccessGranted&lt;/string&gt;&lt;/data&gt;&lt;/wddxPacket&gt;</code></pre>
</div>
<p>Look like a normal wddx return packet &#8211; stare, stare, hmmm hey what&#8217;s that &lt;br&gt; doing there. That can&#8217;t be there.</p>
<p>Looking at the code for sendApprovalNotice I find it just before my cfsavecontent section where I create the HTML to go in the mail.</p>
<p>&lt;cfset theaddy = AccessByID.contactEmail&gt;<br />
&lt;/cfif&gt;<strong>&lt;br&gt;</strong><br />
&lt;cfsavecontent variable=&#8221;vTmp&#8221;&gt;</p>
<p>Remove the &lt;br&gt; and all works fine.</p>
<p>Now WHY? Well, the returned value from an ajax call to a CFC can not contain any characters outside of the wddxpacket and the &lt;br&gt; was causing the parsing to bork. This one was pretty simple to find. I remember struggling with this issue a couple of years ago with a very large CFC function and the culprit was a . (dot) at the end of one line. It was almost invisible to my frustrated eyes, especially in the days before Firebug.</p>
<p>Now, back then, as now, I&#8217;d forgotten the simple way to prevent this kind of typo related hi-jinx. Use the <strong>output=&#8221;false&#8221;</strong> attribute</p>
<p>&lt;cffunction name=&#8221;sendApprovalNotice&#8221; output=&#8221;false&#8221;&gt;</p>
<p>This forces CF to ignore all text outside of a CF tag. Frankly, you should never have display code in a CFC in any case. Remember, my correct &#8220;display code&#8221; is inside a cfsavecontent and is therefore not being displayed by the CFC.</p>
<p>The other benefit to using output=&#8221;false&#8221; is that it can <a href="http://christierney.com/2011/02/16/managing-whitespace-with-cfc-output-attributes/">help reduce whitespace</a>.</p>
<p>So moral of the story. If you see <strong>Parsing Error: The value returned could not be evaluated</strong> on a callback from a CFC, check for stray characters (just to keep your code clean) and add the output=&#8221;false&#8221; attribute</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=150&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/08/09/coldfusion-cfcs-ajax-the-dreaded-parsing-error-the-value-returned-could-not-be-evaluated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>A picture is worth a thousand malcious websites</title>
		<link>http://sidfishes.wordpress.com/2011/08/04/a-picture-is-worth-a-thousand-malcious-websites/</link>
		<comments>http://sidfishes.wordpress.com/2011/08/04/a-picture-is-worth-a-thousand-malcious-websites/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 18:55:46 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=139</guid>
		<description><![CDATA[I&#8217;ve had quite a few views of my quick post on generating a QR code. QR codes DO have a down side as highlighted in this post from the Internet Storm Center. These [qr] codes can link directly to browser exploits, or could include other malicious content to manipulate your phone. As I just confirmed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=139&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had quite a few views of my quick post on <a href="http://sidfishes.wordpress.com/2011/06/22/quick-dirty-qr-code-generator-using-coldfusion-cfimage-tag/">generating a QR code</a>. QR codes DO have a down side as highlighted in <a href="http://isc.sans.edu/diary.html?storyid=11305&amp;rss">this</a> post from the Internet Storm Center.</p>
<blockquote><p>These [qr] codes can link directly to browser exploits, or could include other malicious content to manipulate your phone.</p></blockquote>
<p>As I just confirmed by scanning the code on the ISC page, one of the most popular QR Code apps for the iPhone, <a href="http://web.scanlife.com/en/">Scanlife </a> does NOT &#8220;tell you what URL they are going to open up before they actually load it.&#8221; The app immediately loads the page, which is a fairly large security risk. As far as I can tell the app (v3.12 at time of writing) provides no optional setting to view or stop the page from loading once scanned.</p>
<p>Moral of the story, random scanning of QR codes can be quite dangerous so watch yourself.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=139&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/08/04/a-picture-is-worth-a-thousand-malcious-websites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
		<item>
		<title>URLScan3.1 &amp; sesConverter for Coldfusion</title>
		<link>http://sidfishes.wordpress.com/2011/06/29/urlscan3-1-sesconverter-for-coldfusion/</link>
		<comments>http://sidfishes.wordpress.com/2011/06/29/urlscan3-1-sesconverter-for-coldfusion/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 18:28:14 +0000</pubDate>
		<dc:creator>JayB</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://sidfishes.wordpress.com/?p=132</guid>
		<description><![CDATA[Today I was doing some spring cleanup on my server and as part of this I applied URLScan to my webserver to enhance the security of IIS. It&#8217;s a simple &#38; free install and all looked good. I checked the various sites running on the server and all seemed fine. Except&#8230; for my main site. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=132&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was doing some spring cleanup on my server and as part of this I applied <a href="http://www.iis.net/download/urlscan" target="_blank">URLScan </a>to my webserver to enhance the security of IIS. It&#8217;s a simple &amp; free install and all looked good. I checked the various sites running on the server and all seemed fine. Except&#8230; for my main site. I browsed to it and I got a 404. Every page returned a 404. Hmmm. Obviously I checked to make sure I hadn&#8217;t inadvertently deleted any files on the server while I was doing my cleanup. I hadn&#8217;t. IIS running properly? Well, since this was isolated to one site , yep. So it&#8217;s something about this one site that is broken and what could it be.</p>
<p>Some may know that I use a modified version of Fusebox3 framework for my coding. This routes everything through a single index.cfm file using various templates &amp; includes. This makes maintenance simple and allows for a ton of code reuse and I&#8217;m a big fan.</p>
<p>To start the diagnosis, I simply started with index.cfm and commented out the code which kicks off the fusebox framework. A simple &lt;cfoutput&gt;#now()#&lt;/cfoutput&gt; confirmed that I was able to serve a cfm page correctly and eliminate a CF configuration problem. Next I worked my way through a couple of more templates until I got to one which made me say hmmmm. As part of this framework, I redirect users who land on</p>
<p>mysite.com/index.cfm</p>
<p>to</p>
<p>mysite.com/index.cfm/fuseaction/main.home.html</p>
<p>When I removed the redirect so the page stayed on mysite.com/index.cfm my layout page loaded without the 404. Very interesting.</p>
<p>For years, I&#8217;ve been using <a href="http://developer.fusium.com/tools/ses.cfm" target="_blank">sesConverter</a> (on this one site only) to convert my  search engine friendly urls like:</p>
<p>index.cfm/fuseaction/circuit.action.html</p>
<p>to Coldfusion urls like</p>
<p>index.cfm?fuseaction=circuit.action</p>
<p>So it seems that was only files within the framework that seemed to be an issue. On a hunch, I tried</p>
<p>mysite.com/index.cfm?fuseaction=main.home</p>
<p>and TADA &#8211; the page loaded completely. OK. So now I knew there was an issue with sesConverter but what was it. The page at Fusium is pretty much abandoned with little information in any case. I had a look at the page code and didn&#8217;t really see anything that could be an issue.</p>
<p>I knew there was an issue with the url and I knew I had just installed URLScan so hmmmm what to do. Back to the URLScan site. All of the settings for URLScan are in URLScan.ini. Third setting in and I had my answer</p>
<p>&#8220;AllowDotInPath=0<br />
By default, this option is set to 0. If this option is set to 0, URLScan rejects any request that contains multiple periods (.). This prevents attempts to disguise requests for dangerous file name extensions by putting a safe file name extension in the path information or query string portion of the URL. For example, if this option is set to 1, URLScan might permit a request for http://servername/BadFile.exe/SafeFile.htm because it interprets it as a request for an HTML page, when it is actually a request for an executable (.exe) file with the name of an HTML page in the PATH_INFO area. When this option is set to 0, URLScan may also deny requests for directories that contain periods.&#8221;</p>
<p>Since I left everything as default after the install, AllowDotInPath was set to 0 or deny. That&#8217;s a bit of a problem when your URL looks like</p>
<p>mysite.com/index.cfm/fuseaction/main.home.html</p>
<p>as the main.home will match the deny rule and URL Scan will block the request. (at least I know it&#8217;s working!) The fix was simple. Just change AllowDotInPath=0 to AllowDotInPath=1</p>
<p>No need to even restart IIS, The site was up and running immediately.</p>
<p>Note: Some may be wondering about the security of this. As it states in the note, allowing DotInPath could result in an attack like  &#8220;http://servername/BadFile.exe/SafeFile.htm. While this is true, an attacker has to have a way to get that file on your server in the first place. Since my server is locked down with no FTP and no user file uploads, there really is a very small risk in continuing to use sesConverter and AllowDotInPath=1</p>
<p>UPDATE: Found another issue today. Or rather a few browsers did.  I have a form that is filled out and before submit, I do a client side check to make sure the form is filled out correctly. If not, I pass a string to ColdFusion.Window.create to open a cfwindow with information on the missing fields</p>
<p>Basically it is this</p>
<p>ColdFusion.Window.create(&#8220;myWindow&#8221;+showreq.arguments[0], showreq.arguments[1], &#8220;#msgWindow.cfm?msg=&lt;span style=&#8221;font-weight:bold;&#8221;&gt;Require Fields Missing&lt;/span&gt;&#8221; + fieldArray)</p>
<p>However, by default, URLScan blocks the inclusion of HTML in the url. This shows in the URLScan log as <em>Rejected disallowed+query+string+sequence query+string -</em> When users missed filling out a form field, instead of the nicely formatted error window, they received a 404 message (as the msgWindow.cfm was blocked) which led them to believe the page was broken, when in fact it was working, provided they filled out all the fields correctly.</p>
<p>So this kind of checking is something we want to keep doing as for the most part, HTML has no business in a URL. I will be re-thinking my user feedback on this and doing a bit of a rewrite but in the meantime, I needed a quick fix. Turns out URLScan.ini comes to the rescue again. Fortunately, there is a section called</p>
<p>&nbsp;</p>
<p>[AlwaysAllowedUrls]<br />
;<br />
; URLs listed here will always be explicitly allowed by UrlScan<br />
; and will bypass all UrlScan checks.  URLs must be listed<br />
; with a leading &#8216;/&#8217; character.  For example:<br />
;<br />
/msgWindow.cfm</p>
<p>and adding just the single URL to the exception rule, things got back to normal. Note that the path in the URL must be complete from the root so it may be  /files/display/msgWindow.cfm or whatever.</p>
<p>Wonder what I&#8217;ll find next?!?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sidfishes.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sidfishes.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sidfishes.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sidfishes.wordpress.com&amp;blog=5113000&amp;post=132&amp;subd=sidfishes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sidfishes.wordpress.com/2011/06/29/urlscan3-1-sesconverter-for-coldfusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/22c2c8cc2fc568b639969a4f089eff8b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sidfishes</media:title>
		</media:content>
	</item>
	</channel>
</rss>
