Categories
Contact Doug!
Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Web Hosting

<< September, 2009 >>
SMTWTFS
12345
6789101112
13141516171819
20212223242526
27282930
Search Blog

Recent Comments
Re: My Top 20 Life Lessons for Boys and Young Men (by jeffrey scott berry at 9/16 2:42 PM)
Re: Equivalent of SQL "TOP X" in Oracle (by Mark Foster at 7/07 4:04 PM)
Re: SQL Forward Engineering with Visio 2003 Professional (by Thomas at 6/26 4:41 AM)
Re: One Shot Query to Recalculate Orderby Field - MySQL (by gary at 6/17 6:46 PM)
Re: DON'T GET SICK IN ARKANSAS! (by r. wood at 5/25 12:00 AM)
Re: SQL Forward Engineering with Visio 2003 Professional (by Andrew at 4/30 6:14 AM)
Re: Basic Ajax Select List Filter in PHP (by good at 2/04 5:26 AM)
Re: Family Law: The Weapon of Choice for Woman Scorned (by swalker at 2/03 2:15 AM)
Re: Approaches to Building Strings: The Imploding Array (by bantal silikon at 2/01 9:44 PM)
Re: Disappearing IE Popup Window During Save/Open Dialog (by AddisonDean at 1/15 9:59 AM)
Re: My Top 20 Life Lessons for Boys and Young Men (by Alex at 1/13 8:45 PM)
Re: Array Loop Modifications in CFSCRIPT (by Alex at 11/25 11:18 AM)
Re: Array Loop Modifications in CFSCRIPT (by Abram at 11/14 11:32 PM)
Re: Recursive Functions in ColdFusion (by Dwayne at 10/25 3:47 PM)
Re: Porting Coldfusion Code to Mura (by dh at 10/16 10:14 AM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Devil May Cry at 9/26 1:38 AM)
Re: Why I Hate ORMs (a solicited rant) (by guideX at 9/12 11:38 PM)
Re: Recursive Functions in ColdFusion (by KP at 8/08 7:13 PM)
Re: American Airlines, YOU SUCK! (by Alison at 7/23 4:48 PM)
Re: SQL Forward Engineering with Visio 2003 Professional (by Harshad at 7/11 9:17 AM)
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

21 September 2009
Configuring Multiple Redirectors for Railo,Tomcat,and IIS7 on W2K8

Unless you've already gotten at least partially into Railo, this post will probably be very irrelevant to you. If, on the other hand, you have Railo installed on IIS7 using Tomcat with multiple domains/subdomains where you use mixed languages (PHP AND CFML, for example), you might find the following of interest.

My Scenario

I have two domains being served up by IIS, both of which must be able to execute CFML using Railo. Domain1 is primarily a PHP app, so the default page is index.php, as configured within IIS. My second domain, sub1.Domain1 is a strictly CFML app, so for that one I have index.cfm as the default page.

How IIS and Tomcat Communicate

IIS7 is "connected" to Tomcat via a DLL that performs request redirections. For example, anytime a request is made for a Railo-enabled domain, this DLL checks to see if the template being called should be processed by Railo or not. This "check" is done by checking a list of predefined filters, such as "/*.cfm" and "/*.cfc". Now, in order for a request to my domain that doesn't specify a template to pass this redirect filter, it is necessary to add this filter entry: "/*". This will ensure that any request will be passed to Railo for processing. This is also where the issue arises for me....

The Challenge

