Installing Railo 3 on Windows 2008-32bit with IIS7 and Tomcat

Tomcat Installation You need to have either the JAVA JRE or JDK installed. I chose the JRE route (JRE 6 Update 12). I installed it to C:\Program Files\Java\jre6, the default directory.Next you need to install Apache Tomcat. I installed Tomcat 6.0.18 Core (Windows Service Installer) to C:\Program Files\Apache Software Foundation\Tomcat 6.0\, the default directory/. Do not start Tomcat yet. Once you install it, navigate to your JAVA bin installation directory (C:\Program Files\Java\jre6) and copy msvcr71.dll to your tomcat bin directory (C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin) and paste the msvcr71.dll in there. Now you can start tomcat and navigate to http://localhost:8080. You should get the Tomcat home page.

IIS 7 Installation Go to "Server Manager" in Windows 2008. Select Roles, Add Roles. Click next at the "Before you Begin" screen. Select Web Server (IIS) and click next. You must select "ISAPI Extensions" and "ISAPI Filters". Any others are up to you. After installation, navigate to http://localhost. You should see the default IIS home page.

Integrating Tomcat with IIS 7 Let the fun begin. You need to download the Tomcat Connector from http://tomcat.apache.org/download-connectors.cgi. Mine was version 1.2.27. Make sure you get the correct version, Win32, ie isapi_redirect-1.2.227.dll. Create a directory under c:\inetpub called scripts and move your isapi_redirect-1.2.27.dll to the scripts folder. Next create a file isapi_redirect-1.2.27.properties in the same folder as the isapi_redirect-1.2.27.dll is. The isapi_redirect-1.2.27.properties file must have the same name as the dll and be in the same folder. Creating the properties files Next we will be creating 3 properties files, isapi_redirect-1.2.27.properties, workers.properties, uriworkermap.properties

isapi_redirect-1.2.27.properties
# 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.27.dll # Full path to the log file for the ISAPI Redirector log_file= C:\Program Files\Apache Software Foundation\Tomcat 6.0\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\Apache Software Foundation\Tomcat 6.0\conf\workers.properties # Full path to the uriworkermap.properties file worker_mount_file= C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\uriworkermap.properties #rewrite_rule_file= C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\rewrites.properties ##########################################################

Save in c:\inetpub\scripts

workers.properties
# 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 ####################################

Save in C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf

uriworkermap.properties

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

Save in C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf

Add Railo to Tomcat

Download the Railo jars files from http://railo.ch/en/index.cfm?treeID=224. Unzip them to C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib. Go to C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\server.xml. Add Next go to Go to C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\web.xml and add this right before the at the end of the file: CFMLServlet railo.loader.servlet.CFMLServlet configuration {web-root-directory}/WEB-INF/railo/ Configuraton directory 1 CFMLServlet *.cfm CFMLServlet *.cfml CFMLServlet *.cfc Then add: index.cfm index.cfml to the top of the tag.

 

Configure IIS 7
1. Open IIS 7 Manager
2. Navigate to your host.
3. Double click on the ISAPI and CGI Restrictions icon
4. On the right hand panel, click Add...
5. Point the path to your isapi_redirect-1.2.27.dll file and give it a description eg. tomcat
6. Check "Allow extension path to execute"
7. Now, click on the Default Website and navigate to ISAPI Filters.
8. On the right hand panel, click on Add... and point to your isapi_redirect-1.2.27.dll file, give the filter a name (eg. tomcat)
9. Navigate to your Default Website again
10. Add a virtual directory and name it jakarta, point this to the directory containing isapi_redirect-1.2.27.dll
11. Click on the newly created virtual directory jakarta
12. Navigate into Handler Mappings, on the right hand side you will see a panel called Actions. Click on Edit Feature Permissions and tick the execute permission.
13. Finally, navigate to your host context again and do a restart. Restart IIS and Tomcat (or just reboot the machine)

The Test
Create a file in c:\inetpub\wwwroot and call it test.cfm. In the test.cfm file add #now()# Navigate to http://yourhostname/test.cfm and you should see the date. You now have IIS7, Tomcat, and Railo talking the same language! WooWee! Any questions of comments, let me know. EDIT: This has now been fixed thanks to Gary. See the comments for more details.

[NOTE] One problem I am seeing is the index.cfm doesn't seem to be a "Default Document" I have added it both in IIS and Tomcat. If you browse to http://localhost/, you receive a 404.3 error. However, browsing to http://localhost/index.cfm works fine. The exact error is: HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Comments

Mike

Mike wrote on 03/31/09 11:20 PM

Hi Chris,

I was able to install Railo 3.x on my Tomcat 5.5.4 and I was able to make the index.cfm load by default. Here is what you should look for:

1) Open IIS7 and click on the website you want
2) Double click on "Default Document"
3) Is your entry for "index.cfm" with a lowercase "i" or uppercase "I"? If it's uppercase delete it and add a new one with a lowercase "i" like "index.cfm" and that should fix it.

