<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Lynch Consulting Blog - ColdFusion</title>
			<link>http://www.lynchconsulting.com.au/blog/index.cfm</link>
			<description>A blog about ColdFusion, PHP, Flash, Flex, Web Standards and a mish mash of other technologies</description>
			<language>en-us</language>
			<pubDate>Tue, 07 Sep 2010 13:15:33 --1000</pubDate>
			<lastBuildDate>Tue, 29 Jun 2010 13:34:00 --1000</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>mark@lynchconsulting.com.au</managingEditor>
			<webMaster>mark@lynchconsulting.com.au</webMaster>
			
			
			
			
			
			<item>
				<title>ServerStats mentioned on CFHour</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/6/29/ServerStats-mentioned-on-CFHour</link>
				<description>
				
				Just came across a mention of &lt;a href=&quot;http://www.learnosity.com/techblog/index.cfm/2006/11/9/Hacking-CFMX--pulling-it-all-together-serverStats&quot;&gt;a little project&lt;/a&gt; that I did back in 2006 in the most &lt;a href=&quot;http://www.cfhour.com/post.cfm/show-58-monitoring-debugging-and-guests&quot;&gt;recent CFHour podcast - 
Show #58 - Monitoring, Debugging, and Guests&lt;/a&gt;.  (Mention is at approx 53 minutes).

The &lt;a href=&quot;http://www.learnosity.com/techblog/index.cfm/2006/11/9/Hacking-CFMX--pulling-it-all-together-serverStats&quot;&gt;ServerStats code&lt;/a&gt; wraps up a few undocumented methods for CF to make it easy to get information on the number of sessions active on a server as well as some basic information on memory usage. 

Thanks to &lt;a href=&quot;http://www.carehart.org/&quot;&gt;Charlie Arehart&lt;/a&gt; for mentioning it - keep up the good work.

I must have a look at updating it to support Railo when I get a moment.

Cheers,
Mark
				
				</description>
				
				<category>Open Source</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Tue, 29 Jun 2010 13:34:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/6/29/ServerStats-mentioned-on-CFHour</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>proxy_http vs proxy_ajp benchmark</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/18/proxyhttp-vs-proxyajp-benchmark</link>
				<description>
				
				After I posted a previous blog entry about &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/Railo-on-Tomcat-revisited--modproxy&quot;&gt;configuring railo &amp; tomcat with apache and mod_proxy_http&lt;/a&gt;, &lt;a href=&quot;http://blog.kukiel.net/&quot;&gt;Paul Kukiel&lt;/a&gt; and &lt;a href=&quot;http://www.garyrgilbert.com/blog&quot;&gt;Gary Gilbert&lt;/a&gt; suggested that I should be using mod_proxy_ajp.

This has been something I&apos;ve been looking at, but haven&apos;t found a compelling reason for one over the other.

Proxy AJP is claimed to be faster as it is a &quot;Wire protocol&quot; but I couldn&apos;t find any benchmarks around this.  

So I decided to do a very quick and dirty benchmark to satisfy my curiosity.  This is not a scientific process, I just ran a simple railo testpage on the same machine with 50 threads of jmeter requests hitting it. 

First I enabled proxy_http and ran it four times, then enabled proxy_ajp and repeated.  The config is below:

&lt;code&gt;
# Proxy HTTP config
&lt;IfModule mod_proxy_http.c&gt;
	&lt;Proxy *&gt;
	Order deny,allow
	Allow from all
	&lt;/Proxy&gt;
	ProxyPassMatch ^/(.*\.cfm)$ http://testsite.railo:8080/$1
	ProxyPassReverse  /  http://testsite.railo:8080/
&lt;/IfModule&gt;
&lt;/code&gt;

&lt;code&gt;
# Proxy AJP config
&lt;IfModule mod_proxy_ajp.c&gt;
	&lt;Proxy *&gt;
	Order deny,allow
	Allow from all
	&lt;/Proxy&gt;
	ProxyPassMatch ^/(.*\.cfm)$ ajp://testsite.railo:8009/$1
	ProxyPassReverse  /  ajp://testsite.railo:8009/
&lt;/IfModule&gt;
&lt;/code&gt;

