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:

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:

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: 
3.Download and install Tomcat(http://tomcat.apache.org/download-60.cgi). Choose this link on that page: 
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. 
6.Start the Tomcat service. The best way to do this is by executing C:\Program Files\Tomcat6\bin\tomcat6w.exe.
The app looks like this: 
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:
.
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: 
9.Extract the zip file to C:\Program Files\Tomcat6\railo . When you're done, it should look like this: 
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-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:
f. Lastly, find the <welcome-file-list> section and paste: 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:
<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>
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:
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 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. *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.
you should see:
ANNOTATIONS
You are not logged in, so your subscription status for this entry is unknown. You can login or register here.
On the Railo site, the Railo Server version has integrated Caucho Resin. Can you shed some light on why you went with the Tomcat route versus using the "recommended" version for production use?
Thank you,
Gabriel
Reminds me of when I started looking at CF Frameworks. I went with Coldbox for the same reason relating to documentation.
Thanks,
Gabriel
1. The Tomcat 6.0 Windows Service Installer prompted me for a default port number. I edited it from 8080 to 8081. Step #5 above was unnecessary. (I checked the file after install and it exactly matched your edit.)
2. I downloaded the exact JAVA JRE you suggested (64-Bit version), and the /bin folder did NOT contain a file named msvcr71.dll as indicated in step #4 above. There was a file named msvcrt.dll which I instead copied. Not sure if this is a 32-bit vs 64-bit issue.
3. I deviated a little from your instructions by combining Jeff Spors' instructions on installing 64-Bit Tomcat on IIS7 found in his blog here:
http://jspors.blogspot.com/2009/01/setting-up-64-bit-tomcat-6-on-iis7.html
4. The Tomcat service did start after completing those steps, but with several SEVERE errors in the catalina.yyy-mm-dd.log. The common element in all those log errors was:
Invalid encoding name "cp1252".
A search of all the files in the /conf dir showed only one file with that codepage encoding: tomcat-users.xml
I changed the encoding from "cp1252" to "utf-8", and successfully restarted the Tomcat service WITHOUT errors!
So, I currently have successfully running up to this point:
Windows Server 2008 64-bit (AMD)
Sun JRE 6u16 64-Bit
Tomcat 6.0 64-Bit
On to configuring IIS 7! I'll let you all know how it goes as a comment in that post.
Paul G Cormier
WinCorp Software, Inc.
P.S. I was having no luck at all trying to get Resin-Railo to work 64-bit (mostly due to my limited knowledge of those products and a lack of documentation).

