Installing Railo ColdFusion under IIS on Windows

Railo is an alternative ColdFusion application server. The developers have been very generous to release a free Community edition for small business use.

I decided to use a more manual installation rather than use the bundled versions provided by Railo so I could better understand what was going where.

Note that I am only describing setting up a server to host a single website, which will be the default website within IIS.

1) Download the components

To get started you will need the current versions of the following software:

Sun's JDK
http://java.sun.com/javase/downloads/index.jsp
I used JDK 5.0 Update 6

Resin Application Server
http://www.caucho.com/download/index.xtp
I used the Open Source version 3.0.21
resin-3.0.21.zip (6.3M)

Railo
http://www.railo.ch/en/index.cfm?treeID=224
In this case I download the Railo Custom version 1.0.0.027 JARs only
railo-1.0.0.027-jars.zip (16 MB)

2) Install the JDK

I installed Sun's JDK 1.5 in the directory c:\jdk1.5.0_06

Set the JAVA_HOME environment variable to point to this location (My Computer -> Properties -> Advanced -> Environment Variables)

JAVA_HOME=c:\jdk1.5.0_06

3) Install Resin

I unzipped Resin to the following directory c:\resin-3.0.21

Set up a RESIN_HOME environment variable to point to this location

RESIN_HOME=c:\resin-3.0.21

4) Test Resin

Open a DOS prompt and change to the Resin install directory and start the server by typing

httpd

This will open a control window that allows you to start and stop the server as required, as well as displaying some start up information in the DOS window:

C:\resin-3.0.21>;httpd
Resin-3.0.21 (built Thu, 10 Aug 2006 12:03:19 PDT)
Copyright(c) 1998-2006 Caucho Technology. All rights reserved.
Using Resin(R) Open Source under the GNU Public License (GPL).
See http://www.caucho.com for information on Resin Professional,
including caching, clustering, JNI acceleration, and OpenSSL integration.
Starting Resin on Mon, 06 Nov 2006 10:49:04 +1100 (EST)
[10:49:05.437] Server[] starting
[10:49:05.437]
[10:49:05.437] Windows XP 5.1 x86
[10:49:05.437] Java 1.5.0_06-b05, 32, mixed mode, sharing, Cp1252, en, Sun Microsystems Inc.
[10:49:05.437] resin.home = C:\resin-3.0.21
[10:49:05.437] server.root = C:\resin-3.0.21
[10:49:05.437]
[10:49:05.515] Host[] starting
[10:49:05.656] WebApp[http://localhost:8080] starting
[10:49:06.125] WebApp[http://localhost:8080/resin-doc] starting
[10:49:06.218] WebApp[http://localhost:8080/resin-admin] starting
[10:49:06.281] http listening to *:8080
[10:49:06.328] hmux listening to localhost:6802
[10:49:06.328] Resin started in 1000ms

Test Resin is working by opening a web browser and go to:

http://localhost:8080

This should display the Resin default home page.

The file being displayed in located at the Resin web apps root directory:

c:\resin-3.0.21\webapps\ROOT\index.jsp

Next go to

http://localhost:8080/resin-doc

(or click on the Documentation is available here link from the default home page).

This should display the Resin documentation

5) Configuring Resin with IIS

First stop Resin using the Resin control window (you don't need to Quit the application).

In the Resin /win32 directory is the isapi_srun.dll file.

Copy this file to c:\inetpub\wwwroot\scripts (create the target 'scripts' directory if it does not already exist).

Go into IIS and create a virtual directory named 'scripts' off the default website that points to this directory. Ensure the Execute access permission is selected.

Next, go to the properties of your default website within IIS and select the ISAPI Filters tab.

Click 'Add ...' to add a new filter with the following details:

Filter Name: Resin
Executable: c:\inetpub\wwwroot\scripts\isapi_srun.dll

Next, restart IIS. You can use the following DOS commands:
net stop w3svc
net start w3svc

or restart the World Wide Web Publishing service from the Services panel.

Now restart the httpd service from the DOS prompt.

Also, stop and start the default website from within IIS.

Go back into your default website properties again and back to the ISAPI Filters tab. The Resin filter should have a green arrow pointing up beside it. If it is a red arrow pointing down then is it not working. Have a look at the 'more help' links at the bottom of this page.

6) Test Resin is working via IIS

Change your IIS default website to point to
c:\resin-3.0.21\webapps\ROOT

This will be the location for your Resin served web application

Create a test.jsp file in this directory containing the line:

2 + 2 = <%= 2 + 2 %>

Now, browse to
http://localhost/test.jsp

This should display the result
2 + 2 = 4

7) Installing Railo

Stop the httpd service

Unzip the railo-1.0.0.027-jars.zip file and copy all of the files in the Resin /lib directory

Next, modify Resin's /conf/app-default.xml and add the following just before the </web-app-default> tag

<servlet
   servlet-name="CFMLServlet"
   servlet-class="railo.runtime.servlet.MultiWebCFMLServlet">

   <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-mapping>
   <servlet-name>CFMLServlet</servlet-name>
   <url-pattern>*.cfm</url-pattern>
</servlet-mapping>
<servlet-mapping>
   <servlet-name>CFMLServlet</servlet-name>
   <url-pattern>*.cfml</url-pattern>
</servlet-mapping>
<servlet-mapping>
   <servlet-name>CFMLServlet</servlet-name>
   <url-pattern>*.cfc</url-pattern>
</servlet-mapping>

Next, add two additional entries to the <welcome-file-list> section:

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

Start the httpd service.

8) Testing Railo