I had the same issue when installed Railo 3.x on my Win 2008 64bit machine. Once I made this change it worked for me. One thing I wanted ask you is, do you know how I can access the Railo admin to configure datasources etc for my website?

Thank you,

Mike
Chris

Chris wrote on 04/01/09 10:36 AM

It is lower case. Not sure what's going on. Going to try the 3.1 version today because I noticed they have a jboss/iis connector.

Thanks for the tip tho.
Gary

Gary wrote on 04/03/09 1:14 AM

Any progress on the default document issue?
I've been looking around and I think it's a problem in IIS7 as opposed to Tomcat - but I've not had much luck finding a workaround.
It seems that IIS is using the default 'static handler' to process the file, rather than the ISAPI one.
Mike

Mike wrote on 04/03/09 1:28 AM

Are you using IIS7 32 or 64bit? I have Railo 3.0 + Tomcat 5.5.4 working on Win 2008 IIS7 64bit. I haven't had much success on a IIS7 32bit. For some odd reason it just will not work?
Gary

Gary wrote on 04/03/09 7:23 AM

I'm using 32 bit I'm afraid...
It all seems to work ok, (although I've only tried a test script thus far, not a full blown CF app) except the default document.
I think I might have to get it going with URL rewriting, or possibly catching the 404.
Chris

Chris wrote on 04/03/09 10:27 AM

Nope, still having the same problem. I agree, I think it is IIS, not tomcat.
Gary

Gary wrote on 04/06/09 8:55 AM

WEHEY!!!!
I got it working!

It's actually really simple, but I had to install the Railo JBoss MSI to see what it was doing differently.

This works for me:
1) Add the following line to the top of uriworkermap.properties:
/*=wlb
2) Restart IIS.
3) Rejoice.
4) Bang head agains wall for not thinking of that earlier.

If this doesn't work for you, then perhaps there is something else going on in the Railo JBoss MSI that enables this setting to work... I installed the MSI, took a look at the config files, then uninstalled the MSI, changed the uriworkermap.properties file in inetpub\scripts, restarted IIS and all was well.

Best of luck.
Gary

Gary wrote on 04/06/09 8:58 AM

Sorry, I meant I changed the uriworkermap.properties file in:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf
Chris

Chris wrote on 04/06/09 11:35 AM

That did it Gary! Can't believe I missed that too! Thanks. This also works with the 3.1 Beta!
Gary

Gary wrote on 04/06/09 11:51 AM

Great! Glad it worked for you too. ;)
Of course, I now have a million other little problems... but one at a time, ey?
Chris

Chris wrote on 04/06/09 1:47 PM

What other problems are you experiencing?
Gary

Gary wrote on 04/06/09 1:52 PM

Well, initially I was having the zerodatetimebehavior problem - for some reason the MySQL connector wasn't implementing the connection string - but I've resolved that by using the 'Other' option and entering the connection string manually...

Currently my big problem is trying to insert the results of a query into the 'Form' scope.

This code:
<cfscript>
Form = Application.cfcData.getData(Local.iDataID);
</cfscript>

Should put the results of the query into the Form scope, and works in CF.
However in Railo it's putting it into 'Variables.Form' - causing a problem with the rest of my code. Is it bad practice to manually place data into the Form scope? It's always worked well for me.
Mike

Mike wrote on 04/23/09 6:51 PM

Hi Chris,

It's been a while but I'm back. I've been trying to install Railo 3.0.2 + Tomcat 6.0 on my Win 2008 x86 but I can't seem to get it run? I keep getting IIS 500 internal server errors when I try to call my http://foo.com/index.cfm page. Here is the code:

<cfloop index="x" from="1" to="10">
<cfoutput>
<font size="#x#">#x#</font><br>
</cfoutput>
</cfloop>

This seems to work if I call http://foo.com:8080/index.cfm but not on port 80? I've also set the c:\inetpub\wwwroot\scripts\ permission to allow read/execute for IIS_IUSER but still getting 500 errors? I appreciate your help with this.

Thank you,

Mike
Chris

Chris wrote on 04/27/09 12:56 PM

Maybe a permission problem on the scripts folder? I gave IIS_IUSRS permission to it.
Mike

Mike wrote on 04/27/09 5:58 PM

Just gave IUSRS full control on c:\inetpub\scripts\ folder and still getting 500 error message. But if I try it using port 8080 it works fine. This is very strange. I keep having these Railo issues on Win 2008 32bit but all works fine in 64bit? I really appreciate all your help with this.

Mike
Chris

Chris wrote on 04/27/09 6:03 PM

I'm not sure. I have installed it on 64 bit fine also. I am starting to move to Apache as it is soooo much easier. Seems like IIS is not forwarding it to Tomcat. I would make sure the paths in your isapi_redirect-1.2.27.properties file are correct and that they all exists.

Leave a comment

Tell us about yourself
(required field)
(required field)
Comment and preferences
Leave this field empty: