<?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/"
	>

<channel>
	<title>Simian Enterprises &#187; ColdFusion</title>
	<atom:link href="https://www.simianenterprises.co.uk/blog/category/coldfusion/feed" rel="self" type="application/rss+xml" />
	<link>https://www.simianenterprises.co.uk/blog</link>
	<description>Web development, Coldfusion, CSS, a bit of this, a bit of that...</description>
	<lastBuildDate>Sat, 26 Apr 2014 00:42:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.7</generator>
	<item>
		<title>Find the closest in a list of numbers</title>
		<link>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html#comments</comments>
		<pubDate>Sat, 26 Apr 2014 00:27:54 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[CFKrypton]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=189</guid>
		<description><![CDATA[For a while now I&#8217;ve been working on a core set of functionality that I include with every application. In fact, my applications extend a core app that contains a whole bunch of commonly used functionality &#8211; but that&#8217;s a whole other post. I&#8217;d intended to blog about some of the components I&#8217;ve been writing [&#8230;]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>For a while now I&#8217;ve been working on a core set of functionality that I include with every application. In fact, my applications <em>extend</em> a core app that contains a whole bunch of commonly used functionality &#8211; but that&#8217;s a whole other post.</p>
<p>I&#8217;d intended to blog about some of the components I&#8217;ve been writing as I go along, but as is so often the case I find myself moving onto new work before I&#8217;ve sat down to write about the last.</p>
<p>Today, I needed to pass a number to a function and return the closest number in a given list.<br />
So for example, a list of <strong>&#8216;10,20,50,100,200,1000&#8217;</strong> and a value of <strong>42</strong>, should return <strong>50.</strong></p>
<p>It&#8217;s a simple requirement, but Google returned nothing &amp; the mighty Ben Nadel hadn&#8217;t written a comprehensive post on how to do it along with speed tests and examples involving hot girls; so I wrote a function and added it to my ever increasing library.</p>
<p>As it&#8217;s small, I thought I&#8217;d share&#8230; in doing so, I realised I&#8217;ve not updated this site in <em>way</em> too long &#8211; so for this I apologise.</p>
<p>Here&#8217;s what I came up with &#8211; hopefully it&#8217;ll save someone a bit of time:</p>
<div class="oembed-gist"><script src="https://gist.github.com/GaryStanton/f2371ad529756c1f79a3.js"></script><noscript>View the code on <a href="https://gist.github.com/GaryStanton/f2371ad529756c1f79a3">Gist</a>.</noscript></div>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lock wait timeout exceeded with ColdFusion &amp; MySQL &#8211; Checked yer logs?</title>
		<link>https://www.simianenterprises.co.uk/blog/cf-mysql-lock-wait-timeout-exceeded-186.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/cf-mysql-lock-wait-timeout-exceeded-186.html#comments</comments>
		<pubDate>Sun, 31 Mar 2013 19:55:50 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=186</guid>
		<description><![CDATA[I just spent some time diagnosing an issue with inserting records into a MySQL database and I eventually tracked it down to a gotcha I think a lot of other people may run into.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html" rel="bookmark" title="Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC">Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC </a> <small>CFC to easily pull in and cache multiple Twitter feeds....</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I just spent some time diagnosing an issue with inserting records into a MySQL database and I eventually tracked it down to a gotcha I think a lot of other people may run into.</p>
<p>The code in question does some fairly simple things &#8211; inside a &lt;cftransaction&gt; it&#8217;ll insert a record into a table, read the record back and insert a record into a second table with contents from the first record.</p>
<p>Easy, right? Except every time I tried it, I&#8217;d get a timeout with the following error:<br />
<strong><em>Lock wait timeout exceeded; try restarting transaction</em></strong><br />
Inserting the records manually worked fine, but not from CF.</p>
<p>After searching through the MySQL logs, I noticed that a second connection was made half way through the transaction &#8211; the remaining query would then time out and the transaction would roll back.<br />
What I discovered is this:</p>
<pre>&lt;cfquery datasource="yourDatasource"&gt;</pre>
<p>is treated as a different connection to</p>
<pre>&lt;cfquery datasource="yourDatasource" username="" password=""&gt;</pre>
<p>Generally I won&#8217;t include usernames and passwords in my cfquery statements, but I&#8217;m connecting to a library that does by default. I&#8217;ve found that leaving the authentication fields blank will connect fine using those specified in the datasource, however it seems that MySQL considers it a different connection which will cause a problem in a transaction.<br />
I&#8217;m running Railo 4 &#8211; the behaviour may differ on ACF.</p>
<p>So there you have it. A great argument for encapsulation and a nicely configured datasource object.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html" rel="bookmark" title="Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC">Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC </a> <small>CFC to easily pull in and cache multiple Twitter feeds....</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/cf-mysql-lock-wait-timeout-exceeded-186.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically resize images with ColdThumbs</title>
		<link>https://www.simianenterprises.co.uk/blog/dynamically-resize-images-with-coldthumbs-163.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/dynamically-resize-images-with-coldthumbs-163.html#comments</comments>
		<pubDate>Mon, 12 Mar 2012 11:49:55 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=163</guid>
		<description><![CDATA[A few days ago I was coding up a WordPress theme for a client who intended to move away from WordPress.com. One thing I noticed is that on the WordPress.com installation, images were dynamically resized by adding a parameter after the image file extension. i.e. http://domain.com/images/an-image.jpg?w=400 Since many of the posts linked to images in [&#8230;]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldthumbs" rel="bookmark" title="ColdThumbs">ColdThumbs </a> <small>ColdThumbs is a ColdFusion component to dynamically resize and cache...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>A few days ago I was coding up a WordPress theme for a client who intended to move away from WordPress.com.<br />
One thing I noticed is that on the WordPress.com installation, images were dynamically resized by adding a parameter after the image file extension.<br />
i.e. <strong>http://domain.com/images/an-image.jpg?w=400</strong><br />
Since many of the posts linked to images in this way, I had to find a way to replicate it into the WordPress installation on the local server. A quick Google search and I discovered &#8216;<a href="http://www.binarymoon.co.uk/projects/timthumb/">TimThumb</a>&#8216;, a php script for dynamically resizing images, very popular amongst WordPress theme developers.</p>
<p>Within a few minutes, I had the functionality I was looking for.<br />
<em>&#8216;Very cool&#8217;</em>, I thought to myself&#8230; <em>So why can&#8217;t I do this in ColdFusion?</em></p>
<h3>Enter: ColdThumbs!</h3>
<p>Inspired by TimThumb, <a href="http://www.simianenterprises.co.uk/blog/coldthumbs">ColdThumbs</a> is allows you to dynamically resize an image (local or external) to your desired dimensions.<br />
The script will automatically create a cached version of your resized image and return the image as content.</p>
<p>I developed this as a bit of fun one Sunday (yeah, that&#8217;s how I roll) and have put it up as my first project on <a href="http://coldthumbs.riaforge.org/">RIAForge</a>. It&#8217;s working great for me, but I&#8217;d love to hear feedback or feature requests from anyone using it.</p>
<p>Check out the <a href="http://www.simianenterprises.co.uk/blog/coldthumbs">ColdThumbs page</a> for full details.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldthumbs" rel="bookmark" title="ColdThumbs">ColdThumbs </a> <small>ColdThumbs is a ColdFusion component to dynamically resize and cache...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/dynamically-resize-images-with-coldthumbs-163.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate WordPress into your ColdFusion app</title>
		<link>https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html#comments</comments>
		<pubDate>Thu, 13 Jan 2011 12:57:04 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=148</guid>
		<description><![CDATA[Integrate a Wordpress blog into your CFML app, with functions to pull posts and comments from the Wordpress database, and embed CFM templates directly in your Wordpress theme.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html" rel="bookmark" title="Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC">Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC </a> <small>CFC to easily pull in and cache multiple Twitter feeds....</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/new-site-live-1.html" rel="bookmark" title="New site live&#8230; Vertical rhythm FTW!">New site live&#8230; Vertical rhythm FTW! </a> <small>After many sleepless nights, the new Simian Enterprises site is...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/if-coldfusion-is-dead-its-adobe-that-killed-it-118.html" rel="bookmark" title="If ColdFusion is dead, it&#8217;s Adobe that killed it.">If ColdFusion is dead, it&#8217;s Adobe that killed it. </a> <small>You can't call yourself a CFML developer unless you have...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Lately I&#8217;ve been working on a few ColdFusion apps that require a comprehensive blog system. While I could easily install Mango Blog or Blog CFC, nothing really rivals the functionality of WordPress when it comes to blog apps &#8211; but of course, WordPress is a PHP based system.</p>
<p>Installing WordPress alongside a ColdFusion app isn&#8217;t too difficult, but I need to customise the blog so that it looks identical to the rest of the site, and allow the user to switch seamlessly between the two.</p>
<p>This level of integration requires two main bits of functionality. Firstly I need to use ColdFusion to connect to the WordPress database and pull out articles and comments for use in summary blocks around the rest of the site, and secondly I need to be able to embed CFML templates directly into the WordPress blog to generate headers and footers whilst keeping any session based information such as login status, cart contents etc. &#8211; Essentially I need a CFINCLUDE equivalent for PHP.</p>
<p><span id="more-148"></span></p>
<h2>Using ColdFusion to pull in WordPress content</h2>
<p>I created a few components to pull data from a WordPress database. One to grab published articles, one to grab approved comments and one to remove any formatting and strip out extra HTML such as embedded images or videos.</p>
<p>The components are fairly self explanatory, and for the moment provide only basic functionality. It would be possible to build on these to provide greater integration, but for now these do the job nicely.</p>
<h3>Pull published blog posts</h3>
<pre>
&lt;cffunction name=&quot;getBlogPosts&quot; access=&quot;public&quot; returntype=&quot;query&quot; hint=&quot;Pulls published blog posts from a wordpress database (Tested in 2.7)&quot;&gt;
    &lt;cfargument name=&quot;sDSN&quot; type=&quot;string&quot; required=&quot;yes&quot; hint=&quot;Datasource name assigned to the WordPress database&quot; /&gt;
	&lt;cfargument name=&quot;ID&quot; type=&quot;numeric&quot; default=&quot;0&quot; hint=&quot;Blog post ID - Leave blank to pull all published posts&quot; /&gt;
    &lt;cfargument name=&quot;iLimit&quot; type=&quot;numeric&quot; default=&quot;0&quot; hint=&quot;Limit the number of posts to pull back&quot; /&gt;
	
	&lt;!--- Get blog posts ---&gt;
	&lt;cfquery name=&quot;Local.qGetBlogPosts&quot; datasource=&quot;#Arguments.sDSN#&quot;&gt;
		SELECT		wp_posts.*
		FROM		wp_posts

		WHERE		0 &lt; 1
		
		&lt;cfif Arguments.ID NEQ 0&gt;
			AND		wp_posts.ID = &lt;cfqueryparam value=&quot;#Arguments.ID#&quot; cfsqltype=&quot;CF_SQL_INTEGER&quot; /&gt;
		&lt;/cfif&gt;
        
        AND			wp_posts.post_type = &quot;post&quot;
        
        AND 		wp_posts.post_status = &quot;publish&quot;
        
        ORDER BY	wp_posts.post_date DESC
        
        &lt;cfif Arguments.iLimit GT 0&gt;
        	LIMIT #Arguments.iLimit#
		&lt;/cfif&gt;
        
		;
	&lt;/cfquery&gt;

	&lt;cfscript&gt;
		// Return the query object
		return Local.qGetBlogPosts;
	&lt;/cfscript&gt;

&lt;/cffunction&gt;


</pre>
<h3>Pull approved comments</h3>
<pre>

&lt;cffunction name=&quot;getComments&quot; access=&quot;public&quot; returntype=&quot;query&quot; hint=&quot;Pulls approved comments from a wordpress database (Tested in 2.8)&quot;&gt; 
    &lt;cfargument name=&quot;sDSN&quot; type=&quot;string&quot; required=&quot;yes&quot; hint=&quot;Datasource name assigned to the WordPress database&quot; /&gt;
	&lt;cfargument name=&quot;iCommentID&quot; type=&quot;numeric&quot; default=&quot;0&quot; hint=&quot;Comment ID - use to pull back a specific comment record&quot; /&gt;
	&lt;cfargument name=&quot;iPostID&quot; type=&quot;numeric&quot; default=&quot;0&quot; hint=&quot;Post ID - Use to pull back all approved comments from a specific post&quot; /&gt;
    &lt;cfargument name=&quot;iLimit&quot; type=&quot;numeric&quot; default=&quot;0&quot; hint=&quot;Limit the number of comments pulled back&quot; /&gt;

	
	&lt;!--- Get comments ---&gt;
	&lt;cfquery name=&quot;Local.qGetBlogComments&quot; datasource=&quot;#Arguments.sDSN#&quot;&gt;
		SELECT		wp_comments.*,
        			wp_posts.post_name,
                    wp_posts.ID,
                    wp_posts.post_type,
                    wp_posts.post_status,
					wp_posts.post_title
                    
		FROM		wp_comments

		INNER JOIN	wp_posts
        ON			wp_comments.comment_post_ID = wp_posts.ID

		WHERE		0 &lt; 1
		
		&lt;cfif Arguments.iCommentID NEQ 0&gt;
			AND		wp_comments.comment_ID = &lt;cfqueryparam value=&quot;#Arguments.iCommentID#&quot; cfsqltype=&quot;CF_SQL_INTEGER&quot; /&gt;
		&lt;/cfif&gt;
        
		&lt;cfif Arguments.iPostID NEQ 0&gt;
			AND		wp_comments.comment_post_ID = &lt;cfqueryparam value=&quot;#Arguments.iPostID#&quot; cfsqltype=&quot;CF_SQL_INTEGER&quot; /&gt;
		&lt;/cfif&gt;      

        AND			wp_comments.comment_approved = 1

        AND			wp_posts.post_type = &quot;post&quot;
        
        AND 		wp_posts.post_status = &quot;publish&quot;
        
        ORDER BY	wp_comments.comment_date DESC
        
        &lt;cfif Arguments.iLimit GT 0&gt;
        	LIMIT #Arguments.iLimit#
		&lt;/cfif&gt;
        
		;
	&lt;/cfquery&gt;

	&lt;cfscript&gt;
		// Return the query object
		return Local.qGetBlogComments;
	&lt;/cfscript&gt;

&lt;/cffunction&gt;


</pre>
<h3>Strip HTML from posts</h3>
<p>This function uses the &#8216;TagStripper&#8217; custom tag by Rick Root / Ray Camden, available from http://www.cflib.org</p>
<pre>

&lt;cffunction name=&quot;unformatPost&quot; output=&quot;no&quot; hint=&quot;Removes HTML from the string&quot; access=&quot;public&quot; returntype=&quot;string&quot;&gt;
	&lt;cfargument name=&quot;sString&quot; type=&quot;string&quot; required=&quot;Yes&quot; hint=&quot;Data to strip HTML from - pass the post contents here&quot; /&gt;
	&lt;cfargument name=&quot;bShowSummary&quot; type=&quot;boolean&quot; default=&quot;0&quot; hint=&quot;If you use the &#039;more&#039; tag to split posts into summary and content, set this flag to pull back the summary only&quot; /&gt;    

	&lt;cfinclude template=&quot;/customTags/tagStripper.cfm&quot; /&gt;

	&lt;cfscript&gt;
		// If we&#039;re only showing a summary, strip out everything after wordpress&#039; &#039;&lt;!--more--&gt;&#039; tag.
		if (Arguments.bShowSummary) {
			Arguments.sString = REReplace(Arguments.sString, &quot;&lt;!--more--&gt;.*&quot;, &quot;&quot;);
		}
		
		// Stip out any HTML tags and return the output
		return tagStripper(Arguments.sString,&#039;strip&#039;,&#039;p,strong,em,a&#039;);
	&lt;/cfscript&gt;
    
	
&lt;/cffunction&gt;
</pre>
<h2>Embedding CFM templates into WordPress / PHP</h2>
<p>I don’t know a great deal about PHP, but I can’t find any equivalent to CFINCLUDE – even if I could it would be safe to assume that the PHP version wouldn’t be able to parse the CFML code contained in my CFM pages – what’s needed is some equivalent to CFHTTP that can hit the CFM page as a standard HTTP request, let the CFML server parse the code and return HTML that is then displayed within the PHP template.</p>
<p>Currently I’m using a function in PHP which wraps around ‘fsockopen’ to do exactly this. I found this function a while ago on another project – I’m not sure who wrote it.</p>
<pre>
&lt;?php
 function fetchURL( $url ) {
   $url_parsed = parse_url($url);
   $host = $url_parsed&amp;#91;&quot;host&quot;&amp;#93;;
   $port = $url_parsed&amp;#91;&quot;port&quot;&amp;#93;;
   if ($port==0)
       $port = 80;
   $path = $url_parsed&amp;#91;&quot;path&quot;&amp;#93;;
   if ($url_parsed&amp;#91;&quot;query&quot;&amp;#93; != &quot;&quot;)
       $path .= &quot;?&quot;.$url_parsed&amp;#91;&quot;query&quot;&amp;#93;;

   $out = &quot;GET $path HTTP/1.0\r\nHost: $host\r\n\r\n&quot;;

   $fp = fsockopen($host, $port, $errno, $errstr, 30);

   fwrite($fp, $out);
   $body = false;
   while (!feof($fp)) {
       $s = fgets($fp, 1024);
       if ( $body )
           $in .= $s;
       if ( $s == &quot;\r\n&quot; )
           $body = true;
   }
 
   fclose($fp);
 
   return $in;
} 
  
 ?&gt;
</pre>
<p>With that function set up at the top of the php template, you can use the following code to embed a parsed CFM template.</p>
<pre>
echo fetchURL(http://pathto.your.cfm);
</pre>
<p>Now the only issue remaining is session data. As it’s the PHP server hitting your CFML template and not the user’s browser, the ColdFusion server is assigning a new session to PHP, and so any session specific data such as the contents of the user’s cart or login status, is lost in the displayed page.<br />
So to combat this, we’ll need to check the user’s browser for a session cookie using PHP, and pass that along as a URL parameter to the CFML template.</p>
<pre>
&lt;?php
	$sURL = &quot;http://pathto.your.cfm?CFID=&quot; . $_COOKIE&amp;#91;&#039;CFID&#039;&amp;#93; . &quot;&amp;CFTOKEN=&quot; . $_COOKIE&amp;#91;&#039;CFTOKEN&#039;&amp;#93;;
	echo fetchURL($sURL);
?&gt;
</pre>
<p>Now we should find that the contents of the CFML page is parsed correctly, using the current CF session.</p>
<p>It’s worth noting that while this technique could be used to pull in your CFML header and footer template, providing a quick way to skin the blog without delving too deeply into the WordPress theme you’re using, this is not the ideal way to go. WordPress themes use variables in the head section of the document to deal with Meta information and other internal functionality, and these often provide hooks for WordPress plugins. If you replace this information with parsed HTML from your CFML templates, you may run into difficulties down the line.<br />
A better method is to abstract individual elements of your site into separate CFML templates, and allow WordPress to create the finished page, pulling in elements where needed.</p>
<p>I’d love to hear what people think of these techniques and if anyone has a better way of integrating WordPress into their ColdFusion apps. Specifically, I’d be interested to know if anyone has combined the login functionality of WordPress with their CFML system – the holy grail, if you will!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html" rel="bookmark" title="Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC">Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC </a> <small>CFC to easily pull in and cache multiple Twitter feeds....</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/new-site-live-1.html" rel="bookmark" title="New site live&#8230; Vertical rhythm FTW!">New site live&#8230; Vertical rhythm FTW! </a> <small>After many sleepless nights, the new Simian Enterprises site is...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/if-coldfusion-is-dead-its-adobe-that-killed-it-118.html" rel="bookmark" title="If ColdFusion is dead, it&#8217;s Adobe that killed it.">If ColdFusion is dead, it&#8217;s Adobe that killed it. </a> <small>You can't call yourself a CFML developer unless you have...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Cache and display multiple Twitter feeds in ColdFusion &#8211; CFC</title>
		<link>https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html#comments</comments>
		<pubDate>Fri, 19 Nov 2010 04:09:16 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=131</guid>
		<description><![CDATA[CFC to easily pull in and cache multiple Twitter feeds.<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve worked on a few sites recently that have required Twitter feeds to be pulled in and displayed on the homepage.<br />
Thanks to the awesome &lt;cffeed&gt; tag this is a relatively easy task, but I&#8217;ve noticed a bit of an overhead when pulling the data in from Twitter&#8217;s servers.</p>
<p>I had a look around and came across <a title="Simon Bingham's post on Caching CFFeed" href="http://simonbingham.posterous.com/caching-cffeed">this post by Simon Bingham</a>, showing how to cache the results of a Twitter feed in the Application scope.</p>
<p>This worked well, but I needed to be able to pull in both outgoing tweets (using the Twitter ID) and incoming tweets (using a search string). This meant not only updating the CFC to take both types of argument and act accordingly, but also to allow mutiple feeds to be cached.<br />
Building on Simon&#8217;s original, I&#8217;ve created a new CFC that does just that, and even has a bit of error handling for good measure.</p>
<p><span id="more-131"></span></p>
<pre>
&lt;cffunction name=&quot;getTweets&quot; access=&quot;public&quot; returntype=&quot;query&quot; hint=&quot;Pulls contents of a Twitter feed by ID or search string, and caches results in the Application scope&quot;&gt;
	&lt;cfargument name=&quot;sTwitterString&quot; type=&quot;string&quot; required=&quot;yes&quot; hint=&quot;Pass a Twitter ID or search string&quot; /&gt;
	&lt;cfargument name=&quot;iType&quot; type=&quot;numeric&quot; required=&quot;yes&quot; hint=&quot;Select type of query - 1 = Twitter ID, 2 = Search string&quot; /&gt;
	&lt;cfargument name=&quot;iCachedFor&quot; type=&quot;numeric&quot; default=&quot;60&quot; hint=&quot;How long to cache results&quot; /&gt;
	&lt;cfargument name=&quot;sStructureName&quot; type=&quot;string&quot; default=&quot;defaultCache&quot; hint=&quot;Choose a name for the cached structure, to allow for multiple sets of cached data to be stored&quot; /&gt;

	&lt;!--- First we want to check there&#039;s a structure to hold our cached tweets ---&gt;
	&lt;cfif NOT StructKeyExists(Application, &#039;stTwitterFeedCache&#039;)&gt;	
		&lt;!--- Lock the Application scope ---&gt;
		&lt;cflock scope=&quot;Application&quot; timeout=&quot;60&quot; type=&quot;exclusive&quot;&gt;
			&lt;!--- Create structure ---&gt;
			&lt;cfset Application.stTwitterFeedCache = {} /&gt;			
		&lt;/cflock&gt;
	&lt;/cfif&gt;

	&lt;!--- If no structure exists in application scope, or if the structure exists, but is older than the &#039;CachedFor&#039; setting ---&gt;	
	&lt;cfif NOT StructKeyExists(Application.stTwitterFeedCache, &#039;#Arguments.sStructureName#&#039; ) OR DateDiff( &quot;n&quot;, Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93;.dtCreated, Now() ) GT Arguments.iCachedFor&gt;

		&lt;!--- Lock the Application scope ---&gt;
		&lt;cflock scope=&quot;Application&quot; timeout=&quot;60&quot; type=&quot;exclusive&quot;&gt;

			&lt;!--- Create the application structure ---&gt;
			&lt;cfset Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93; = {} /&gt;
			
			&lt;!--- Pull the feed in, wrap in a cftry block ---&gt;
			&lt;cftry&gt;

				&lt;!--- Choose the feed source based on the query type selected ---&gt;
				&lt;cfif Arguments.iType EQ 1&gt;
					&lt;cffeed source=&quot;http://twitter.com/statuses/user_timeline/#Arguments.sTwitterString#.rss&quot; properties=&quot;feedmeta&quot; query=&quot;Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93;.data&quot; /&gt;
				&lt;cfelseif Arguments.iType EQ 2&gt;
					&lt;cffeed source=&quot;http://search.twitter.com/search.atom?q=#Arguments.sTwitterString#&quot; properties=&quot;feedmeta&quot; query=&quot;Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93;.data&quot; /&gt;
				&lt;cfelse&gt;

					&lt;!--- Incorrect query type---&gt;
					&lt;cfscript&gt;
						Application.stTwitterFeedCache[Arguments.sStructureName].data = QueryNew(&quot;Error&quot;);
						newRow = QueryAddRow(Application.stTwitterFeedCache[Arguments.sStructureName].data);
						QuerySetCell(Application.stTwitterFeedCache[Arguments.sStructureName].data, &quot;Error&quot;, &quot;Invalid query type entered. Please choose 1 for a Twitter ID, or 2 for a Search string.&quot;);
					&lt;/cfscript&gt;

				&lt;/cfif&gt;

				&lt;!--- Catch any errors with the feed ---&gt;
				&lt;cfcatch type=&quot;any&quot;&gt;

					&lt;cfscript&gt;
						Application.stTwitterFeedCache[Arguments.sStructureName].data = QueryNew(&quot;Error&quot;);
						newRow = QueryAddRow(Application.stTwitterFeedCache[Arguments.sStructureName].data);
						QuerySetCell(Application.stTwitterFeedCache[Arguments.sStructureName].data, &quot;Error&quot;, &quot;Unable to pull in feed. We all know ColdFusion is awesome, so it&#039;s probably Twitter&#039;s fault.&quot;);
					&lt;/cfscript&gt;

				&lt;/cfcatch&gt;

			&lt;/cftry&gt;

			&lt;!--- Update the timestamp for the data ---&gt;
			&lt;cfset Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93;.dtCreated = Now() /&gt;

		&lt;/cflock&gt;

	&lt;/cfif&gt;

	&lt;!--- Return the data ---&gt;
	&lt;cfreturn Application.stTwitterFeedCache&amp;#91;Arguments.sStructureName&amp;#93;.data /&gt;

&lt;/cffunction&gt;
</pre>
<p>Feasibly, this could be adjusted to cache any kind of feed &#8211; the trick is in the dynamic naming of the structures to allow for multiple feeds.</p>
<p>Hope someone out there finds it useful!</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/cache-and-display-multiple-twitter-feeds-in-coldfusion-cfc-131.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>If ColdFusion is dead, it&#8217;s Adobe that killed it.</title>
		<link>https://www.simianenterprises.co.uk/blog/if-coldfusion-is-dead-its-adobe-that-killed-it-118.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/if-coldfusion-is-dead-its-adobe-that-killed-it-118.html#comments</comments>
		<pubDate>Wed, 15 Sep 2010 11:08:55 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Website Development]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=118</guid>
		<description><![CDATA[You can't call yourself a CFML developer unless you have a CF state of union style blog post, so this is mine. ;)<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html" rel="bookmark" title="Tutorial: Setting up a production Windows 2008 server with IIS7 &amp; Railo">Tutorial: Setting up a production Windows 2008 server with IIS7 &#038; Railo </a> <small>A complete beginner's step by step guide to setting up...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html" rel="bookmark" title="Combatting misinformation in web design">Combatting misinformation in web design </a> <small>I received an email from a client recently, informing me...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h3>(Or, &#8216;Controvertial ColdFusion post #34124&#8242;)</h3>
<p>I&#8217;ve been using ColdFusion happily for the last 6 years. I can honestly say that if it weren&#8217;t for the ease of learning ColdFusion, and the instant gratification to be gained from rapidly developing apps that interact with databases, I&#8217;d have never found my way into backend development.</p>
<p>Like any language however, ColdFusion is not without its problems. We can compare functionality until the proverbial cattle return to their domiciles, but what I&#8217;d like to talk about is the culture of elitism that surrounds ColdFusion.</p>
<p><em>&#8216;Elitism?!&#8217; </em>I hear you cry, <em>&#8216;But ColdFusion is so easy to pick up, and the community is so friendly and welcoming! That&#8217;s hardly elitist, is it?&#8217;</em>.</p>
<p>Yes. You&#8217;re right&#8230; but what I&#8217;m concerned with is the difficulty ColdFusion developers face in the environment in which they work. Adobe have done a very good job of making ColdFusion inaccessible to the masses by focussing on enterprise clients, inadvertently turning ColdFusion into quite an exclusive club.<br />
Don&#8217;t believe me? Reel off the names of some well known ColdFusion celebrities&#8230; Ray Camden, Ben Nadel, Ben Forta, Et al. I&#8217;ll bet if you&#8217;re a ColdFusion developer, you&#8217;ll know who those people are. You&#8217;ll have read their blog posts, be aware of projects they&#8217;ve done. You&#8217;ll probably be able to list 10 more without too much trouble&#8230;<br />
Well, you shouldn&#8217;t be able to do that &#8211; because the list should be huge. If we were talking about PHP, there&#8217;d be maybe 5,000 people in that list. In ColdFusion there&#8217;s maybe 20.</p>
<p>Let me explain&#8230;<span id="more-118"></span><br />
I&#8217;m a freelance web developer, who happens to favour ColdFusion as my back end language of choice. It should be as simple as deciding which language is right for the task, or which you feel most comfortable using, but with ColdFusion there&#8217;s more to consider.<br />
First and foremost, I have to think about hosting the websites I create. If I were a PHP developer, I&#8217;d have the pick of pretty much any host you can think of. Hundreds of thousands of web hosting companies the world over and every single one of them offer PHP as standard with all their packages, right? For us ColdFusion developers though, it&#8217;s a much tougher choice. We have to find hosting companies that specifically cater to ColdFusion developers. Not an easy task. I&#8217;ve had accounts with ColdFusion hosting companies both here and in the US, and in my experience they&#8217;ve nearly all been so unreliable as to be detrimental to my business and reputation. It&#8217;s an issue we all face and I&#8217;ve had numerous conversations with other ColdFusion developers on the subject; finding a reliable ColdFusion hosting company is difficult. It&#8217;s a case of getting what you pay for, and a reliable CF host costs far more than a reliable PHP host, because a CF license is expensive for a hosting company to invest in.</p>
<h2>CFML Developer = Part time sysadmin</h2>
<p>The conclusion most of us come to eventually, is that it&#8217;s far easier to host our sites ourselves, getting a dedicated server or VPS with a reliable host, and installing ColdFusion onto it.<br />
Now, aside from the huge cost of a ColdFusion licence, what this means for us is that nearly every ColdFusion developer has to have a sideline as a sysadmin. I&#8217;ve learned from experience that being a good sysadmin is a full time job on its own. This means there are a bunch of novice sysadmins out there, running their own servers through necessity &#8211; novice sysadmins mean insecure systems. Before you know it, we have &#8216;<em>ColdFusion is insecure</em>&#8216; rumours floating about the web. Just what we need.</p>
<p>What this also means is less choice for our clients. With every new client, I have to have the same conversation: &#8220;<em>I need to let you know that if you take up my services, we will need to move your site to another hosting company, or host the site on my own servers</em>&#8220;. This isn&#8217;t so much of a problem for enterprise clients, but at my end of the scale, speaking to small companies with even smaller budgets and a knowledge of how the web works that is even smaller still, these words are strange and daunting and often a dealbreaker.</p>
<p>Most of my clients have never heard of ColdFusion. They&#8217;ve never heard of PHP either, but wheras with a PHP developer they could continue to live in blissful ignorance, with a ColdFusion based solution they will quickly learn that ColdFusion requires a hefty licence fee or at least more expensive hosting.</p>
<p>The situation gets worse too, because apparently ColdFusion cannot reliably be run in a shared hosting environment. &#8220;<em>What?? That&#8217;s ridiculous!!!</em>&#8221; Yes it is, and I would never have thought it were it not for a conversation I was having recently with Andy Allan of Fuzzy Orange. (We all know who he is too, right? See? CF&#8230; good if you want to be famous, bad if you want an easy life.) All this time I was thinking that most CF hosting companies were complete morons, incapable of offering a reliable service, but in fact it seems that they&#8217;re at a disadvantage right from the beginning because CF Enterprise sandboxing has numerous problems that plague the everyday plight of the sysadmin.</p>
<p>Now, it&#8217;s my contention that if this is the case, it should be a <em>huge</em> priority for Adobe, but apparently it&#8217;s not.</p>
<h2>The big picture</h2>
<p>ColdFusion is less used than PHP and ASP. That&#8217;s a fact. I&#8217;ve heard a million arguments about enterprise users and fortune 500 companies, etc. We as a community are constantly battling against the &#8216;Coldfusion is Dead&#8217; bullshit and frankly, I&#8217;m with you guys. It&#8217;s very much alive, very much out there and being used all over the place&#8230; great, but you can&#8217;t deny that PHP is the most widely used back end language.</p>
<p>This has a knock-on effect for us. It makes it more difficult to sell ColdFusion as a solution to clients. It&#8217;s easy for our competition to mis-inform. I&#8217;ve lost clients to PHP because of higher hosting costs, I&#8217;ve even lost a client to an SEO cowboy who <a title="Misinformation in web design" href="http://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html">claimed that ColdFusion was &#8216;Bad for SEO&#8217;</a>.  The fact is that ColdFusion is less known and less used than the free alternatives, and we as a community are constantly trying to raise awareness, spread the word and in many cases, defend our beloved language.</p>
<p>How exactly can we make ColdFusion more prevalent when so few hosting companies offer it as an option? How can we encourage new developers towards CFML, when they&#8217;ll also need to learn about how to set up and manage servers in order to use it reliably?<br />
The answer I usually hear is that if there&#8217;s enough demand for ColdFusion, then bigger hosting companies will offer it as a service. But that&#8217;s a chicken / egg argument. How will the demand grow, unless it&#8217;s there as an option for the masses? How many PHP developers began their learning solely because they needed to update or configure a PHP app they were using such as WordPress or PHPBB. Why are there no real CF &#8216;killer apps&#8217; like WordPress and PHPBB?</p>
<p>The way I see it, CF will remain mostly at enterprise level, behind the scenes, until such time as it comes as standard with many, many more hosting packages. And this won&#8217;t happen as long as it&#8217;ll cause a support headache for the big hosting companies. We can all argue about the price of CF, but that&#8217;s not really the concern for the big hosts, they can get bulk discounts anyway&#8230; their problem is that if they offer CF in a shared hosting environment, they will have reliability problems, and will eventually have someone like me announcing to the world that they&#8217;re a bunch of useless wankers.</p>
<h2>Railo to the rescue!</h2>
<p>Sure, I know there are a lot of people out there who will tell me that <a title="Railo" href="http://getrailo.org">Railo</a> is the answer to all of this. It&#8217;s free, it&#8217;s fast, it&#8217;s open source and the community are great. I agree on all counts, and indeed I&#8217;m now offering reliable hosting to my clients with my own servers running  Railo. Brilliant.<br />
But it&#8217;s not the answer to everything.</p>
<p>Firstly, Railo has only really come into its own, at least in my opinion, over the last year. About 18 months ago I tried to make the move to Railo and there were just too many bugs and inconsistencies for it to be a viable solution. It simply wasn&#8217;t capable of running my apps, or at least not without some serious reworking of a lot of functionality. V3.1.2.001 has changed all that, and it&#8217;s now able to handle damn near everything I throw at it &#8211; but it still contains bugs. The Railo community are great and bugs, once identified, are fixed quickly &#8211; but this means that I as a developer have to spend some of my time testing &amp; reporting. Sometimes I run into a brick wall with something I&#8217;m working on, and have to wait for a fix from the Railo team before I can move forward with it. That&#8217;s fine, it&#8217;s the nature of open source and I&#8217;m very happy to be contributing to the project, finding issues in a live real-world environment &#8211; but it&#8217;s still unpaid man-hours that I wouldn&#8217;t have to deal with, were I using Adobe ColdFusion.</p>
<p>Secondly, while there are community members out there doing great work on installer projects, posting tutorials and the like, there&#8217;s still a much steeper learning curve in the setup of Railo compared to ColdFusion. What you&#8217;re rewarded with is a <em>much</em> faster CFML engine, Railo&#8217;s lighting fast compared to ACF, but the point I&#8217;ve been making throughout this post rant is that I don&#8217;t <em>want</em> to be a sysadmin, I don&#8217;t want to have to learn about application servers and web servers, I just want to code bloody CFML!</p>
<h2>What&#8217;s the answer?</h2>
<p>Hell, I don&#8217;t know&#8230; but it occurs to me that the CF community is fighting a constant war against misinformation, defending CFML to clients and colleagues alike. The community as a whole seems to want to raise awareness of ColdFusion, and if indeed this is the case, then I think Adobe needs to take a serious look at who they&#8217;re aiming at.<br />
As Andy pointed out, most of Adobe&#8217;s CF customers are enterprise, so they may not see hosting companies as a big sales generator&#8230; but it never will be be unless the sandboxing issues are resolved. Meanwhile, it&#8217;s people like us who suffer. This isn&#8217;t a concern if you&#8217;re a CF developer working in a bluechip traded company with a huge IT budget, but if you&#8217;re a freelance developer with a love of ColdFusion, this should <em>matter</em> to you and I think it&#8217;s time Adobe looked at the big picture &#8211; A lack of reliable CF hosts is a barrier to entry, which means less CF developers in the wild, and a harder time for those already out there.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html" rel="bookmark" title="Tutorial: Setting up a production Windows 2008 server with IIS7 &amp; Railo">Tutorial: Setting up a production Windows 2008 server with IIS7 &#038; Railo </a> <small>A complete beginner's step by step guide to setting up...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html" rel="bookmark" title="Combatting misinformation in web design">Combatting misinformation in web design </a> <small>I received an email from a client recently, informing me...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/if-coldfusion-is-dead-its-adobe-that-killed-it-118.html/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Tutorial: Setting up a production Windows 2008 server with IIS7 &amp; Railo</title>
		<link>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html#comments</comments>
		<pubDate>Tue, 29 Jun 2010 11:14:39 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=96</guid>
		<description><![CDATA[A complete beginner's step by step guide to setting up a production Windows 2008 server, running the awesome Railo on multiple sites.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Prologue:</h2>
<p><em><strong>In which Gary explains his new found appreciation for anyone who calls themselves a sysadmin.</strong></em></p>
<p>I’m not a sysadmin. I like to make websites. It’s what I do, what I’ve always done.<br />
Dealing with servers is the un-planned love child of my long term affair with website development. A horrid child that demands constant attention and gives nothing back in return.</p>
<p>In the past, I would point clients in the direction of a decent web host and let them get on with it, but as it turns out these clients would still phone me as the first point of contact when their servers went down, making me a mediator between them and their hosts. Frankly, I figured if I’m spending my time doing this anyway, I may as well get paid into the bargain.</p>
<p>Well, after four years of hosting client’s websites I can quite categorically state that sysadmins have one of the most difficult jobs imaginable. Anything can go wrong, at any time. Running a tight system involves research, dedication, and genuine enjoyment of high level tinkering.</p>
<p>If I’m ever in a position to employ a sysadmin, they will be treated well. I will make them tea. And cake. And give them sympathy.<br />
Recently, after a long and gruelling battle with the most <a title="Unreliable hosting" href="http://www.cwcs.co.uk">unreliable hosting company</a> I&#8217;ve ever used, I finally took the plunge and set up my own Windows VPS using IIS7 &amp; <a title="Open Source CFML Engine" href="http://www.getrailo.org/">Railo</a>.<span id="more-96"></span></p>
<h2>The decision making process:</h2>
<p><strong><em>In which Gary explains and attempts to defend, his reasoning.</em></strong></p>
<p><em>&#8220;Why use IIS?!&#8221;</em> I hear you scream at your monitors, which proves that I do in fact possess super-human hearing abilities&#8230; Well, as I’ve taken great pains to explain, I am not a sysadmin. Years ago I ran a linux server that was hacked to pieces because I didn’t know enough about securing said system.</p>
<p>Windows and IIS, for all its faults &#8211; and there are a great many – is a GUI based system. What this means in the real world is that there’s an icon for everything. So, as a non sysadmin trying to setup and run a server, having an icon for every conceivable thing I’d want to do, serves to actually <em>indicate</em> what I might want to do in a way that a collection of config files simply doesn’t.</p>
<p>Also, having used it for a while now, I have to say that IIS7 isn’t half bad. It’s a damn sight better than IIS5 and IIS6, both of which I’ve had the dubious pleasure of using during the course of my career. Also, Server 2008 is a lot nicer than previous incarnations. Sitting here typing this post in Word 2007, on Windows 7, talking about Server 2008, I have to say that Microsoft seem to be taking an interest in user experience. They’re a long way off Apple, but they’re finally doing something half decent. Well done them.</p>
<p><em>&#8220;So why Railo?&#8221;</em><br />
Well, initially this was an issue of cost. Frankly I can’t afford to shell out for an enterprise CF licence. I’m not a big company, I’m one man making awesome websites for very small companies. So I thought I’d give open source a go, and see how it compares.</p>
<p>I have to say I tried Railo about a year ago and found that it was lacking in too many places to be a viable solution. There were a few tags missing, a few things it just seemed to handle differently, and given that my sites generally like to nudge a few boundaries, it just wasn’t up to the task.</p>
<p>Well, all that has changed. Railo this time around was an absolute pleasure. A steeper learning curve to set up compared to Adobe ColdFusion, granted, but what you’re rewarded with is a blisteringly fast ColdFusion experience, a much higher level of control over your environment, entry into a knowledgeable and welcoming community and a general feeling of wellbeing that can only be gained from <em>not</em> giving Adobe three grand of your hard earned cash.</p>
<h2>Hacking my server 101:</h2>
<p><strong><em>In which Gary, in an attempt to offer help to others in a similar situation, provides a step by step guide to the setup of his production server, and hopes that malicious people don’t use it to bring the thing crashing to its knees.</em></strong></p>
<h3>In the beginning, there was the welcome screen and the server was without services.</h3>
<p>So, let’s assume that you’ve got yourself a nice sparkling new Windows 2008 server/vps set up.<br />
Depending on how your hosting company has set this up, you may need to install various Windows updates, so it’s best you do this before anything else. Go to Windows update. Go directly to Windows update. Do not pass go, do not collect $200.<br />
Usually I’d advocate installing Anti-Virus software next, but bitter experience tells me it’s best to install that at the end, after installing the various components we’ll need to get the server working.</p>
<h3>And the sysadmin said, “Let there be services, and let the server use them to serve pages to the masses”.</h3>
<h4><strong>Roles:</strong></h4>
<p>Firstly you&#8217;ll need to install IIS and various roles. I’m not any kind of an expert on this, so I won’t suggest which roles are right for you. Best practice as I understand it, is to only install what you need for the task at hand, thus minimising the chance of attack.</p>
<p>I’m using Windows 2008 Web Edition, which comes with literally nothing but IIS. If you’ve got a better version of 2008, you may want to install the DNS role, email, any number of others. Go wild, have fun.</p>
<p>One way or another you’ll need to install all the IIS6 roles, as well as the IIS management role.</p>
<h4><strong>Email:</strong></h4>
<p>I’m using <a title="Mail Enable" href="http://mailenable.com/default.asp">MailEnable</a>, basically because it’s free and does the job. When I spoke to my new hosting company about this, they strongly suggested trying ‘<a title="SmarterMail" href="http://www.smartertools.com/smartermail/mail-server-software.aspx">SmarterMail</a>’ as a better alternative. Give them a look and make a decision.<br />
Guides to install MailEnable are here:<br />
<a title="Mail Enable Installation Guide" href="http://www.mailenable.com/support/MailEnable_Installation_Guide.pdf">http://www.mailenable.com/support/MailEnable_Installation_Guide.pdf</a><br />
<a title="Mail Enable Quick Start Guide" href="http://www.mailenable.com/support/MailEnable_Quick_Start_Guide.pdf">http://www.mailenable.com/support/MailEnable_Quick_Start_Guide.pdf</a></p>
<p>You’ll need to open ports on your firewall to enable&#8230; umm&#8230; MailEnable&#8230; so don’t forget. This includes Windows Firewall as well as any hardware firewall you may have set up.<br />
<strong>Incoming: 110 &amp; 25</strong><br />
<strong>Outgoing: 25</strong></p>
<h4><strong>DNS:</strong></h4>
<p>If you want to use your server as a nameserver, (and frankly, if you need to read this tutorial to set up a production server, you’re unlikely to be the kind of person who’ll have a separate DNS server, so I’m talking to you!) you’ll need some kind of DNS service.</p>
<p>I’m using the cut down cheap-ass ‘Web Server Edition’ of 2008 server for which Microsoft have deemed fit to not include DNS services. So, like most of the planet, I’m using Bind.<br />
It’s fiddly to get your head around if you’re unfamiliar with the concepts of DNS, but once you get the hang of what’s happening it’s all very straight forward.<br />
Take a look at this tutorial: <a title="BIND for Windows tutorial" href="http://alex.charrett.com/bind-on-windows-mainmenu-3">http://alex.charrett.com/bind-on-windows-mainmenu-3</a></p>
<p>You’ll also need to register your domain with the nameserver authority – or more accurately you’ll need to get your domain registrar to do this. A lot of registrars have an automated section in their control panels where you can do this. Others you’ll have to email. But basically, you need to have a domain name pointing to your IP address on the main database of nameservers. This usually takes about 24 hours.</p>
<p>You’ll also need to open your firewall up for BIND services:<br />
<strong>Port 53, inbound and outbound, both TCP and UDP</strong></p>
<h4><strong>FTP:</strong></h4>
<p>Initially, I thought it best to use the IIS built in FTP 7.5&#8230; However, after much messing about I decided it wasn’t up to the task.<br />
If, like me, you like to have a ‘private’ folder outside the webroot to keep cfcs and the like, I’d recommend ditching it for FileZilla server.<br />
I’ve left instructions for FTP 7.5 here for posterity.</p>
<p><strong>FTP 7.5</strong><br />
Windows server 2008 has a new FTP module, FTP 7.5. It’s supposedly better for a million reasons, but what I like about it is you no longer have to create windows users to authenticate an FTP session. I’ve never much liked windows user permissions, gimme a username and a password and I’m happy.</p>
<p>It does take a bit of messing about to get the new user system working though. A very handy tutorial exists here:<br />
<a title="FTP with IIS7 Manager Authentication" href="http://learn.iis.net/page.aspx/321/configure-ftp-with-iis-7-manager-authentication"> http://learn.iis.net/page.aspx/321/configure-ftp-with-iis-7-manager-authentication</a></p>
<p><strong>FileZilla</strong><br />
The FileZilla server is a much nicer solution in my opinion, it works much as I’d expect an FTP server to work, and doesn’t require as much messing about with IIS users and the like.<br />
There’s not much in the way of tutorials out there, but it’s so simple to set up I’d be surprised if you need one. Nevertheless, here’s a link to one for good measure:<a title="Filezilla server on Windows" href="http://www.raymond.cc/blog/archives/2007/10/19/how-to-setup-ftp-server-on-windows/"><br />
http://www.raymond.cc/blog/archives/2007/10/19/how-to-setup-ftp-server-on-windows/</a></p>
<p>Once you’ve set that up, you’ll want to set up the firewall for FTP.<br />
That means <strong>opening up port 21</strong>, as well as enabling PASV mode with the following command:<br />
<strong>netsh advfirewall set global StatefulFtp enable.</strong></p>
<h4><strong>PHP:</strong></h4>
<p>Yeah, even though we’re coding awesomeness in CFML, there’s always going to be some client who wants to use PHP for something or other. Usually it’ll be a WordPress installation, which, I’m sorry, is just a better blogging platform than the CF offerings. There, I said it. I feel better.</p>
<p>This tutorial should guide you through the pain:<br />
<a title="Install php on IIS7 FastCGI" href="http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04"> http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04</a></p>
<h4><strong>IIS modules:</strong></h4>
<p>Personally, I found that I needed the IIS7 Administration Pack. I can’t for the life of me remember why, but I’d suggest you just install it and stop asking questions. ‘k? ‘k.<br />
<a title="IIS7 Administration Pack" href="http://www.iis.net/download/AdministrationPack">http://www.iis.net/download/AdministrationPack</a></p>
<p>The URL Rewrite module is a bit more obvious – you <em>want</em> this. It allows us IIS users to do what Apache bods have been doing happily &#8211; and somewhat smugly I’ll add – for years&#8230; Rewrite URLs using RegEx. Again, if you’re slapping WordPress on any of your domains, you’ll need this for friendly URLs.<br />
<a title="Using IIS URL Rewrite" href="http://learn.iis.net/page.aspx/460/using-url-rewrite-module">http://learn.iis.net/page.aspx/460/using-url-rewrite-module</a><br />
<a title="Download IIS URL Rewrite Module" href="http://www.iis.net/download/URLRewrite">http://www.iis.net/download/URLRewrite</a></p>
<h4><strong>Perl:</strong></h4>
<p>Well sure, no-one uses Perl anymore, but it comes in handy having it on your server. Especially if you intend to install a stats package like <a title="AWStats" href="http://awstats.sourceforge.net/">AWStats</a>. As it happens, AWStats is such a bitch to get working correctly that I wouldn’t bother, but still&#8230; Perl = good.<br />
<a title="Activestate Perl" href="http://www.activestate.com/activeperl/downloads/">http://www.activestate.com/activeperl/downloads/</a><br />
There are a few different things you may have to do to get this running on IIS7, including enabling a 32-bit application pool if your server is 64bit. Check out the instructions here:<br />
<a title="Running Perl on IIS7" href="http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx">http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx</a></p>
<h4><strong>AWStats:</strong></h4>
<p>Initially I had detailed instructions on installing AWStats here, but basically&#8230; just don’t bother. Get all your clients’ sites on Google Analytics. It’s a better package anyway. Honestly, you’ll thank me for that advice.</p>
<h4><strong>MySQL:</strong></h4>
<p>MySQL is fairly straightforward to install, but if you need a hand explaining the various options, there’s a tutorial here:<br />
<a title="Installing MySQL on IIS7" href="http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/">http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/</a></p>
<h4><strong>phpMyAdmin:</strong></h4>
<p>If you need it, now would be the time to install <a title="phpMyAdmin" href="http://www.phpmyadmin.net/">phpMyAdmin</a>.<br />
<a title="phpMyAdmin on IIS7" href="http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/">http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/</a></p>
<p>One thing this tutorial isn’t clear on, is setting up the linked-tables feature. Several comments note the error, but none show how to fix it. You need to create a database specifically for these features. Instructions here:<a title="phpMyAdmin Linked Tables" href="http://www.phpmyadmin.net/documentation/#linked-tables"><br />
http://www.phpmyadmin.net/documentation/#linked-tables</a></p>
<h3>And the sysadmin looked at the server, and saw that it was good. And the sysadmin said “Let CFML pages be served, that web developers may rapidly develop and deploy applications”.</h3>
<p>Installing <a title="Railo" href="http://www.getrailo.org/">Railo</a> on <a title="Tomcat" href="http://tomcat.apache.org/">Tomcat</a> on IIS7 with multiple sites&#8230; I could write out step by step instructions, but why re-invent the wheel? I followed an excellent tutorial by <a title="Doug Boude" href="http://www.dougboude.com">Doug Boude</a>, and you should too:<br />
<a title="Setting up Railo on IIS7" href="http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7--Part-2-of-3.cfm">http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7&#8211;Part-2-of-3.cfm</a></p>
<p>At some point, this guide will ask you to download a DLL file to connect Tomcat to Railo – the URL in the guide is out of date, but I found the DLL here: <a title="Tomcat Jakarta Binaries" href="http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/">http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/</a></p>
<p>It’s also worth noting that the guide expects you to be using version 1.2.28 of the ISAPI Redirect URL, however there is a newer version, 1.2.30 available. Do NOT use this version! It took me a while to figure out, but 1.2.30 makes everything run incredibly slowly. Don’t ask me why! I moved back down to 1.2.28 and everything worked fine.</p>
<p>One thing that this guide doesn’t mention, is how to handle default documents. You can see in the comments, a suggestion that adding ‘/*=wlb’ to the worker properties file will push all files through to Tomcat, which will indeed handle default documents. However, this will also put all static files, images, js and the like, through to Tomcat. Not only is this overkill (although I didn’t notice a performance hit), but also in my experience Tomcat has difficulty returning static files 100% of the time. I noticed certain images and JS returned as 404 errors, even though they existed.<br />
Cue a helpful bit of info supplied by the Google Railo group.<br />
<a title="Setting up default documents on IIS7 with Railo" href="http://groups.google.com/group/railo/browse_thread/thread/8706a5a4b025f393">http://groups.google.com/group/railo/browse_thread/thread/8706a5a4b025f393</a><br />
This will allow you to set up default documents the *correct* way, leaving your static files to be handled by IIS as they should be. Don’t skip this step, it’s important!</p>
<h3>And the server was able to serve CFML and the sysadmin saw that it was good. And the sysadmin said “Let there be protection, that viri may not penetrate the goodness of the server”</h3>
<p>Finally, you can install Anti Virus. I’m using McAfee, since I happen to have a copy I&#8217;m not using.<br />
Be careful to edit your preferences to ensure that not all files are being scanned – otherwise it’ll kill the server very quickly. Choose to scan files on writing to disk, and only the ‘default files plus additional’ option.<br />
You’ll also want to stop McAfee from blocking any emails sent by the server. In the access protection settings, under the rule for blocking mass email worms, add ‘Tomcat6.exe’ to the list of excluded services.</p>
<h3>And the sysadmin saw that McAfee was using way too many system resources on boot, but that it settled down after a few minutes, and the sysadmin saw that it was good enough. And the sysadmin said “Let’s make sure I don’t have to do this shit again!”.</h3>
<p>A backup system is a good idea. If you’re smart, you’re using online version control and so losing the files and files of code you’ve carefully crafted, simply isn’t an issue. If not, check out <a title="Kiln Version Control" href="http://www.fogcreek.com/kiln/">Kiln</a> or <a title="Git Hub" href="http://github.com/">Git</a>. I use Kiln and it&#8217;s an absolute pleasure. Don’t use SVN, because it’ll cause no end of hassle in the long run&#8230; and who needs a VCS subfolder in every single folder in their app anyway?</p>
<p>For MySQL, I’m using a batch script that exports every database, once a day. I built on top of the script in this guide: <a title="MySQL backup script for Windows" href="http://www.iis-aid.com/articles/how_to_guides/backing_mysql_automatically_using_batch_file">http://www.iis-aid.com/articles/how_to_guides/backing_mysql_automatically_using_batch_file</a><br />
My version only holds one backup of each database on the server per day, but FTPs them down to my dev server which holds multiple copies. Have a look here: <a title="MySQL Backup Script" href="http://www.simianenterprises.co.uk/blog/wp-content/uploads/2010/06/mysqlBackup.txt">MySQL Backup Script</a></p>
<h3>And the sysadmin looked at the server and saw that it was good. That it served CFML pages extrodinarily fast, and the sysadmin was pleased. The sysadmin rested. And was rewarded with cake.</h3>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Combatting misinformation in web design</title>
		<link>https://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html#comments</comments>
		<pubDate>Thu, 11 Mar 2010 13:40:30 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=76</guid>
		<description><![CDATA[I received an email from a client recently, informing me that they have hired someone to redevelop their entire website in php, as they have been informed by their SEO company that ColdFusion is 'bad for search engines'.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/the-uncomfortable-truth-about-seo-16.html" rel="bookmark" title="The uncomfortable truth about SEO">The uncomfortable truth about SEO </a> <small>I'm simply amazed that there are still people out there...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/where-do-they-find-the-time-45.html" rel="bookmark" title="Where do they find the time?!">Where do they find the time?! </a> <small>The web industry is so fast moving that it's all...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/jack-jill-and-hill-of-all-trades-40.html" rel="bookmark" title="Jack, Jill and Hill of all trades.">Jack, Jill and Hill of all trades. </a> <small>Specialising may be essential if you want to get picked...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I received an email from a client recently, informing me that they have hired someone to redevelop their entire website in php, as they have been informed by their SEO company that ColdFusion is &#8216;bad for search engines&#8217;.</p>
<p>Frankly, I think it&#8217;s astounding that any SEO company could make such an assertion, anyone in the industry would immediately understand just how ridiculous this statement is &#8211; but unfortunaty our clients are not experts and can only make their decisions based on the advice they receive from the people who claim to be. My clients in this case have made an informed choice, based on patently false information&#8230;</p>
<p>So I&#8217;d like to state definitively: <strong>ColdFusion has nothing whatsoever to do with SEO</strong>&#8230; Neither does php, asp, ruby, python, perl, or in fact any back end language at all&#8230;<br />
<span id="more-76"></span><br />
Search engines read the &#8216;mark-up&#8217; of a website, that is to say the HTML that anyone can see by clicking &#8216;view source&#8217; in the browser&#8230; A back end language such as ColdFusion, php or asp, will generate HTML mark-up according to the templates that have been coded by a developer. It is entirely possible for any of these back end languages to generate identical mark-up.<br />
My clients in this case have paid to have their website recoded, but the HTML produced will be exactly the same as their existing website and so their search engine results will be completely unaffected&#8230; In fact, since the file extensions will change on every page, many incoming links will no longer work, so unless their new developer puts 301 redirects in place, they will most likely drop in the rankings.</p>
<p>As a developer working primarily with ColdFusion, it&#8217;s easy to feel angry that my clients have been mislead into believing that the work I have done for them is somehow inferior because of the language used, and indeed if I knew the name of the SEO company involved I would be in contact with them directly to argue the issue as well as naming them here&#8230; But what&#8217;s worrying is that it&#8217;s really the clients that are suffering. Through ignorance of how the Internet works, they have been led down a route that is both costly and futile, by a company that either has no knowledge of their own industry, or even more worrying, is ruthless enough to take advantage of the ignorance of their clients.</p>
<p>I only want what&#8217;s best for the people I work for. I want their sites to work well, to become popular, to generate revenue &#8211; and I try to give the best advice I can to help clients understand what can be<br />
gained from their web presence. I&#8217;m sure we all do&#8230; But in a technical industry such as ours, one that combines so many different disciplines, one that every virtually every business needs to interact<br />
with and yet very few understand, how can we combat misinformation like this?</p>
<p>The average client doesn&#8217;t need or want to understand how the Internet works. Mention CSS, JavaScript, back end software, web standards, etc. to the average client and they will at best, stare at<br />
you blankly&#8230; At worst pretend they know what you&#8217;re talking about when in fact they haven&#8217;t a clue. In my experience, the best clients to work with are those that have enough knowledge of the web to understand that user experience is key, that copy is important, and that their website is an ongoing project. They don&#8217;t need to know the intricacies of code, servers and the like, but they need to trust<br />
us to make certain decisions on their behalf.</p>
<p>Perhaps it&#8217;s time we tried to educate our clients. I don&#8217;t know how much information is out there to explain the basics. Maybe we should have a simple guide explaining how websites are put together that we can give to clients at the beginning of new projects&#8230; Either that or perhaps SEO companies should be licensed and regulated!!!</p>
<p>As I write, I&#8217;m not entirely sure what the point of this post is, but I feel it&#8217;s an issue not generally discussed and I&#8217;d be interested to know what others think. Perhaps the larger agencies don&#8217;t run into<br />
this problem due to their reputation as experts or their tendency to work with bigger clients; but at my level, developing for small companies with little or no online strategy, half the battle is guiding them in the right direction.</p>
<p>So how do we compete with liars???</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/the-uncomfortable-truth-about-seo-16.html" rel="bookmark" title="The uncomfortable truth about SEO">The uncomfortable truth about SEO </a> <small>I'm simply amazed that there are still people out there...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/where-do-they-find-the-time-45.html" rel="bookmark" title="Where do they find the time?!">Where do they find the time?! </a> <small>The web industry is so fast moving that it's all...</small></li>
<li><a href="https://www.simianenterprises.co.uk/blog/jack-jill-and-hill-of-all-trades-40.html" rel="bookmark" title="Jack, Jill and Hill of all trades.">Jack, Jill and Hill of all trades. </a> <small>Specialising may be essential if you want to get picked...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/combatting-misinformation-in-web-design-76.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Coldfusion, IIS7, Plesk and 401 Authentication</title>
		<link>https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html#comments</comments>
		<pubDate>Thu, 16 Jul 2009 18:15:46 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=66</guid>
		<description><![CDATA[Installing CF8 on a Windows 2008 server running Plesk, seems to cause a bit of a headache. I thought I'd share this simple solution.<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>While installing Coldfusion 8 on Windows Server 2008, I came across a problem that I simply couldn&#8217;t find an answer for anywhere on the interwebs. Now, some three hours later I&#8217;ve stumbled across the solution and thought I&#8217;d blog about it in an attempt to save others the headache.</p>
<h2>The Problem:</h2>
<p>You have a fresh install of Windows 2008 server running Plesk Control Panel.<br />
You innocently download and install a copy of ColdFusion 8. The installation goes fine and you can access the ColdFusion administrator with no problems&#8230;<br />
However, when you try to access a .cfm page on any other site, you&#8217;re greeted with a login prompt asking for authentication details. You&#8217;ll also find that your Plesk URL does the same thing.<br />
In fact, any page on any site other than the default (which is where your ColdFusion Administrator is installed) is now asking for authentication, and of course returning a 401 error when you are unable to supply the correct login details.<br />
<span id="more-66"></span><br />
<h2>The Solution:</h2>
<p>My best guess about what&#8217;s happening here is that the ColdFusion installation is messing with the IIS handler mappings that have been set up by Plesk. If you don&#8217;t have Plesk installed, you probably won&#8217;t run into this issue.</p>
<p>After what seemed like forever messing around and failing to resolve the problem I found a utility installed with Plesk called &#8216;Plesk Reconfigurator&#8217;.</p>
<p>The reconfigurator offers several options, but the one we&#8217;re after is &#8216;Check Componant and Folder Permissions.</p>
<div id="attachment_68" style="width: 310px" class="wp-caption aligncenter"><img class="size-medium wp-image-68 " title="Plesk Reconfigurator" src="http://www.simianenterprises.co.uk/blog/wp-content/uploads/2009/07/plesk-reconfigurator-300x228.gif" alt="Run this little godsend and select 'Check Component and Folder Permissions'" width="300" height="228" /><p class="wp-caption-text">Run this little godsend and select &#39;Check Component and Folder Permissions&#39;</p></div>
<p>You&#8217;re then presented with a wealth of options, dependant on the software installed on your server. Click the ColdFusion option and away we go!</p>
<div id="attachment_67" style="width: 310px" class="wp-caption aligncenter"><img class="size-medium wp-image-67 " title="Check componant and folder permissions" src="http://www.simianenterprises.co.uk/blog/wp-content/uploads/2009/07/plesk-reconfigurator-coldfusion-300x231.gif" alt="Lo and behold, there's an entry for ColdFusion in here..." width="300" height="231" /><p class="wp-caption-text">Lo and behold, there&#39;s an entry for ColdFusion in here...</p></div>
<p>Running this seems to reconnect the various handler settings and Coldfusion pages now work on other sites, as well as plesk. Hurrah!</p>
<p>And if someone had only written this post sooner, I&#8217;d have saved myself a lot of time. <img src="https://s.w.org/images/core/emoji/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