My Domain1 has a default page of index.php, so when a generic request is made to that domain (http://Domain1), I do not want it being passed on to Railo. So, I simply omit the generic "/*" filter and voila! Only valid Railo requests will be passed on. Ah, but now when I set up my second domain which serves up a strictly CFML app, I DO want the generic request passed on since my default page is a CFM template. The filter criteria I have in place, however, prevents it. What to do, what to do.

Resolution

The way I resolved this issue was to simply set up a second instance of the redirector DLL and associate THAT with my second domain. The relevant configuration file for the redirector DLL lives in Tomcat's "conf" folder and is called "uriworkermap.properties". So, I created a second uriworkermap.properties file, this one WITH the generic filter ("/*"), and pointed my second DLL's "isapi_redirect-1.2.28.properties" file to that second uriworkermap.

Worked like a charm!

One other potential advantage I think this may have also addresses a question put forth by someone regarding the redirector's performance under load. It seems to me that if I gave each of my sites/domains their OWN copy of the DLL to use, that I would be creating the ability for IIS to perform these redirections asynchronously rather than serially. Not sure if that's truly the case or not, but in theory it sounds right to me.

If anyone has a better way of addressing the issue described above, I'm all ears.

For more details on setting up the redirector DLL for IIS7 and Tomcat in a Windows environment, visit 'Railo 3.1 on Windows Server 2008 and IIS7'

Posted by dougboude at 12:13 PM | PRINT THIS POST! | Link | 2 comments



17 September 2009
Batch Script to Backup MySQL Database

In setting up a new IIS7/Windows 2008 server, I had a need to automate the backup of my MySQL database and so pieced together a little batch file that I then scheduled via the Task Scheduler. The file first removes all backup files that are more than a week old, then performs a sql dump and finally zips the dump. Files are named according to the date and time they were created. Anyway, it took me quite a while to find all the pieces and parts I needed, so thought I'd post it here as a starting point for others who may be wanting to do the same.

Oh, one prerequisite for this particular script to function: You have to have a copy of winzip installed (I have version 12) WITH the optional command line utility, which is a separate download (http://www.winzip.com/downcl.htm). Hey, the whole deal costs $29 bucks...spring for it!

MySQLBackup.BAT

@echo off
for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i
for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i
rem Killing all files older than a week old...
forfiles /D -8 /M *.zip /C "cmd /c del @fname.zip"
"C:\mysql\bin\mysqldump" -u username -p"password" dbname >C:\mysqlbackup\%DATE_DAY%_%DATE_TIME%_database.sql
wzzip C:\mysqlbackup\%DATE_DAY%_%DATE_TIME%_database.zip C:\mysqlbackup\%DATE_DAY%_%DATE_TIME%_database.sql -mex

Posted by dougboude at 9:30 AM | PRINT THIS POST! | Link | 2 comments
16 September 2009
Choosing an SSL Certificate

I was in need of procuring an SSL Certificate today to enable portions of our domain to be accessible via HTTPS, but a google search turned up far too many choices for the unseasoned guy to choose from. So, I turned to Austin's "Refresh-Austin" google group (where hundreds of techies of various disciplines lurk night and day) and asked their advice. Since it was useful to me, I thought I'd share it here in the form of a post.

Without further adieux...

can anybody recommend a good SSL cert provider? There are hundreds out there...any of them stand out as having great prices and being good to work with?
Thanks!
Doug Boude

The only one with cheap prices, that I know of, is godaddy.
regards,
Warren

I know that typically in life, "you get what you pay for" ... any glaring reason NOT to go with a godaddy SSL cert???
Doug Boude

I'm not a big fan of godaddy, a big non-fan of chained SSL certificates, and I've had luck with RapidSSL: www.rapidssl.com

- d.

I've tried godaddy, verisign, rapidssl.com, enom geotrust ssl certs, and instantssl.com.
I also am a fan of rapidssl. The godaddy checkout requires the ability to navigate a horrible UI. I believe they resell starfield tech ssl certificates anyway.

Felipe R
Creative Director
padreMedia

I am cheap. You cant beat $29.99 a year.

Warren

I've used Trustwave extensively for wildcard certs ($798 for 3 years) and standard certs ($225 for 3 years). I haven't shopped around in a while, but they were cheapest for wildcards.
https://ssl.trustwave.com/solutions-overview.php

Victor

There is nothing wrong with a $29 dollar certificate except having to use chained certificates. Savvy visitors also recognize that you didn't go through the full background check procedures utilized by the more expensive certificates. I agree in working with whatever is in your budget. I just always felt it important to not cut corners for clients with large budgets. I purchase their name brand certificates with all the authentication hoops despite the extra cost.
"The reason for having these expensive certs from these companies is that you are paying for that level of trust. If i was giving out certs for free there would be no reason at all to trust me. However having a big name like verisign as the provider of your cert is like wearing brand name cloths, its a status symbol and it brings with it a level of trust, which is very important for ecommerce sites to have." -
http://ask.slashdot.org/article.pl?sid=01/03/18/1855230

Felipe R
Creative Director
padreMedia

I used rapid ssl many times. $69.. easy.. When I don't want to have a the chained certificate, I use geotrust.
I honestly see no reason for not using rapid ssl. I haven't had any users ever report not being able to accept the certificate.

www.rapidssl.com
and
http://www.instantssl.com/ssl-certificate-products/ssl-certificate-index.html

I believe godaddy just resells starfieldtech.com's certificates.
I remember seeing their name when I purchased the ssl through godaddy.

Felipe R
Creative Director
padreMedia

 

I am a fan of Geotrust, and here's why. They are kinda of second to the almighty expensive Verisign and quite pricey themselves. But, there is a way around that.

If you signup for a reseller account (surprisingly free) you get some really good priced high quality certificates they aren't $28 but they do have the verified link ones for less than 100

Dustin

 

I'm sorry to tell you, but Geotrust was bought by Verisign 2-ish years ago. And their excellent customer and sales service started going downhill from there....

-d-

Back when I was buying certs for disparate client sites, before I switched to using my own hosting provider's certs (www.pair.com), I used Thawte (www.thawte.com) and was happy with their pricing and service. Honestly, I've not used them in a few years, but back then they were reliable and customer support was responsive.

Cheers,

Art


 

I ended up buying a wildcard cert from my host, Gearhost.com. It was $179 for a year. Considering the fact that with a wildcard cert (*.mydomain.net) I can basically secure n number of sub-domains, I thought it was a good deal. :)  Also turns out, as I completed the whole "authenticate me" process, that Gearhost is reselling rapidSSL certs anyway! lol

Doug out

 

Posted by dougboude at 12:08 AM | PRINT THIS POST! | Link | 0 comments
13 September 2009
Managing Multiple Development Platforms with Limited Windows Laptop Resources

Since I do a lot of my development work on my laptop, and since the thought of having services running and consuming my precious memory that are NOT necessary all the time bugs the bajeebies out of me, and since I do development in CF and .NET on my machine (and use different versions of SQL server for each), I wrote some batch files to start and stop the services required for each platform. Some others might find them useful (at least as starting points), so I thought I'd share them here.

Batch file to start/stop CF with SQL Server:

CFDev.bat

@echo off
IF [%1]==[ON] GOTO START
IF [%1]==[OFF] GOTO STOP
:START
 net start "ColdFusion 8 ODBC Agent"
 net start "ColdFusion 8 ODBC Server"
 net start "ColdFusion 8 Application Server"
 CALL SQL2005.bat %1
 @echo "CF Started!"
 pause
 GOTO :EOF
:STOP
 net stop "ColdFusion 8 ODBC Agent"
 net stop "ColdFusion 8 ODBC Server"
 net stop "ColdFusion 8 Application Server"
 CALL SQL2005.bat %1
 @echo "CF Stopped!"
 pause
 GOTO :EOF
:EOF

(the above batch file calls SQL2005.bat...)
SQL2005.bat

@echo off
IF [%1]==[ON] GOTO START
IF [%1]==[OFF] GOTO STOP
:START
 CALL SQL2008.bat OFF
 net start "SQL Server (SQLE)"
 net start "SQL Server Browser"
 net start "SQL Server VSS Writer"
 GOTO :EOF
:STOP
 net stop "SQL Server (SQLE)"
 net stop "SQL Server Browser"
 net stop "SQL Server VSS Writer"
 GOTO :EOF
:EOF

I have two shortcuts on my desktop, one titled "Start CF" the other titled "Stop CF", with these properties, respectively:
C:\CFDev.bat ON
C:\CFDev.bat OFF


For my .NET stuff, SQL 2008 is required. Here are my batch files for those required services:

dotNetDev.bat

@echo off
IF [%1]==[ON] GOTO START
IF [%1]==[OFF] GOTO STOP
:START
 net start ".NET Runtime Optimization Service v2.0.50727_X86"
 CALL SQL2008.bat %1
 @echo ".NET Ready!"
 pause
 GOTO :EOF
:STOP
 net stop ".NET Runtime Optimization Service v2.0.50727_X86"
 CALL SQL2008.bat %1
 @echo ".NET Stopped!"
 pause
 GOTO :EOF
:EOF

(the above batch file calls SQL2008.bat)
SQL2008.bat

@echo off
IF [%1]==[ON] GOTO START
IF [%1]==[OFF] GOTO STOP
:START
 CALL SQL2005.bat OFF
 net start "SQL Server (SQLEXPRESS)"
 @echo "SQL 2008 Started"
 pause
 GOTO :EOF
:STOP
 net stop "SQL Server (SQLEXPRESS)"
 @echo "SQL 2008 Stopped"
 pause
 GOTO :EOF
:EOF

Again, I have a "Start DotNet" and "Stop DotNet" shortcut on my desktop with the following properties:
C:\dotNetDev.bat ON
C:\dotNetDev.bat OFF

That's all folks!

Posted by dougboude at 1:42 AM | PRINT THIS POST! | Link | 1 comment
12 September 2009
Railo's Administrators: Server vs Local

In CF, we have a single administrator to manage settings that affect all of our different CF web sites. If we configure a datasource, ANY CF app running on our web server can see and use that datasource. No new info here, right?

RAILO'S SERVER vs LOCAL ADMINISTRATOR

In Railo there is a slight twist to administration that you need to be aware of and know how to think about in order to make good choices in your configurations. Railo provides you with two kinds of administrators: Server, and Local. The easiest way to think about these and visualize them is to think of the Server administration as being your GLOBAL settings; anything you do when in the Server admin will be seen by any and all CFML/Railo-enabled web sites on your server. If for example I want all of my sites to utilize the same email server settings, I should set that up in my Server admin to make it globally visible.

The web admin for each site is used to configure settings that should be specific to that site only. So if for instance I were to set up a mapping called "includes" in my local web admin for Site1 and point it to "folderx", and then configure a mapping with the same name in the local admin for Site2 pointing to "folderZ", the app's running on each site would both use an "includes" mapping that pointed to different places. If on the other hand ALL of my sites and their apps should have an "includes" mapping that points to the same place, the best place to configure that would be in the Server admin. Is it gellin'? The nearest thing CF admin had for us like this was the ability to configure different sandboxes, but that is pretty limited if I'm not mistaken and didn't offer anything even close to Railo's paradigm shift.

ACCESSING THE RAILO ADMINISTRATORS

Here are the two URLs you need to get to the respective administrators:

http:[your site name]/railo-context/admin/web.cfm

http:[your site name]/railo-context/admin/server.cfm

So if I have three sites (masonclaims.com, tipcalcpro.com, and dougboude.com), their respective local administrators' URLs would be:

  • http:masonclaims.com/railo-context/admin/web.cfm,
  • http:tipcalcpro.com/railo-context/admin/web.cfm,
  • and http:dougboude.com/railo-context/admin/web.cfm.

 Getting to my server's Server admin can be done by using ANY of the following URLs (they will all save their settings in the same, central, location):

  • http:masonclaims.com/railo-context/admin/server.cfm,
  • http:tipcalcpro.com/railo-context/admin/server.cfm,
  • or http:dougboude.com/railo-context/admin/server.cfm.

YOUR WEB-INF FOLDER

One more little tidbit that's useful to be aware of: all of the settings you administer via these interfaces are stored/saved within the WEB-INF folder structure that got created whenever you configured your site to be "Railo-aware". Local settings will be stored in the applicable site's WEB-INF folder, and the global server settings will be stored...in another WEB-INF folder located somewhere else (not sure on the location of this one, but it is NOT within any of your site folders, that much I know).

With only a small handful of exceptions, you should never ever have to go into the WEB-INF and do any manual tweeking whatsoever; just use the admin interfaces for that purpose.

On a side note, I think you will be VERY pleased with what you see in the administrator interface! it all looks very, very familiar and works nearly exactly the same way as the CF admin we're used to seeing, at least in my experience so far.

If anybody has any corrections or additions, please do add them to the comments below! :)