Create a file c:\resin-3.0.21\webapps\ROOT\test.cfm

Add the following line to the file

<cfoutput>#now()#</cfoutput>

Browse to http://localhost/test.cfm

This should display the current date and time plus some standard Railo debugging messages.

9) Starting Resin as an NT Service

Stop the httpd service and quit the application.

Go to the Resin directory in DOS and enter

httpd -install

Then start the service with

net start resin

From this point onwards you should not need to execute the httpd application any longer.

More Help

For more information you can look at the following sites

Resin with IIS Documentation http://www.caucho.com/resin-3.0/install/cse-iis.xtp

Installing Railo with Resin http://www.railo.ch/en/index.cfm?treeID=215

Good luck!

Comments
7 Mar 2007 07:15AM
Thanks for this dude. Very helpful, everything works as described. The downloads have changed (Jave & Resin & Railo are all updated) but everything worked the same.
11 Mar 2007 11:14PM
Kevan Stannard said:
Hi Darren, thanks for the update.
15 Sep 2007 02:56PM
Kevin said:
I don't need jsp support. Do I still need to install Resin? I only want the ColdFusion support on my default website.
17 Sep 2007 03:30AM
Hi Kevin

My understanding is that Railo needs a 'Java Servlet Container' to run within - which is what Resin provides. In other words to use Railo, you need to have JSP support first (i.e your servlet container) then Railo ColdFusion will work fine for you.

So the short answer is yes, you do need Resin, or another servlet container package.
25 Oct 2007 02:00PM
All went swell until I got to the part where iis should be returning jsp files (such as index.jsp)

This is server 2003 with iis 6. jdk1.6.0_03. My iis site home directory is "C:\resin-3.1.3\webapps\ROOT"
I can load a jsp's using localhost:8080 and I can load an html page using localhost, but I can't load anything jsp-related over localhost (80).

I get the green arrow in isapi, I double checked all of my environmental variables and replaced the isapi_srun.dll, just in case. Website permissions are wide open (this is a test box).

Any advise would be appreciated.
27 Oct 2007 12:35AM
Hi Scott

Not sure - have not tried to set up on Win2004, but couple of ideas:

1) Resin has some additional notes for II6/Win2003 at:
http://www.caucho.com/resin-3.0/install/cse-iis.xt...

2) It's possible that your JDK version may be the problem. I would try downloading an older 1.4.* version and setting your JAVA_HOME accordingly:
JAVA_HOME=C:\j2sdk1.4.2_12
27 Oct 2007 12:36AM
Oops, Win2004? And I haven't tried to set it up on Win2003 either.
12 Nov 2007 10:09AM
I don't know what I did, but the isapi_srun.dll file had a size of 0kb. So, I replaced it, restarted all services and that solved that problem and my application seems to be working, except what calls a datasource.

That brings me to my next dilema... setting up a datasource. All of the documentation I have found says to direct my browser to http://webroot/railo-context/admin/web.cfm, but it is not there. I used the railo-2.0.0.010-jars.zip for the install. This only included the jars files. Did I use the wrong install package? If not, how do I set up a datasource once teh ODBC ds is created in windows?
13 Nov 2007 12:33AM
Sorry Scott, can't help you on that one. You can try posting a message to the CF-Talk mailing list http://www.houseoffusion.com/groups/cf-talk/. I know that Gert Franz (developer of Railo) is frequently on the list so I am sure that you will get some feedback.
13 Nov 2007 12:39AM
I just noticed that there is a Railo mailing list:
http://www.houseoffusion.com/groups/railo-talk/
13 Nov 2007 06:31AM
Ok. Thank you.
27 Jun 2008 11:56AM
Belinda said:
Well, my site was running fine on cf4 (should be http://www.ehb-llc.com - but since migrating, only the development site above is working on a win98 machine that can still run cf4.0) til I purchased mx6, now nothing works and adobe wants me to purchase a new full-on version of cf8 - not in their lifetime. So I'm looking at alternative tools to run cf and have only found Railo or Dragon. Will Railo work with W2000AS/SP4 and IIS5.0 very well? Have any of you had this successful experience in loading/configuring this tool onto this platform? Any suggestions other than upgrading my OS or IIS is welcome - small businesses don't have that luxury. I'm open to PHP, but was hoping to avoid this sort of migration til I'd exhausted all efforts to get these cf pages working.
27 Jun 2008 03:02PM
Hi Belinda, I would guess that Railo and OpenBD would work fine on your platform, but you might like to post a message to the Railo and OpenBD forums.

Railo forum:
http://groups.yahoo.com/group/railo_talk/

Open Blue Dragon forum:
http://groups.google.com/group/openbd/

Good luck!
Add a comment
(will not be published)
(include http://)