&lt;h2&gt;Results:&lt;/h2&gt;
&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Run&lt;/th&gt;&lt;th&gt;HTTP Requests/sec&lt;/th&gt;&lt;th&gt;AJP Requests/sec&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Run 1&lt;/td&gt;&lt;td&gt;206.9&lt;/td&gt;&lt;td&gt;181.4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Run 2&lt;/td&gt;&lt;td&gt;203.9&lt;/td&gt;&lt;td&gt;143.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Run 3&lt;/td&gt;&lt;td&gt;194.6&lt;/td&gt;&lt;td&gt;189.2&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Run 4&lt;/td&gt;&lt;td&gt;204.6&lt;/td&gt;&lt;td&gt;191.4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;Average&lt;/th&gt;&lt;th&gt;202.5&lt;/th&gt;&lt;th&gt;176.4&lt;/th&gt;&lt;/tr&gt;
&lt;/table&gt;

The results showed that the proxy_http module was faster - i.e. more requests per second could be pushed through.

I&apos;m putting this down to the fact that proxy_ajp has to convert the http request into it&apos;s binary format, while proxy_http really just has to pass it along. 

In different scenarios and network configurations the results may be different, but for now I&apos;m going to stick with the http proxy.

Proxy AJP has one other benefit, in that is passes along some extra flags such as whether the request is https or not, but for our purposes we don&apos;t need this.

Cheers,
Mark
				
				</description>
				
				<category>Systems admin</category>
				
				<category>Railo</category>
				
				<category>General</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Thu, 18 Mar 2010 12:20:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/18/proxyhttp-vs-proxyajp-benchmark</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Railo on Tomcat revisited - mod_proxy</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/Railo-on-Tomcat-revisited--modproxy</link>
				<description>
				
				&lt;b&gt;Updated:&lt;/b&gt; Changed the linking between railo and tomcat to use shared.loader.

I&apos;ve been doing some more work on configuring railo to work flexibly in the numerous different environments we work in, and also making it simpler to set up.

To that end I investigated the use of mod_proxy for linking it to apache instead of mod_jk.

Advantages of this approach are:
&lt;ul&gt;
&lt;li&gt;Simple - communications are in plain http&lt;/li&gt;
&lt;li&gt;Flexible - Load balancing can be easily added at the apache layer&lt;/li&gt;
&lt;li&gt;Simple - No compiling mod_jk&lt;/li&gt;
&lt;/ul&gt;

Here are the basic install instructions for Railo/Tomcat/Apache on Ubuntu.

&lt;h2&gt;Download &amp; Install Tomcat&lt;/h2&gt;

&lt;a href=&quot;http://tomcat.apache.org/download-60.cgi&quot;&gt;Download tomcat&lt;/a&gt; and extract content:

&lt;code&gt;
tar xvzf apache-tomcat-6.0.26.tar.gz
&lt;/code&gt;

Move Tomcat to a more appropriate place:
&lt;code&gt;
sudo mv apache-tomcat-6.0.26 /opt/tomcat
&lt;/code&gt;


&lt;h2&gt;Download Railo&lt;/h2&gt;

Download &lt;a href=&quot;http://www.getrailo.org/index.cfm/download/&quot;&gt;Railo custom version jars file&lt;/a&gt;

Extract and move into Tomcat lib directory:
&lt;code&gt;
tar zxvf railo-3.1.2.001-jars.tar.gz
sudo mv railo-3.1.2.001-jars /opt/railo
&lt;/code&gt;