Posted by dougboude at 10:47 PM | PRINT THIS POST! | Link | 3 comments
11 September 2009
501 Error When Sending Mail via Smartermail 6

After several hours of hair pulling, I finally rectified an issue sending mail via Smartermail 6.0 using PHP's "mail" function. The exact same (crappy) code worked fine on the old freeBSD box, running PHP 4.9 and Apache. But when I migrated the same code to Windows 2008 running IIS7, PHP 4.9 (just to save me potential hassle with upgrading to 5.x), and Smartermail 6.0, I would get delivery log entries like this:

 

13:48:47 [60090] Delivery started for < at 1:48:47 PM
13:48:47 [60091] Delivery started for < at 1:48:47 PM
13:48:50 [60091] Skipping spam checks: No local recipients
13:48:50 [60090] Skipping spam checks: No local recipients
13:48:53 [60091] Sending remote mail for <
13:48:53 [60091] Connecting to 72.9.148.220
13:48:53 [60090] Sending remote mail for <
13:48:53 [60091] Connection to 72.9.148.220 from 69.24.65.218:55153 succeeded
13:48:53 [60091] RSP: 220-secure.extentions.net ESMTP Exim 4.69 #1 Fri, 11 Sep 2009 14:48:51 -0500
13:48:53 [60091] RSP: 220-We do not authorize the use of this system to transport unsolicited,
13:48:53 [60091] RSP: 220 and/or bulk e-mail.
13:48:53 [60091] CMD: EHLO maso165.gearhost.us.com
13:48:53 [60091] RSP: 250-secure.extentions.net Hello maso165.gearhost.us.com [69.24.65.218]
13:48:53 [60091] RSP: 250-SIZE 52428800
13:48:53 [60091] RSP: 250-PIPELINING
13:48:53 [60091] RSP: 250-AUTH PLAIN LOGIN
13:48:53 [60091] RSP: 250-STARTTLS
13:48:53 [60091] RSP: 250 HELP
13:48:53 [60091] CMD: MAIL FROM:<<> SIZE=899
13:48:53 [60091] RSP: 501 <<>: missing or malformed local part
13:48:53 [60091] CMD: QUIT

 

Googling turned up lots of Ruby dudes and dudettes who were encountering the same error trying to send mail via SMTP in Ruby, only since they were using a Ruby class to do it, the true cause of the problem was out of their reach. In a nutshell, the error is generated by a malformed "FROM" address. After trying all manner of experimentation, I finally rectified the issue by removing the space between the colon and the header variables. Here's the original code that created the mail headers, and broke my send attempt:

   

$headers = "From: $MailFrom\r\n";
    $headers .= "Return-path: $MailFrom\r\n";
    $headers .= "Errors-to: $MailFrom\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=iso-8859-7\r\n";
    $headers .= "X-Sender: $MailFrom\r\n";
    $headers .= "X-Priority: 3\r\n";
    $headers .= "X-MSMail-Priority: Normal\r\n";
    $headers .= "X-Mailer: PHP ".phpversion()."\r\n";

 

Here's what the working version of that snippet looks like:

   

$headers = "From:$MailFrom\r\n";
    $headers .= "Return-path:$MailFrom\r\n";
    $headers .= "Errors-to:$MailFrom\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=iso-8859-7\r\n";
    $headers .= "X-Sender:$MailFrom\r\n";
    $headers .= "X-Priority: 3\r\n";
    $headers .= "X-MSMail-Priority: Normal\r\n";
    $headers .= "X-Mailer: PHP ".phpversion()."\r\n";

 

 
So, if you are encountering a 501 error, check your code to ensure that you don't have any extra characters or spaces in your values, such as square brackets, extra opening or closing pointy brackets (< >), and the like.


Just for entertainment purposes and to give you something to wag your head at, let me show you the complete code my predecessor wrote to generate the email headers and values:

