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.21webapps\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!

This entry was posted in Railo and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.

17 Comments

  1. Posted March 7, 2007 at 7:15 am | Permalink

    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.

  2. Kevan Stannard
    Posted March 11, 2007 at 11:14 pm | Permalink

    Hi Darren, thanks for the update.

  3. Kevin
    Posted September 15, 2007 at 2:56 pm | Permalink

    I don’t need jsp support. Do I still need to install Resin? I only want the ColdFusion support on my default website.

  4. Posted September 17, 2007 at 3:30 am | Permalink

    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.

  5. Posted October 25, 2007 at 2:00 pm | Permalink

    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:
    esin-3.1.3webappsROOT"
    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.

  6. Posted October 27, 2007 at 12:35 am | Permalink

    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.xtp#iis6

    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

  7. Posted October 27, 2007 at 12:36 am | Permalink

    Oops, Win2004? And I haven’t tried to set it up on Win2003 either.

  8. Posted November 12, 2007 at 10:09 am | Permalink

    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?

  9. Posted November 13, 2007 at 12:33 am | Permalink

    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.

  10. Posted November 13, 2007 at 12:39 am | Permalink

    I just noticed that there is a Railo mailing list:
    http://www.houseoffusion.com/groups/railo-talk/

  11. Posted November 13, 2007 at 6:31 am | Permalink

    Ok. Thank you.

  12. Posted June 27, 2008 at 11:56 am | Permalink

    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.

  13. Posted June 27, 2008 at 3:02 pm | Permalink

    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!

  14. sher
    Posted October 10, 2008 at 2:39 am | Permalink

    Hello Kevin,

    I installed all acording to the intructions given here.I use jdk-6u7-windows-i586-p.At the first time I got the window for start and stop resin service.Then I configured the IIS.But I couldnt view texs.jsp on the browser.It gave me foule not found 404 error.
    Some how all other were ok with istalling and configuring IIS with resin.Now when I tried to start the sevice with httpd in command line it says "couldn"t start "<nul>"l -Xrs -Jar C:
    esin3.1.6/library/resinjar" –resin-home c:
    esin3.1.6 –root-directory C:
    esin3.1.6.
    I need your help Please

  15. Simon
    Posted October 6, 2010 at 7:00 am | Permalink

    Unfortunately Railo is not well documented, which is why its not being used by more people, probably won’t be until that issue is handled in a professional way. I appreciate you filling the gap and creating this tut, after having wasted so many hours due to lack of decent instructions at getrailo.org

  16. Posted October 9, 2010 at 6:00 am | Permalink

    Thanks Simon. I believe the team are currently working to improving the docs on the site so let’s see how things turn out over the coming weeks.

  17. Andrew Grosset
    Posted December 22, 2010 at 1:43 am | Permalink

    just like to say thank you for posting this on your blog, it’s been a huge help in getting Railo working on windows 2008.

    Andrew