Make Tomcat load the railo jars by editing catalina.properties to change the shared loader path:
&lt;code&gt;
shared.loader=/opt/railo/*.jar
&lt;/code&gt;

Make Tomcat and Railo work together by modifying the web config file:
&lt;code&gt;
sudo nano -w /opt/tomcat/conf/web.xml
&lt;/code&gt;

add the following inside the &amp;lt;web-app&amp;gt; element:
&lt;code&gt;
&lt;servlet&gt;
&lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
&lt;servlet-class&gt;railo.loader.servlet.CFMLServlet&lt;/servlet-class&gt;
   &lt;init-param&gt;
      &lt;param-name&gt;configuration&lt;/param-name&gt;
      &lt;param-value&gt;{web-root-directory}/WEB-INF/railo/&lt;/param-value&gt;
      &lt;description&gt;Configuraton directory&lt;/description&gt;
   &lt;/init-param&gt;
   &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfm&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfml&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;CFMLServlet&lt;/servlet-name&gt;
   &lt;url-pattern&gt;*.cfc&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;/code&gt;

add the following inside &amp;lt;welcome-file-list&amp;gt; element:
&lt;code&gt;
&lt;welcome-file&gt;index.cfm&lt;/welcome-file&gt;
&lt;welcome-file&gt;index.cfml&lt;/welcome-file&gt;
&lt;/code&gt;


Start up tomcat:
&lt;code&gt;
/opt/tomcat/bin/startup.sh
&lt;/code&gt;
Once this is done you should be able to access the railo admin by going to the following URL:
&lt;code&gt;
http://127.0.0.1:8080/railo-context/admin/server.cfm
&lt;/code&gt;


&lt;h2&gt;Back to Tomcat&lt;/h2&gt;
To test our Railo installation, let&apos;s create a test site by adding a new virtual host in both Tomcat and Apache.  We do this by modifying Tomcat server.xml file (/opt/tomcat/conf/server.xml )
&lt;code&gt;
&lt;Host name=&quot;testsite.railo&quot; appBase=&quot;webapps&quot;&gt;
    &lt;Context path=&quot;&quot; docBase=&quot;/vhosts/testsite.railo/www&quot;/&gt;
&lt;/Host&gt;
&lt;/code&gt; 

&lt;h2&gt;Linking with Apache via Mod Proxy&lt;/h2&gt;

Ensure the modules proxy and proxy_http are enabled.  On Ubuntu this is done as follows:
&lt;code&gt;
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo /etc/init.d/apache2 restart
&lt;/code&gt;

&lt;h2&gt;Create vhost&lt;/h2&gt;
Now we need to create a virtual host entry in Apache as well:
&lt;code&gt;
&lt;VirtualHost *:80&gt;
        DocumentRoot /vhosts/testsite.railo/www
        ServerName testsite.railo
        DirectoryIndex index.cfm
	#Proxy .cfm requests to railo
	&lt;IfModule mod_proxy.c&gt;
		&lt;Proxy *&gt;
		Order deny,allow
		Allow from all
		&lt;/Proxy&gt;
		ProxyPassMatch ^/(.*\.cfm)$ http://testsite.railo:8080/$1
		ProxyPassReverse  /  http://testsite.railo:8080/
	&lt;/IfModule&gt;

	#Deny access to admin except for local/portforwarded clients
	&lt;Location /railo-context/&gt;
		Order deny,allow
		Deny from all
		Allow from 127.0.0.1
	&lt;/Location&gt;
&lt;/VirtualHost&gt;
&lt;/code&gt;

This tells apache to forward all requests for CFM files to the railo instance.

Finally restart apache and railo and you should be good to go.

&lt;code&gt;
sudo /opt/tomcat/bin/shutdown.sh 
sudo /opt/tomcat/bin/startup.sh 
sudo /etc/init.d/apache2 restart
&lt;/code&gt;
				
				</description>
				
				<category>Ubuntu</category>
				
				<category>Systems admin</category>
				
				<category>Railo</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 12 Mar 2010 11:01:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2010/3/12/Railo-on-Tomcat-revisited--modproxy</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Upcoming book review - Tomcat 6 Developer&apos;s Guide</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/21/Upcoming-book-review--Tomcat-6-Developers-Guide</link>
				<description>
				
				&lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/mid/211209mc5um2?utm_source=lynchconsulting.com.au&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_001899&quot;&gt;&lt;img src=&quot;http://www.lynchconsulting.com.au/blog/enclosures/tomcat_6_developers_guide.jpg&quot; align=&quot;right&quot;&gt;&lt;/a&gt;

I&apos;ve just received a copy of the &lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/mid/211209mc5um2?utm_source=lynchconsulting.com.au&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_001899&quot;&gt;Tomcat 6 Developer&apos;s Guide&lt;/a&gt; from packt publishing to review.  

It&apos;s nice timing as I&apos;ve been working with Tomcat 6 a bit lately and in the new year plan to move some of our production systems over to running &lt;a href=&quot;http://www.getrailo.org&quot;&gt;Railo&lt;/a&gt; on top of &lt;a href=&quot;http://tomcat.apache.org/&quot;&gt;Tomcat&lt;/a&gt;.

After the extremely busy year Learnosity has had I&apos;m looking forward to reading a few books over the break and coming back in the New Year with lots more ideas and technology to implement.
				
				</description>
				
				<category>Systems admin</category>
				
				<category>Railo</category>
				
				<category>Open Source</category>
				
				<category>Java</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Mon, 21 Dec 2009 21:12:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/21/Upcoming-book-review--Tomcat-6-Developers-Guide</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Learnosity are looking for a Web Ninja at a Mid to Senior level</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/4/Learnosity-are-looking-for-a-Web-Ninja-at-a-Mid-to-Senior-level</link>
				<description>
				
				4 December 2009, Learnosity are looking for a Web Ninja at a Mid to Senior level.


&lt;h3&gt;About Learnosity&lt;/h3&gt;
Learnosity develop cutting edge tools for teachers and educators.  Our flagship product Learnosity Voice uses the telephone to enable language students and teachers to interact on a one to one level. 

&lt;img src=&quot;http://www.learnosity.com/wsimages/learnosity-logo-1.png&quot; align=&quot;right&quot;&gt;
Our service:
&lt;ul&gt;
&lt;li&gt;Makes it practical for students to practice Oral and Aural skills&lt;/li&gt;
&lt;li&gt;Is efficient and effective for teachers, as they can listen to each student individually at a time to suit them&lt;/li&gt;
&lt;li&gt;Can be used for homework assignments or “High Stakes Assessments”&lt;/li&gt;
&lt;/ul&gt;


We are continuing to grow our core development team and we need another great developer to help us keep up with demand.


&lt;h3&gt;We need someone who can:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use Javascript or Actionscript to create great user interfaces&lt;/li&gt;
&lt;li&gt;Develop highly scalable web applications&lt;/li&gt;
&lt;li&gt;Cut code with the best in the world&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;You will also need to be:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;energetic with a butt kicking attitude&lt;/li&gt;
&lt;li&gt;ready to create cutting edge web 2.0 apps&lt;/li&gt;
&lt;li&gt;keen to continue learning new technologies&lt;/li&gt;
&lt;li&gt;able to have a conversation with non technical people&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;You&apos;ll need:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;3 or more years of programming experience&lt;/li&gt;
&lt;li&gt;Expert in at least on Client side language (Actionscript or AJAX)&lt;/li&gt;
&lt;li&gt;Expert in at least one Server side language (eg PHP, Java, ColdFusion, etc)&lt;/li&gt;
&lt;li&gt;Understanding of Object Oriented design&lt;/li&gt;
&lt;li&gt;Understanding of XHTML and CSS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;It would be good if you have:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;A degree in Computer Science, Engineering or similar.&lt;/li&gt;
&lt;li&gt;been working with open source tools&lt;/li&gt;
&lt;li&gt;been playing around with iPhone/Android applications&lt;/li&gt;
&lt;li&gt;experience with some of Linux/VOIP/SIP/Asterisk/Jabber/XMPP&lt;/li&gt;
&lt;/ul&gt;

This is a full time role and you will be working in a casual workplace with flexible hours in the Sydney CBD.

If this sounds like the job for you, email a covering letter explaining why you&apos;ll be great and your resume to mark@learnosity.com - no agencies please.
				
				</description>
				
				<category>PHP</category>
				
				<category>Open Source</category>
				
				<category>Linux</category>
				
				<category>Learnosity</category>
				
				<category>Jobs</category>
				
				<category>Javascript</category>
				
				<category>iPhone</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 04 Dec 2009 16:03:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/12/4/Learnosity-are-looking-for-a-Web-Ninja-at-a-Mid-to-Senior-level</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Chinese characters not working cfdocument for PDF exports - fixed</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/10/26/Chinese-characters-not-working-cfdocument-for-PDF-exports--fixed</link>
				<description>
				
				I&apos;ve just spent quite a few hours grappling with an annoying PDF export issue where the font&apos;s were not displaying correctly.  This is on a CFMX 7 (7.0.2) on Ubuntu Linux system.

All the DB storage and application was using UTF8 throughout, but the PDF exports were showing nothing when they should have been showing Chinese characters.

To fix this up you need to do the following:

&lt;h3&gt;1. Need fonts installed on system:&lt;/h3&gt;
&lt;code&gt;
sudo apt-get install ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp
&lt;/code&gt;

&lt;h3&gt;2. Need fonts installed in CFAdmin&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Go to CFAdmin and Font Management&lt;/li&gt;
&lt;li&gt;Select directory /usr/share/fonts/truetype/arphic&lt;/li&gt;
&lt;li&gt;Select &quot;Add&quot; and you should see 2 new fonts added.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3: CFdocument Hotfix for CF7.0.2&lt;/h3&gt;
The CFDocument hotfix for 7.0.2 provides some essential fixes and makes this work - Follow the instructions to install: &lt;a href=&quot;http://kb2.adobe.com/cps/402/kb402093.html&quot;&gt;http://kb2.adobe.com/cps/402/kb402093.html&lt;/a&gt;

&lt;h3&gt;Configure cffont.properties file&lt;/h3&gt;
The final step is to set the cffont.properties file so that it will check additional font sets for any characters it doesn&apos;t know about - i.e. Chinese characters.  Each line in the file is like a CSS font-family rule, i.e. it will start at the left and look for the correct font to render the text.  I appended the two extra font names to ensure they are checked, so the file looks like this:

&lt;code&gt;
defaultbasefont=
dialog=Arial, Helvetica, AR PL SungtiL GB,AR PL Mingti2L Big5
dialog.bold=Arial Bold, Helvetica-Bold, AR PL SungtiL GB,AR PL Mingti2L Big5
dialog.italic=Arial Italic, Helvetica-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialog.bolditalic=Arial Bold Italic, Helvetica-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput=Courier New, Courier, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.bold=Courier New Bold, Courier-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.italic=Courier New Italic, Courier-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
dialoginput.bolditalic=Courier New Bold Italic, Courier-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
serif=Times New Roman, Times-Roman, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.bold=Times New Roman Bold, Times-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.italic=Times New Roman Italic, Times-Italic, AR PL SungtiL GB, AR PL Mingti2L Big5
serif.bolditalic=Times New Roman Bold Italic, Times-BoldItalic, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif=Arial, Helvetica, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.bold=Arial Bold, Helvetica-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.italic=Arial Italic, Helvetica-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
sansserif.bolditalic=Arial Bold Italic, Helvetica-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced=Courier New, Courier, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.bold=Courier New Bold, Courier-Bold, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.italic=Courier New Italic, Courier-Oblique, AR PL SungtiL GB, AR PL Mingti2L Big5
monospaced.bolditalic=Courier New Bold Italic, Courier-BoldOblique, AR PL SungtiL GB, AR PL Mingti2L Big5
&lt;/code&gt;

The cffont.properties file is located in /opt/jrun4/servers/{instance name}/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib on the jrun multiserver version.

&lt;h3&gt;5. Restart CF&lt;/h3&gt;

Once you restart CF you documents should be coming out with their Chinese fonts intact.

I&apos;m sure there are additional fonts to add to get it working natively with all the other asian languages, so I&apos;ll add to this as and when I need/discover them.  Please feel free to post a comment if you find any more font&apos;s that should be added to the list.
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Railo</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Mon, 26 Oct 2009 16:38:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/10/26/Chinese-characters-not-working-cfdocument-for-PDF-exports--fixed</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFMX Query Timeout Gotcha</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/19/CF-Timeout</link>
				<description>
				
				NOTE: I found this blog post in my to be posted ones from 2008.

While doing some load testing a while back we came across a strange error while simulating the load that we were expecting.  The simulated load had a large first peak, followed by a quieter period, followed by some more peaks.

During the load test we noticed a few query errors that we had never seen before, they related to the query connection timing out.

It turns out that the way CF times out datasource connections is slightly quirky as described below: 

&lt;blockquote&gt;
The other timeout setting in the CF Admin datasource detail page is just labeled as Timeout, with a paired setting for Interval. This timeout value is how long a connection should be idle before it is removed. So if a connection goes unused for this period of time, then the next time ColdFusion checks that connection it will be removed from the pool. The frequency that ColdFusion checks the connection idle time is set by the Interval setting. The default for the Timeout setting is 20 minutes and the Interval is 7 minutes, so every 7 minutes ColdFusion will check connections for that datasource and remove connections that have been idle for 20 minutes or more. The number of connections idle connections removed from the pool at each interval is &lt;strong&gt;hardcoded in ColdFusion to just five.&lt;/strong&gt; Say you have 20 idle connections hanging around in a pool, this would require at least 28 minutes to be cleaned up.

&lt;dl&gt;
&lt;dt&gt;Timeout (min)&lt;/dt&gt;
&lt;dd&gt; The number of minutes that ColdFusion MX maintains an unused connection before destroying it.&lt;/dd&gt;
&lt;dt&gt;Interval (min)&lt;/dt&gt;
&lt;dd&gt;The time (in minutes) that the server waits between cycles to check for expired data source connections to close.
&lt;/dd&gt;
&lt;/dl&gt;

&lt;/blockquote&gt;

Cheers,
Mark
				
				</description>
				
				<category>mysql</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Tue, 19 May 2009 14:04:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/19/CF-Timeout</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion per vhosts mappings</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/6/ColdFusion-per-vhosts-mappings</link>
				<description>
				
				One of the features of CF8 that I was most interested in and most let down on was per application mappings.  The reason I was so keen was so that we could keep core library application files out of the webroot for additional security, but still have different versions of the same codebase.  I.e. some sites running farcry3 some running farcry5 for example.

This didn&apos;t transpire and so now we use the following technique on apache to map the folder in and then lock it down with apache.

In the vhost section add the following:
&lt;code&gt;
Alias /farcry /path/to/non-webfolder/farcry
&lt;Location /farcry/&gt;
    Order Deny,Allow
     Deny from all
&lt;/Location&gt; 
&lt;/code&gt;

Note: it is important that there is no /farcry mapping defined in the CF Administrator or it will override this setting.

What the above does, is to map in the non-web accessible folder, but then locking it down so it cannot be browsed from the web.  This seems pointless but CF can still see the files and correctly resolves the paths even though they are secure from the outside world.

This then allows us to version our sites independently - i.e. if we want to upgrade from farcry 5 to 5.1 we can do it one site at a time, instead of having to test them all at once.

Note - Railo already has per vhost mappings which solve the same problem as this.  But if you are on CF7 or CF8 then this works a treat.

Cheers,
Mark
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<pubDate>Wed, 06 May 2009 13:32:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/5/6/ColdFusion-per-vhosts-mappings</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Railo Useful links</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/24/Railo-Useful-links</link>
				<description>
				
				I&apos;ve been doing some research on Railo with a view to moving some of our sites to using it.  I&apos;ve found a few useful links along the way:

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.compoundtheory.com/?action=displayPost&amp;ID=393&quot;&gt;Mark Mandel&apos;s setup instructions for Railo on Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.bpsite.net/item/37/Why%20Railo%202?.html&quot;&gt;Some great reasons to use Railo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

My evaluations of Railo are so far so good, with performance being one of the key issues and for our application I&apos;ve seen performance 30% faster than CF7 and 25% faster than CF8.

If I find any major issues or benefits I&apos;ll post them here.

Cheers,
Mark
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>Railo</category>
				
				<pubDate>Tue, 24 Feb 2009 12:30:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/24/Railo-Useful-links</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Identifying which queries to tune with MSSQL</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/4/Identifying-which-queries-to-tune-with-MSSQL</link>
				<description>
				
				I&apos;ve been doing some more work tuning and CF/MSSQL application and during figuring out which parts of the system is doing the most work (and hence a good candidate for tuning) I came across this gem which will show stats on the most run queries in the cache.

&lt;code&gt;
SELECT TOP 20 SUBSTRING(qt.text, (qs.statement_start_offset/2)+1, 
        ((CASE qs.statement_end_offset
          WHEN -1 THEN DATALENGTH(qt.text)
         ELSE qs.statement_end_offset
         END - qs.statement_start_offset)/2)+1), 
qs.execution_count, 
qs.total_logical_reads, qs.last_logical_reads,
qs.min_logical_reads, qs.max_logical_reads,
qs.total_elapsed_time, qs.last_elapsed_time,
qs.min_elapsed_time, qs.max_elapsed_time,
qs.last_execution_time,
qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
WHERE qt.encrypted=0
ORDER BY qs.total_logical_reads DESC
&lt;/code&gt;

I found it in this &lt;a href=&quot;http://technet.microsoft.com/en-us/magazine/2007.11.sqlquery.aspx&quot;&gt;excellent article on optimising MSSQL&lt;/a&gt;

The times that are returned from the queries are in micro seconds as &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms189741.aspx&quot;&gt;documented on msdn&lt;/a&gt;.

Cheers,
Mark
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>Systems admin</category>
				
				<category>Database</category>
				
				<pubDate>Wed, 04 Feb 2009 11:29:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/4/Identifying-which-queries-to-tune-with-MSSQL</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Clear MSSQL Query Caches</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/3/Clear-MSSQL-Query-Caches</link>
				<description>
				
				Found this useful little snippet for when you are load testing MSSQL Servers.

You can use it to clear the query cache - to ensure you are starting from a level playing field.  Or if you are tuning queries in a application and want to ensure they are not cached run it before each run:

&lt;code&gt;
dbcc freeproccache
go
dbcc dropcleanbuffers
go
&lt;/code&gt;

Cheers,
Mark
				
				</description>
				
				<category>Database</category>
				
				<category>ColdFusion</category>
				
				<category>Windows</category>
				
				<pubDate>Tue, 03 Feb 2009 22:12:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/3/Clear-MSSQL-Query-Caches</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Non-case sensitive filesystem on Linux - HOWTO</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/2/Noncase-sensitive-filesystem-on-Linux--HOWTO</link>
				<description>
				
				I was setting up a ColdFusion web application on my dev machine and ran into lots of errors because of the case sensitivity of Linux (which i was using) versus the non-case sensitivity of windows (where the application was developed).

I had a quick look to see if I could fix it up but quickly figured out that there were too many occurrences and so it was likely not worth fixing up at this point.  To that end I set up a loopback vfat filesystem so that I could have a directory on my machine mounted as non-case sensitive. 

Note: this is not recommended for production systems - but is a handy fix for a temporary development problem.

&lt;h3&gt;Create a virtual disk&lt;/h3&gt;
&lt;code&gt;
dd if=/dev/zero of=virtual.dsk bs=1048576 count=150
&lt;/code&gt;
&lt;h3&gt;Format it&lt;/h3&gt;
&lt;code&gt;
mkfs.vfat virtual.dsk
&lt;/code&gt;
&lt;h3&gt;Mount it&lt;/h3&gt;

&lt;code&gt;
sudo mkdir /mnt/vfat
sudo mount virtual.dsk /mnt/vfat -t vfat -o loop,owner,group,umask=000
&lt;/code&gt;

You can set this up to mount every time by putting the following line in your /etc/fstab

&lt;code&gt;
/path/to/virtual.dsk /mnt/vfat  vfat  loop,owner,group,umask=000  0 0
&lt;/code&gt;

Note - the same trick works on OSX in reverse.  I.e. if you are developing on a mac, but deploying to a linux production environment you can create a virtual disk with a case-sensitive filename, which will mean that any case sensitive issues get picked up on your dev machine, and not on your production/staging machines.

Cheers,
Mark
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>HOWTO</category>
				
				<category>Linux</category>
				
				<category>Systems admin</category>
				
				<pubDate>Mon, 02 Feb 2009 20:58:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2009/2/2/Noncase-sensitive-filesystem-on-Linux--HOWTO</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Remote collection of vmstat log files</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/12/2/Remote-collection-of-vmstat-log-files</link>
				<description>
				
				We&apos;ve been doing a lot of load testing recently and are planning on doing a lot more, so we&apos;ve developed a simple little script to make the collection of the vmstat (performance statistics) a bit quicker.

multivmstat is a php command line script which makes it easy to collect the statistics.  &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/enclosures/multivmstat.zip&quot;&gt;Download the script&lt;/a&gt;

To run it you specify a list of servers to check:
&lt;code&gt;
./multivmstat server1,server2,server3 5
&lt;/code&gt;

This will run vmstat on each of the servers with a 5 second interval between samples.

It will create the following files:
&lt;code&gt;
server1-vmstat.log
server2-vmstat.log
server3-vmstat.log
&lt;/code&gt;

Note: You mush have ssh access to each machine - ideally with a certificate so that no interactive authentication is required.

&lt;a href=&quot;http://www.lynchconsulting.com.au/blog/enclosures/multivmstat.zip&quot;&gt;Download the script&lt;/a&gt;
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>General</category>
				
				<category>Linux</category>
				
				<category>Open Source</category>
				
				<category>Systems admin</category>
				
				<category>Ubuntu</category>
				
				<pubDate>Tue, 02 Dec 2008 09:42:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/12/2/Remote-collection-of-vmstat-log-files</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>MySQL and Temporary tables and CASE syntax</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/31/MySQL-and-Temporary-tables-and-CASE-syntax</link>
				<description>
				
				For some reason I&apos;ve always avoided the use of temporary tables in SQL (MySQL or otherwise) but today I came across a difficult problem that temporary tables made very simple.  

I needed to use a case function on a subquery value to return a tri-state value.  I.e. yes, no or partial.

The cut down query below demonstrates how it works.

&lt;ul&gt;
&lt;li&gt;First we drop the temporary table in case one has been left lying around.&lt;/li&gt;
&lt;li&gt;Then we select a query into the temporary table which include some complex subqueries.&lt;/li&gt;
&lt;li&gt;We can then query the temporary table to do further processing on the result, which in this case depending on the values of the class_count and class_count_assigned allows us to set a field in three states.
&lt;ul&gt;
&lt;li&gt;&apos;yes&apos; if all users for a class are selected&lt;/li&gt;
&lt;li&gt;&apos;partial&apos; if some users are selected&lt;/li&gt;
&lt;li&gt;&apos;no&apos; if none are selected.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;code&gt;
&lt;cfquery name=&quot;q&quot; datasource=&quot;#variables.myDSN#&quot;&gt;
	DROP TEMPORARY TABLE  IF EXISTS tmp_exams;
	/* Create temporary table query which includes student counts */
	CREATE TEMPORARY TABLE tmp_exams
	SELECT	e.id
			, e.name
			, (SELECT count(1) FROM tbl_user_classes uXc
                WHERE uXc.school_class_id = &lt;cfqueryparam value=&quot;#arguments.school_class_id#&quot; cfsqltype=&quot;cf_sql_integer&quot;&gt;) AS class_count
            , (SELECT count(1) FROM tbl_user_classes uXc
                INNER JOIN  tbl_users_exams uXe ON uXe.user_id = uXc.user_id
                WHERE uXc.school_class_id = &lt;cfqueryparam value=&quot;#arguments.school_class_id#&quot; cfsqltype=&quot;cf_sql_integer&quot;&gt;
                AND exam_id = e.id) AS class_count_assigned
	FROM	tbl_exams e;
	/* Select out the relevant info */
	SELECT e.id
			, e.name
			, e.class_count
			, e.class_count_assigned
		    ,(CASE WHEN class_count_assigned = 0 THEN &apos;no&apos;
		    	WHEN class_count = class_count_assigned THEN &apos;yes&apos;
		    	ELSE &apos;partial&apos; END) AS active
	FROM tmp_exams e
	WHERE	1=1
	ORDER BY e.name
&lt;/cfquery&gt;
&lt;/code&gt;

Mostly posted for my future reference but hope it helps out.

Cheers,
Mark
				
				</description>
				
				<category>Database</category>
				
				<category>ColdFusion</category>
				
				<category>mysql</category>
				
				<pubDate>Sun, 31 Aug 2008 20:47:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/31/MySQL-and-Temporary-tables-and-CASE-syntax</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CF Sandbox Security Tricks and Tips</title>
				<link>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/13/CF-Sandbox-Security-Tricks-and-Tips</link>
				<description>
				
				I&apos;ve been working on getting CF Sandbox security working.  It&apos;s trickier than I first thought so here&apos;s how to do it for future reference:

&lt;h3&gt;Enable security Manager&lt;/h3&gt;
Instructions from &lt;a href=&quot;http://www.talkingtree.com/blog/index.cfm/2006/7/11/SBS-Known-Issues&quot;&gt;Steven Erat&apos;s blog&lt;/a&gt;:
&lt;code&gt;
Stop ColdFusion.
Locate the jvm.config file in jrun_root/bin.
Back up the file.
Open the file in a text editor.
Add the following lines to the java.args section:
-Djava.security.manager
&quot;-Djava.security.policy=[cf_webapp_root]/WEB-INF/cfusion/lib/coldfusion.policy&quot;
&quot;-Djava.security.auth.policy=[cf_webapp_root]/WEB-INF/cfusion/lib/neo_jaas.policy&quot;
&lt;/code&gt;

NOTE the example from the adobe site has the quotes in the wrong place. 
Note you also need to change [cf_webapp_root] to match the location on your machine.


&lt;h3&gt;Datasources&lt;/h3&gt;

After I enabled Datasource security I began to receive the following error, a bit of digging reminded me that the MySQL connector tries to do some autoconfiguration for coldfusion to optimise it.

&lt;code&gt;
Message: Can&apos;t find configuration template named &apos;coldFusion&apos; 
Type: java.sql.SQLException 
&lt;/code&gt;

It was failing to load the configuration file which is inside the mysql connector jar file  /com/mysql/jdbc/configs/coldFusion.properties

I haven&apos;t gotten to the bottom of why it couldn&apos;t be loaded but adding the following to the datasource query string fixed it up: &lt;code&gt;
autoConfigureForColdFusion=false
&lt;/code&gt;

I would suggest adding some of the settings from this file as paramaters in your &lt;a href=&quot;http://www.lynchconsulting.com.au/blog/index.cfm/2008/6/1/Show-Full-Columns-problem-with-CFMX-and-MySQL-solved&quot;&gt;datasource settings as per previous post&lt;/a&gt;


Note: This was using the following:
&lt;ul&gt;
&lt;li&gt;ColdFusion 7.0.2 Cumulative Hotfix 1 Multiserver install&lt;/li&gt;
&lt;li&gt;MySQL connector/J 5.0.8&lt;/li&gt;
&lt;/ul&gt;

Hope it helps.
Cheers,
Mark
				
				</description>
				
				<category>Open Source</category>
				
				<category>mysql</category>
				
				<category>Linux</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Wed, 13 Aug 2008 11:07:00 --1000</pubDate>
				<guid>http://www.lynchconsulting.com.au/blog/index.cfm/2008/8/13/CF-Sandbox-Security-Tricks-and-Tips</guid>
				
			</item>
			
		 	
			</channel></rss>