$BCCx = 0;
$Ectr = 0;
$BCCx = "";
$MastStr = " ";

               while($Row=mysql_fetch_array($Result)) {

 

                 $Bemail = $Row[EMail];
    if (strpos($Bemail,"@")>0) {
               $BCCctr = $BCCctr + 1;
               $Ectr = $Ectr + 1;
                 if ( strpos($Bemail,";")> 0) {
                     $xx = strpos($Bemail,";");
                     $Bemail = substr($Bemail,0,$xx) . "," . substr($Bemail,$xx+1);
                 }
$dbug = $dbug . "$Row[LastName], $Row[FirstName]&nbsp;&nbsp;&nbsp;";
                     $BCCx = $BCCx . ", " . $Bemail;
                     $MastStr .= "<br><br>" . $Row[EMail] . " .. " . trim($Row[LastName]) . ", " . trim($Row[FirstName]) . " .... d:" . $Row[daytimephone] . " .. n:" . $Row[eveningphone] . " .. cell:" . $Row[cellphone];
     }

               if ($BCCctr == 150) {
                   $BCCctr = 0;

                     $MailJay = "$Row[EMail]";
                     $Subject = $_POST['SubjectLine'];
                     $Strx =    $_POST['MessageLine'];
                     $MailFrom  = $ReplyEmailx;

                  print("<br>mail command done S:$Subject*B:$Strx*<br>");

if ( strpos($MailJay,";")> 0) {
    $xx = strpos($MailJay,";");
    $MailJay = substr($MailJay,0,$xx) . "," . substr($MailJay,$xx+1);
}


    $MailJay = "administrator@somedomain.com"; // new Aug 2004


    $headers = "From:$MailFrom\r\n";


    $headers .= "Return-path: $MailFrom\r\n";
    $headers .= "Errors-to: $MailFrom\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=iso-8859-7\r\n";
    $headers .= "X-Sender: $MailFrom\r\n";
    $headers .= "X-Priority: 3\r\n";
    $headers .= "X-MSMail-Priority: Normal\r\n";
    $headers .= "X-Mailer: PHP ".phpversion()."\r\n";


    $headers .= "BCC:$BCCx\r\n\r\n";

    $Mheaders = $Mheaders . "<br>" . $headers;
    $BCCx = "";


    while (strpos($Subject,"'")>0) { $xx = strpos($Subject,"'");
        $Subject = substr($Subject,0,$xx) . substr($Subject,$xx+1);
    }
    while (strpos($Subject,'"')>0) { $xx = strpos($Subject,'"');
        $Subject = substr($Subject,0,$xx) . substr($Subject,$xx+1);
    }
    while (strpos($Strx,"'")>0) { $xx = strpos($Strx,"'");
        $Strx = substr($Strx,0,$xx) . substr($Strx,$xx+1);
    }
    while (strpos($Strx,'"')>0) { $xx = strpos($Strx,'"');
        $Strx = substr($Strx,0,$xx) . substr($Strx,$xx+1);
    }


// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 mail($MailJay, $Subject, $Strx, $headers, "-f $MailFrom");

Posted by dougboude at 4:00 PM | PRINT THIS POST! | Link | 0 comments
10 September 2009
On Falling Behind...

This blog post began as a simple comment to Ray's blog post "Are We Falling Behind", but darn him, he moved me such that it turned into multiple paragraphs!

So, here's the commentary that the afore mentioned post and the thoughts of all its commenters evoked from me.

 

In My Beginning, There Was Procedural

In 2004 MX6 made a leap in evolution that opened the doors many native OOers had been waiting for, and they began to weave all sorts of new and strange CF tapestries. At that time, all of my CF coworkers were buzzing about "MVC", all the time, constantly; it was SO annoying! I was coding as I always had and didn't see any gaps in my ability to produce good stuff; I'd never used a CFC before and had no intention of starting at that time. That, coupled with the fact that I unequivocably tend to ALWAYS be wary of whatever direction the herd is heading (I've read about those caveman bison hunts!), kept me perfectly content just as I was. Fast forward to 2006. What was a buzz is now a dull roar. Fusebox has taken a quantum leap. Model-Glue, Reactor, Mach II, Coldspring...they are now incarnate and catching plenty of attention. My job at that time had me maintaining legacy code, so I spent my days tracing variables through myriads of includes, trying to find their origins...nothing that involved any new dev, for the most part. Then the directive came down to rebuild all this legacy spaghetti. Myself and two other team members were mandated to recreate this app, in a fashion that would allow it to be easily configurable, easily connect to multiple database backends, easily support multiple clients and THEIR clients, be easily skinnable, and have certain aspects of it be consumable as web services by corporate and other satellite offices. It was at that point that the ton of bricks fell and I knew that it would be a very bad idea to try and weave this masterpiece from scratch, so the team and I decided that "frameworks it would be".

At The Crossroads

Ah, but which framework should we choose? None of us had any experience with any of them; we had only read blog posts and accumulated rough ideas, foggy understandings, and enough theory to fuel lunch time discussions. To decide the matter, we architected out a small application with basic security and crud, and we built that app with each of the frameworks we were considering. What that accomplished was to solidify the vague understandings we had, and it let us find the framework that most suited our own personal development style (terminology, syntax, organization, etc.). Since that first app in Model-Glue, I have written several more using that framework and some others; but I have also written a decent number strictly "plain vanilla", simply because their scope was smaller than the problem a framework addresses. The beauty of things now, though, is: I have a choice.

I have to make a confession: the directive to build an enterprise-size app was not my only motivation to learn the frameworks; that was just my paid opportunity to do so. My stronger, deeper, and truer motivation at that time was that dull incessant roar I mentioned, the one that was always in my ear and eventually DID manage to make me feel like I was being left behind, professionally. Was I, or was it perception only? Well, if in my future job quests I continually find that I am unqualified for the position due to my lack of specific CF skills, despite the fact that I've been using CF for a decade or more, then I would have to say that yes, I WAS left behind. If I'm well able to procure suitable employment without having added that knowledge to my quiver, then no, I was not left behind. I don't have a good enough feel for the pulse of the CF job market to know which it truly is, nor am I any sort of prognosticator on this matter, but I DO know that I have absolutely zero regrets having invested the time in stretching my brain to accommodate both the old AND the new.

Change IS Scary, But Possible

Making the leap to this strange new world is daunting, without a doubt, and anybody who tries to tell you otherwise is doing that smoke-blowing thing. My own leap was still recent enough for me that I remember the doubts, frustrations, and pain of persistently banging my head against this apparent brick wall. But eventually, with enough experimentation, reading, experimentation and reading, it DID sink in! There was no shortcuts over that mountain, so I just took that first grip and pulled until I could reach the next one. As I learned things I blogged about them, leaving behind what understandings I'd gleaned in hopes that those following me could gain an easier foothold. But the simple truth with this is, as with every other thing in life that's worthwhile: if you want it, you can get it, but to get it, it is gonna cost you something. Accept this gauntlet, then take off running. I guarantee you, it is impossible to fail to learn OO in a CF context if you determine in yourself that you are going to do it. There's just too many people who have gone before you, no smarter than you are, who have managed to accomplish it; there's just too many fellow CFers who are able and willing to assist you along the way. You can't fail at this, should you choose to do it.

Opting Out: Is It An Option?

But what if you should choose NOT to do it? Let me preface the rest of this by saying that I do indeed love all my fellow CF developers equally, and I'd love to drink a pint with each and every one of you. But, just speaking from my gut, I believe that if you are not in a constant state of professional growth, which includes frameworks and OO methodologies, you will minimally eventually find yourself to be part of a CF minority, if not already. And I do believe that that minority will find itself at the lower end of a continually expanding income gap between those who made the time for this particular vein of professional self-improvement and those who did not.

I'm not condemning anybody for something they do not know (Lawd knows there's PLENTY that I don't know!), but what I am doing is encouraging one and all to take/make the time to get more than just an arm chair knowledge of what is happening all around you in the CF world; acknowledge that ever increasing dull roar of OO that you can't help but hear, and (in this case only), take a sip of this kool-aid. You will never regret knowing more tomorrow than you do today.

Doug out :0)

Posted by dougboude at 5:42 PM | PRINT THIS POST! | Link | 2 comments
07 September 2009
Buying a New Home is Easy! Part 2 of 2

Just before completing the process of moving into my wife and I's new home, I did a blog post covering what I consider to be a lot of good tips, info, and ideas. Now that we've been in the home for a full week, there are a few more things regarding this process I'd like to share as well.

If you haven't read the first or second posts on this subject, you should do that now and then come back (link provided back to this post in the second post).

Your Home Is An Investment. Period.

It's VERY important that you don't allow the glamor and romance (which is definitely there and should be enjoyed) get in the way of you viewing your new home as an investment. Unless you are of retirement age and/or are so content with this purchase that you plan on having your ashes put on the mantle place, you must view this as merely a seven year stepping stone towards the home that you really want to live in for the rest of your life. With that in mind, here are some things that my wife and I did that I know will help our home stand out among others that will be for sale seven years from now when we're ready to build the dream mansion.

Upgrade, Upgrade, Upgrade

Centex/Pulte offers a lot of different upgrades. Upgrades cost money, for sure, and the last time I had a home built, I didn't take advantage of these options. But, I'm telling you now that you should take almost every single upgrade that you can possibly afford. With our deal, part of the incentives was almost $6,000 of free upgrades, and we spent every penny and then some. Don't worry, the extra money you spend will be part of the sale price and not have to come out of your pocket, so DO spend it! Get the top of the line appliances (we got all stainless steel); get the top of the line carpet and pad; get every possible light fixture set up for ceiling fans; add extra cable and phone jacks anywhere they might possibly come in handy for someone; take all the tile you can get (bathrooms, etc.), UNLESS you plan (as we did) on ripping out the entire downstairs flooring and having it custom tiled the day you get the keys; get the largest AC unit they offer, with heat pump; get pre-wired for the alarm and garage door opener, and get pre-plumbed for a water conditioner; take the stoned in fireplace!; take the masonry on the outside of the home; if there's a lot with trees, take that one!; and any other upgrade they have that your gut tells you will appeal to potential buyers in the future. If you have to, in order to afford the upgrades, downsize the model that you are choosing and take one with a few hundred less square feet, just so you can afford the upgrades.

Make plans well ahead of time on what modifications you're going to do once you have the keys in your hand. My wife and I already knew that we were for sure going to have the entire downstairs tiled, as well as the upstairs bathrooms, with ornamental inserts put in in a decorative pattern. So, we bought the tile months ahead of time when it was on sale, and had the tiler lined up several weeks before we closed. The money we were saving up had the tiling budgeted in, so we had it all arranged to give the tiler the key the same day that we received it. All went VERY well, and now we have flooring that nobody else does!

We also contacted several water conditioning companies and had them give us bids, as well as a company to install the garage door opener and one to do the alarm system. so within less than a week after we moved in, we had all of these things taken care of. Why the rush? Because we're human, and humans tend to think that they'll eventually get to it "very soon". The problem is that so very often "soon" never comes, so we MADE ourselves do it right away. Definitely no regrets here.

Hire a Mover
If you're like my wife and I, you've probably moved about a hundred times in your life already, at least. And I bet I can safely say that not one of those moves was probably enjoyable to you. It always involves rounding up whatever friends you can, renting a UHaul, and lots and lots and lots of "making like an ant", and carrying things back and forth, back and forth. Well, neither of us had any intention of going through THAT again, and so we got a quote from a moving company and budgeted it in to our savings. To give us maximum affordability, we also started literally two months ahead of time packing things into boxes and moving them into the room nearest the front door. The front room became our storage room, and as the weeks passed that room became filled with furniture and boxes stacked from floor to ceiling. Why? Because movers charge by the hour, and the easier we could make it for them to pack it up, the less time it took. Additionally, we decided that a new house should equal a brand new start, and we sold a LOT of the big stuff. Two queen size beds, one of the kids' beds, a couch and loveseat, a kitchen table...sold them all. We went through our house at least three times and put usable items out on the sidewalk for people to take; and they did! We purged ourselves of everything that wasn't absolutely necessary and/or that we didn't feel would be a good fit for the new house. By doing this, we managed to move a four bedroom, 2500 sq foot home into a 3 bedroom, 2100 sq foot home at a total cost of $540, including a $90 tip for the guys! It was WELL worth it, let me tell you!

Getting Your Deposit Back
Historically, NOBODY gets their full deposit back when moving from a rental, and most don't even get half of it back. Well, my wife and I got ALL of our deposit back, PLUS an additional $60! Essentially, the plan here is to do what your momma always preached to you: "keep up instead of catch up". When my wife and I moved in to our rental, our mantra that we always preached and practiced with ourselves and all 13 of our kids (yes, 13) was: "Keep the house landlord-ready at all times!". What this meant was that we took preventative actions, such as laying a long strip of cheap hallway plastic down in the high traffic areas from day 1. We also kept on top of the kids about keeping their personal spaces neat, correcting them whenever we saw them rubbing hands on walls and the like, and we enacted the rule from day one that no shoes would ever be worn in the house. By maintaining a mindset of keeping the house in a state that, if the landlord were to show up he would not be displeased with us, we had very little to do by way of repairs and the like when it came time to move out.

Because we really really wanted to get our deposit back, and we knew that we had been maintaining the house as if it were our own, we also did this: we called the landlord when we gave him our 30 day notice and asked him outright, 'what do we have to do to the house in order to get our deposit back?'. His answer was, 'take out the checklist we made when you first moved in that noted any issues with the home, and make sure that there's nothing additionally wrong with it'. Simple enough! So, we did. We spent ten bucks on a gallon of paint that matched the wall colors, bought two small sponge rollers, and we spot painted the house in areas of high wall to hand traffic. We removed staples from the girls' posters and put putty into every single staple hole we could find; we hired two young lady friends of ours for $125 to come in after us and clean the house from top to bottom; and we made sure the yard was cleaned up and groomed. By doing this, our landlord was more than pleased at our final walk through, complimented us on having been really great tenants, and handed us back our deposit, in full. Oh, but I said we got an extra $60, didn't I? The extra money came by way of improvements we made to the home and left for the next tenants. I simply prorated the value of those improvements (ceiling fans, a small brick outdoor fireplace patio, a garden box that we built) and asked him to buy them from me at their current value, which he gladly did. It was my first rewarding experience as a renter, but it wasn't luck of the draw, it was because my wife and I had been proactive from the beginning, always thinking ahead and knowing that we would one day be moving out.

Buying Appliances
Our new home came with all appliances except for one: the refrigerator. Now, the existing applicances I mentioned we had upgraded to the stainless steel ones, so we needed a refrigerator that would match. My wife being the most passionate about refrigerators, she had her heart set on one that was in the $2000 range. Since this is a new house, and since we will probably be leaving the fridge behind as a selling point, we decided we'd spring for it out of the money we had saved for this purchase. We shopped around, and it was when we got to Lowes (in The Rim shopping center off of IH 10 near the 1604 intersection) that we decided this was the place to buy it. The salesman there was just amazing. His name was JP, and the fridge my wife wanted was actually about $500 more than our budget allowed. JP being the awesome man of integrity that he is, told us that he would go ahead and give us a ten percent discount right off the top, AND that this same fridge would be going on sale next week for an additional ten percent off. If we bought it, he said that he'd call us next week and we could get the additional ten percent off as well. This total of twenty percent off put the refrigerator exactly within our budget! To make things even better and give us a little more breathing room, JP had us apply for a Lowe's card to put the purchase on. We applied, holding our breath (because I have an ex spouse who after several years has STILL not refinanced my old house in just her name, so every time SHE makes a late payment it goes on my credit!). In a few minutes the nice young lady at the service desk whom JP had introduced us to had us a card with the whole purchase put on it at twelve months no payments and no interest. She said the system had said that we had only qualified for a few hundred dollars, but she managed to get it up to $2600! THAT lady (and JP) are definitely being invited to our house warming party next month! So, we got the exact fridge we wanted and didn't have to spend a dime. They delivered it the next day and we simply adore it.      P.S. JP DID call me the following Thursday to tell me he hadn't forgotten, and that he had already taken off the additional ten percent from our Lowe's card. If you're shopping for appliances in the San Antonio area, hit Lowe's at The Rim and ask for JP!

The New Lawn

Here in south Texas, there really isn't a lot of dirt to speak of; in fact, the substance that our foundation was poured onto was a lot more like cement than any kind of earth. This is a good thing for the foundation; bad for any kind of plant that isn't native to this area. So, one thing that my wife and I did was to sneak in one day during lunch, just after the topsoil for our lawn was spread, but before they actually laid the sod. We picked up a $50 bag of lawn fertilizer and a couple of spreaders from Home Depot and fertilized the soil pretty thoroughly. I can't say for a fact that it made a difference (maybe they just gave us great sod), but I can tell you that our sod took off incredibly fast compared to the neighbors and is now, three weeks after being laid, thick and green. I recommend that you give the same kind of pre-treatment to your new lawn as well.

That's all the tips and info I can think of right now, but if I think of anything else I'll be sure and append them to this post. If you have any questions or need any input whatsoever, don't hesitate to shoot me an email via the link at the top right of this page!

Doug out. :0)

Posted by dougboude at 11:18 PM | PRINT THIS POST! | Link | 1 comment
04 September 2009
Railo 3.1 on Windows Server 2008 and IIS7 - Part 3 of 3
BOK 2 of 2

This is the third of three posts on installing Railo 3.1 on Windows Server 2008 with IIS7. The previous post can be found here.

Okay, in our last episode, we focused our incredible shrinking brains solely on getting Tomcat and Railo set up and working as a standalone entity. We also did the preliminary work of getting IIS7 set up with whatever domains we plan on giving the ability to execute CFML requests. In this final chapter we are now going to do the dirty work of bridging the two together. As a reminder, here is my view of how the two entities (IIS and Tomcat) will be communicating:

rails tomcat and iss working together

The key to this bridge is "The Connector", a DLL whose job in life is to evaluate incoming http requests and determine if said request should be redirected for processing or not. I use the word redirected, but it isn't a true redirection in the sense of sending the caller to a different URL. Rather, it is more so deferred processing; if the incoming request matches a pre-defined filter list, then that request will be deferred to Tomcat for processing, the resulting html being returned to IIS for delivery to the caller.

Here's an overview of what we're going to accomplish:

  • acquire and install the DLL;
  • "wire up" the DLL to IIS7;
  • tell the DLL what requests to be watching for;
  • tell Tomcat what domains it should care about and where it can find those domains' content;

Before we begin, go ahead and make sure Tomcat is shut down. If you need to know how, see step 6 in the previous post.


Get The DLL
1.
Download the DLL from
http://www.ip97.com/apache.org/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.28/isapi_redirect-1.2.28.dll . If that specific file is removed or superceded by a later version, or you find that you need the win64 version, just pare the url back to the appropriate place so you can drill down yourself.

2. Once you have the DLL, create a folder called 'scripts' under your inetpub folder and drop the dll in there.

3. Now we have to create the configuration files (.properties files) that the DLL will use to communicate with Tomcat. When you create these, make sure that a ".txt" extension doesn't get tacked on to the end, k?
   a. Create C:\inetpub\scripts\isapi_redirect-1.2.28.properties
   b. Paste the following into that file:

# Configuration file for the Jakarta ISAPI Redirector
# The path to the ISAPI Redirector Extension, relative to the website
# This must be in a virtual directory with execute privileges
extension_uri=/jakarta/isapi_redirect-1.2.28.dll
# Full path to the log file for the ISAPI Redirector
log_file= C:\Program Files\Tomcat6\logs\isapi_redirect.log
# Log level (debug, info, warn, error or trace)
log_level=debug
# Full path to the workers.properties file
worker_file= C:\Program Files\Tomcat6\conf\workers.properties
# Full path to the uriworkermap.properties file
worker_mount_file= C:\Program Files\Tomcat6\conf\uriworkermap.properties
#rewrite_rule_file= C:\Program Files\Tomcat6\conf\rewrites.properties
##########################################################

   c. Create C:\Program Files\Tomcat6\conf\uriworkermap.properties and paste the following into it:

# uriworkermap.properties - for use with IIS
/*=wlb
/*.cfm=wlb
/*.cfc=wlb
/*.cfml=wlb

 

d. Create C:\Program Files\Tomcat6\conf\workers.properties and paste the following into it

 

# workers.properties.minimal -
# This file provides minimal jk configuration properties needed to connect to Tomcat.
# The workers that jk should create and work with
worker.list=wlb,jkstatus
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
# Defining a load balancer
worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w
# Define status worker
worker.jkstatus.type=status
####################################

 

Okay boys and girls, now we've got everything in place from The Connector back to Tomcat; it's time for us to connect The Connector to IIS! (note: I am assuming at this point that you are able to navigate to localhost and your other domains already, viewing at least a default html page)

Tell IIS It's Okay To Run the DLL
1.
In IIS Manager, click the main host, then double click the "Isapi and CGI Registrations" Icon
2. In the right hand panel, click the 'Add' link, then fill in the path to your dll as well as a name (any name will do). Be sure to check the
little box!
Link Up Your Filter to Your Site
3.
Click on your server's default site ("Default Web Site") and double click the ISAPI Filters icon.
4. In the right hand panel, click the Add link and fill in the name of your filter (the name you gave it in the previous step) and the path to the
dll.
Create a Very Special Virtual Directory in Your Site
5. Right click on your Default Web Site and select 'Add Virtual Directory'. Name it 'Jakarta', and point it to C:\inetpub\scripts

6. Click on the Jakarta virtual directory, then double click on the 'Handler Mappings' icon


7. In the right hand panel, click on the link named "Edit Feature Permissions", then check the "Execute" box and close.


8. Restart IIS, restart your default web site (just for good measure), restart Tomcat, drop in a test index.cfm file into your default web root, and see if you can navigate to localhost/index.cfm! It should work at this point.

Repeat Steps 3 through 7 for Remaining Domains
Now, go back through steps 3 through 7 to get your remaining domains ready to use Railo. Skip step 8 for the time being (at least the part about
browsing to an index.cfm), because we have to dive back into Tomcat before those domains will know what to do with a .cfm file.

Your Other Domains and Tomcat
Tomcat comes pre-configured with localhost, so for that domain we don't have to do anything. But for any other domains you may be wanting to run on
this server, we're going to have to tell Tomcat that they exist and a few things about them. Your domains will now be referred to as 'Hosts', and we'll be working inside C:\Program Files\Tomcat6\conf\server.xml to set them up.

Let's say that IIS is also hosting a domain called MyDomain.Net. For development purposes, you will also be referring to this domain locally as "MyDomain-Test". Your domain's web root is located at C:\inetpub\wwwroot\mydomain.net, and you already have an entry in your hosts file (MyDomain.net      MyDomain-Test) to allow you to successfully navigate to MyDomain.net via http://MyDomain-Test.

What we need to do is create another <Host> entry in our server.xml file that defines this host AND its known alias. Here is the snippet you should paste in to your server.xml file (values replaced appropriately with your own, of course), just below the localhost entry:

<Host name="MyDomain.net"  appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <Alias>MyDomain-Test</Alias>
    <Context path="" docBase="C:\inetpub\wwwroot\mydomain.net"/>
</Host>

(note: make sure you understand the Context tag and the Alias tag in the above snippet. You can have multiple Alias tags, but you must make sure that the alias actually resolves before its of any use here. Either DNS entries are in place, or the Hosts file is being used for local resolution. Context is important because that is what tells Tomcat where to look for the files being requested.)

Save server.xml, restart IIS, restart your web sites, then restart Tomcat. You should now be able to successfully navigate to http://MyDomain.net/index.cfm as well as http://MyDomain-Test/index.cfm!

Troubleshooting Hints
Hopefully everything went well, but if not, don't panic. First, check your Tomcat log file to see if it had any issues starting up due to configuration
errors (type-os, paths, etc.). You can find the log file at C:\Program Files\Tomcat6\logs\catalina.2009-09-04.log (or whatever today's date is for you). Remember that in this log file, latest entries are appended to the bottom. You can also eliminate some things by verifying that you can browse to your domain in IIS (calling a standard html page, not the cfm page), and in Tomcat by browsing to your domain with a specified port. In our sample above, we could perform this troubleshooting by browsing to http://MyDomain.net/default.htm , and http://MyDomain.net:8081/default.htm . If both of those resolve correctly, then try browsing directly to your .cfm page with http://MyDomain.net:8081/index.cfm. If that parses correctly, we know that Railo is doing its job and that the issue is probably somewhere in the redirection portion of things, meaning we should review our web sites' IIS settings again and the values in the properties files related to our DLL.

TIPS AND POINTERS
Default Files
In my scenario, I have to run both PHP files AND CFM files from the same domain. IIS already knows what to do with PhP files via an ISaPI mapping
associating the PHP executable with files of that extension. And, the way the Tomcat connector dll works, it looks at every request to that domain to determine if it should redirect or not. SO then...what if I want the url http://MyDomain.net to default to index.php instead of index.cfm? Two pieces to that puzzle.

1: Within IIS, you can specify the order that default documents should be looked for regarding any given site. Just click the site, then the "Default Document" icon  If you want

index.php to be the default document, simply make sure index.php appears before index.cfm, or leave index.cfm out of the list altogether. 

That's half of the issue. The other half is the dll that sniffs every single request to determine if it should redirect or not. The snippet I gave you earlier for C:\inetpub\scripts\isapi_redirect-1.2.28.properties included the line " /*=wlb ". This line essentially tells the redirector, "redirect everything to Tomcat". Remove or comment out that line, and then ONLY the requests for files with the specific CFML extensions will be redirected for processing.

flex2gateway
I had a conversation with Paul Kukiel regarding an issue he was having getting flex2gateway to resolve without having to specify the port. Now, Paul
was using IIS6 in that instance, so this solution doesn't apply, but I found that I myself wasn't able to get flex2gateway to resolve in my scenario either. The solution was simply adding this line to  C:\inetpub\scripts\isapi_redirect-1.2.28.properties:  " /flex2gateway/*=wlb "

Basically, any process you want to run that needs Railo to do the work, add an appropriate filter to the DLL's properties file so that it will know to redirect the processing to Tomcat.

That's all folks, and quite a lot it is. Any corrections or comments or suggestions or other tips and tricks are welcome!

 

 

 

 

 

 

Posted by dougboude at 6:24 PM | PRINT THIS POST! | Link | 21 comments
Railo 3.1 on Windows Server 2008 and IIS7 - Part 2 of 3
BOK 2 of 2

As I mentioned in my previous post on installing Railo with IIS7, my own recipe for success in getting Railo set up on Windows 2008 Server with IIS7 was actually a conglomeration of several sources, along with a lot of additional research and experimentation on my part. Let me go ahead and give kudos right now to those sources: blog posts on www.hockeypfef.net,  web-rat.com, and corfield.org - thanks! And with a special shout out to Todd Rafferty (aka WebRat) who walked with me a good portion of the way.

One last thing before I dig in to this subject: the explanations and illustrations that follow are my own personal viewpoint and not necessarily technically accurate, though they work very well for me! Also, since there are a painfully huge number of steps involved with all of this, it is entirely possible that I may have forgotten to write one down, in which case I'm sure that whoever tries to duplicate this process will point that out to me and I'll modify the instructions as needed.

Getting The Big Picture

One thing that I know helps me so very much is to have an understanding (at least a vague one) ahead of time of how all the pieces fit and work together. Without this, you are blindly following someone else's step by step instructions, and if your situation deviates one iota from that of the original publisher's, you don't have a clue how to address that difference. So before I lay out the step by step, I want to explain the inner workings to you. If you'd rather just jump directly to the step by step, feel free.

HOW IT WORKS

The Actors

The main actors in our production of "Saving Private Railo" are:

  • IIS 7 (on Windows Server 2008)
  • Railo 3.1
  • Java Runtime Environment (JRE) version 6, update 16
  • Tomcat version 6
  • a little guy we're going to refer to as "The Connector" (isapi_redirect-1.2.28.dll, if you must know his real name!)
  • and several miscellaneous configuration files (text files named either *.properties, *.xml, or *.conf)

The Script

So what are the roles of all these guys? Let me illustrate how I understand it to work, and then we'll dissect it in more detail.

IIS and Tomcat Each Rule Their Own Kingdoms
We all know what IIS is and how it works; you make a request to it via the port it's listening on (typically port 80) and it returns the requested
html to you. Tomcat works the same way. It is set up to listen for http requests on a certain port. So, if you request a page using that port, Tomcat will respond instead of IIS. (Note: Tomcat comes with a default html page, typically used to let you know that your Tomcat install worked. It also has a few links on it for admin purposes, but I had no need to use it for any purpose other than the first one). In my example here, Tomcat is listening on port 8081. (Note: by default Tomcat gets set up to listen on port 8080, but IIS already has 8080. Rather than mess with making IIS STOP listening on 8080 I just made Tomcat listen on 8081). To "the rest of us", Tomcat appears to be nothing more than yet another web server, and in some respects that's exactly what it is. But, it's also a Servlet Engine, meaning that it has the ability to (internally) execute specific java code in response to specific requests before it returns the rendered html. In our case, that "specific java code" is Railo. Now, if Railo just happened to be a pre-compiled, stand-alone executable application, we'd have no need for Tomcat as our intercessor whatsoever and we'd simply do what we have always typically done and tell IIS "hey, if anybody requests a file with this extension, call this executable to process it first". But, since Railo is really nothing more than a whole BUTTload of Java jar files sitting in a deeply nested directory structure somewhere, it depends upon a servlet engine in order to run. Here is my illustration of how IIS and Tomcat live side by side:

how IIS and Railo live side by side

As you can see by my illustration, in essence each of these servers live within their own little bubbles. They act independently, listen to different ports, serve their own content, do their own things; they ARE independent of one another!

Enter "The Connector"
The Connector is a Dynamic Library Link (DLL) file written to run in a Windows environment whose purpose in life is to re-write URLs. It takes an
incoming URL and, based on properties you define for it (in a .properties file, no less), will re-write, or forward, the url to another destination. It is this functionality with which we tie requests made to our IIS server to Railo. By telling our connector that any request for a .cfm, .cfml, or .cfc file should be directed to Tomcat on port x, we now have a way to serve CFML pages using IIS as a proxy! Here is a revised illustration of how I envision the process of serving a .cfm template:

how IIS and Railo are connected

From a birds eye view, this is how the whole scene is laid out and how the actors interact with one another. Now for the specifics of how I set this up. I will try to minimize the commentary within the actual instructions in order to keep them more readable. If I can't resist adding comments and notes, I'll add them afterwards, with correlating annotations in the instructions.

STEP BY STEP INSTRUCTIONS

1.Prepare your web server. Have your domains set up and responding via appropriate URLs with at least a "hello world" html file.
2.Download and install the Java Runtime Environment (JRE). When you arrive at the (
http://java.sun.com/javase/downloads/index.jsp) Java download page you will be accosted by a multitude of choices. Choose this one: download this JRE
3.Download and install Tomcat(
http://tomcat.apache.org/download-60.cgi). Choose this link on that page: choose this Tomcat file to download

When you install it, remove the spaces and such from the folder name it tries to use. I named mine tomcat6 (as suggested by Mr. Rafferty)

4. Now, immediately copy a file called msvcr71.dll from your c:\Program Files\Java\jre6\bin directory TO your c:\Program Files\Tomcat6\bin directory. Don't ask my why this is necessary (because I do not know!), but it is.


5.Alter Tomcat to use port 8081 instead of the default 8080 (which IIS already has). Do so by editing C:\Program Files\Tomcat6\conf\server.xml and
looking for the <Connector tag with port="8080". Change it to 8081 and save the xml file. tomcats server.xml file

6.Start the Tomcat service. The best way to do this is by executing C:\Program Files\Tomcat6\bin\tomcat6w.exe.starting tomcat on windows

The app looks like this: starting and stopping tomcat on windows

 You should just leave this app open since you will have to do frequent restarts of the service to make configuration changes take effect.

7.Test Tomcat! navigate to http://localhost:8081 . You should see:

 testing tomcat installation on windows .

Assuming this worked as planned, go ahead and stop the Tomcat service as described in step 6.

8.NOW, let's get Railo *1*. Download it from here: http://www.getrailo.org/index.cfm/download/  As with most of the items in this, there are far too many choices on that page. Choose this one: choose the railo jar files for windows

9.Extract the zip file to C:\Program Files\Tomcat6\railo . When you're done, it should look like this: railo jar files after unpacking

10.Now we have to tell Tomcat that Railo exists. *2* This step is a lot of cutting and pasting, so just blindly follow the instructions. You can tune back in when it's time to restart Tomcat. IMPORTANT! We're getting ready to edit some XML files, boys and girls. For whatever reason, some of the XML files in Tomcat's conf directory have an opening tag that causes Tomcat to fail starting up in Windows. Open each XML file and make sure that the opening tag is exactly like this: <?xml version='1.0' encoding='utf-8'?>  . Mine had different encoding values here and there, and it gave me grief until Mr. Rafferty pointed it out to me. Okay, on with the show:
   a. open C:\Program Files\Tomcat6\conf\catalina.properties
   b. Change this line: common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar
   to this line: common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/railo/*.jar
   c. Save & close catalina.properties
   d. Open C:\Program Files\Tomcat6\conf\web.xml.  Look for the <servlet> section (should be around line 90) and paste the following into that section
(don't overwrite what's already there, just add this):

 

<servlet>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <description>CFML runtime Engine</description>
    <servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
    <init-param>
        <param-name>configuration</param-name>
        <param-value>/WEB-INF/railo/</param-value>
        <description>Configuraton directory</description>
    </init-param>   
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
    <servlet-name>GlobalAMFServlet</servlet-name>
    <description>AMF Servlet for flash remoting</description>
    <servlet-class>railo.loader.servlet.AMFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

 

   e. Now find the existing <servlet-mapping> sections and add a few of your own. Paste in:

<servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfm</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>/index.cfm/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfc</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>GlobalAMFServlet</servlet-name>
    <url-pattern>/flashservices/gateway/*</url-pattern>
</servlet-mapping>

   f. Lastly, find the <welcome-file-list> section and paste:

 <welcome-file>index.cfm</welcome-file>

 

  g. Save web.xml and close it.

11. Start Tomcat. Make sure it started without any issues by checking the log file, because even if you have something wrong in your configuration, it will still appear to start. The log file you need to look for is here:  C:\Program Files\Tomcat6\logs\catalina.2009-09-01.log (of course, the date will be different in the file name). Scroll down to the very bottom (most current info is at the bottom in this log). Look for the line containing "org.apache.catalina.core.AprLifecycleListener init" ... this is the start of the log entry. You should see something like the following if all went well:

 

 

 

 

 

Sep 4, 2009 9:58:08 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Tomcat6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\mysql\bin;
Sep 4, 2009 9:58:08 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8081
Sep 4, 2009 9:58:08 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 482 ms
Sep 4, 2009 9:58:08 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 4, 2009 9:58:08 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Sep 4, 2009 9:58:10 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8081
Sep 4, 2009 9:58:10 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Sep 4, 2009 9:58:10 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15  config=null
Sep 4, 2009 9:58:10 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2331 ms

 

If there WERE issues, you'll see lines such as this mingled within:

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\inetpub\wwwroot\host-manager does not exist or is not a readable directory
SEVERE: Error in resourceStart()
etc.

If you do see issues, do your best to try and figure out what the error line is telling you. There's a decent chance you'll be able to do a facepalm and get it cleared up (type-o, etc.)

 

12. Assuming Tomcat started with no errors, let's test the Railo install by seeing if we can hit the Railo administrator! Try browsing to this url: http://localhost:8081/railo-context/admin/server.cfm
you should see: railo administrator screenshot

VERY COOL! Congratulations, you now have Railo installed and working. But, only by browsing directly to it via the Tomcat server (which is only half of our battle). Now it's time to connect IIS7 to this puppy. Due to the length and size of this post, I'm going to defer the next set of steps (getting IIS7 connected) to yet ANOTHER post, which can be found here.


ANNOTATIONS

*1* - Installing Railo itself, as with all other ingredients in this recipe, provides too many choices for the common man/woman. SO, I am only covering the choice I made, which was to simply grab all the Railo jar files and drop them into a Tomcat subfolder. Other choices include a "war" installation...not sure of why i would want to choose that one instead. If interested, see Todd Rafferty's step by step instructions at

http://web-rat.com/blog/post.cfm/installing-railo-on-tomcat-the-windows-edition

*2* - There's a LOT more to telling Tomcat about Railo than just pointing it to the JAR files, eh? We also had to tell Tomcat specifically about the different railo servlets (we have one for cfm/cfc templates and one for flash remoting). We then had to do some "servlet mapping", telling Tomcat which servlet we should let process which kind of requests.

 

 

 

Posted by dougboude at 11:45 AM | PRINT THIS POST! | Link | 7 comments
02 September 2009
Railo 3.1 on Windows Server 2008 and IIS7 - Part 1 of 3
BOK 1 of 2

Over the course of the past few days, I have spent a total of about 9 solid hours getting Railo installed on a Windows 2008 server running IIS7, configured for multiple domains and aliases. Having been through this process, I wanted to contribute my experiences and the details thereof in the form of this and a second blog post, hopefully to help others who want to traverse this same path either do it with less pain, or decide to avoid the pain altogether.

Now that I am on the back side of this install, I am left with two distinct bodies of knowledge that I want to share. The first is the overall experience: the pain, the joy(minimal), the reasoning behind choosing to run this gauntlet, and whether or not this is the right choice as far as cfml parsers go. This will be the subject of this blog post.

The second body of knowledge I want to share, which will be the subject of a second and third blog post, consists of the details and nuances of the installation, with the steps involved and some screen shots.  I did find two or three blog posts that almost matched up to my particular scenario, and/or DID match my scenario but left out what were vital pieces of information and understanding for me. So I dissected these posts, dug in to Tomcat documentation, did a lot of combinatory play, learned things I NEVER wanted to know, experimented until I wanted to cry, tapped into an awesome Railo resource (thanks Todd Rafferty!), and finally...FINALLY achieved success. The first of the last two posts can be found here.

The Scenario
Let me begin with my particular scenario. I am a one man show who inherited a horrendously written PHP app that is currently being hosted with an equally horrendous hosting company on a FreeBSD server. My current mission then is to get our app migrated to a new host. Not being a fan of green screens, blinking cursors, and commands that when spoken aloud sound like you're choking to death (AWK! GREP!), I of course opted for a Windows 2008 Server running IIS7 (my comfort zone). Also not being a fan of PHP and fully intending on doing all future development in CF, I needed something that would allow me to execute CF code. I could ask my company to drop $1,000 on CF Server, but why do that when there are at least two free alternatives floating around? I've been seeing lots and lots of activity in the Railo community and hearing good things about its performance and ability to do nearly everything that Adobe CF Server does, so why not go for it? So, I rolled up my sleeves and leaped headlong into the burning fiery furnace to wrestle this hombre down.

Choices, Choices

I always hate it when I go to a restaurant, order something from the menu, and then get presented with a hundred questions by the waitress about the specifics of my order. "Fries or tots. mmhmm. Salad or soup. what kind of soup? toast or biscuit. White or wheat". AUGH! Choices are good, but TOO many choices can stop you dead in your tracks sometimes. A Railo install is a recipe consisting typically of at least four distinct items: an operating system, a web server, a Java Servlet Engine, and Railo itself. It is at this very beginning point in the process of using Railo when the water becomes incredibly murky, as there are far too many choices out there for each of these items (except Railo itself). Operating system...take your pick! You have people using CentOS, Windows Vista, Windows 2008, Ubuntu, Mac OSX, and the list goes on. Web Server? Seems that the majority of people are using Apache, but in theory, ANY web server theoretically will do. IIS6 and 7 are available, and in minimal use based on my research. Java Servlet Engine? If you're not a Java geek already, then you will probably have almost no good knowledge on which to base your choice here except recommendations from acquaintances. Myself, I like to be able to think "down the road", but not being a Javaphyte, choosing a servlet engine was pretty much a coin toss. Well, except for JRUN...the general concensus is to avoid that one. Besides JRUN though, you can use JBoss, Glassfish, Resin, Tomcat, and probably a dozen other ones I haven't even heard of. I've been told that Resin is the simplest to use, but limits what you can do "down the road", while Tomcat is a good compromise between complexity of use and the doors it opens up for you. So then, HOW does one decide what specific "recipe" they should use? You're probably already set on the OS you're using, so that's a done deal. Web server: I'd choose the one I'm most familiar with, since you will have to get down and dirty with it. Servlet engine? After a long period of Googling, I decided to go with Tomcat, for the sole reason that it is the one for which I found the most instruction and documentation.

Railo: indeed a cheap alternative to CF Server. In terms of cash, anyway. But uber expensive in terms of the intellectual overhead required to wrap your mind even partially around it and just get it installed and configured at a basic level! I know, some would disagree with that assessment; but I say, after having run this guantlet and installed Railo on a windows server running IIS7 with multiple domains and aliases, that unless you have a passion for system administration and/or are as comfortable staring at blinking cursors and command lines as you are in a GUI environment, then setting up Railo (in my environment, anyway) is painful. Why is it so painful? In a nutshell, because we have always been shielded from the nasty, ugly Java that actually makes CF Server work. Railo, on the other hand, is raw and open and REQUIRES that you not only stare into its filthy bowels, but also plunge in both hands to tie some precisely placed knots in its writhing intestines. If you want to use Railo, you can't be squeemish and must be a firm believer in the phrase "no pain, no gain".

The looming question then, after having gone through the process of just getting it installed: Is it worth the pain? Well, you WILL gain a clearer understanding of how CFML parsers work behind the scenes (like we wanted to know!); You WILL save the $1,000 it costs to buy CF Server; You WILL be able to execute CFML, and have it do so faster than CF Server can do it. But, you will also be committing yourself to an additional level of server administration that "the rest of us" may not be comfortable dealing with. Again, unless you're good with having to hand edit multiple, cryptic configuration files (the equivalent of trying to add and remove walls in a house made of playing cards without it falling down), don't mind having to manage web server changes in places other than just your web server, find that system administration brings you joy, or you're just a glutton for punishment (my category), then you will probably want to just sit back and wait until the railo community comes out with version 2 of a windows installer (version 1 doesn't exist yet, but typically version 1 of anything is rough around the edges). I'm definitely not dogging Railo, not at all; Just wanted to let folks know how it went for me so they can make an informed decision going into it.

Post 2 to follow soon...

Doug out :0)

Posted by dougboude at 4:59 PM | PRINT THIS POST! | Link | 4 comments