Configuring IIS6 with Railo

Many times we have installed Railo on IIS. Here's a guideline on how to install Railo on Win2K3 with IIS6. You can also watch the video on how to install Railo and IIS6.

The Video is found at the bottom of this page. It has been converted with the new tag <cfvideo> and is displayed with the new tag <cfvideoplayer>.

  1. Download Railo and execute the setup executable file

  2. Check if Railo runs correctly by calling http://localhost:8600/index.cfm you should see the following:


  3. If Railo runs correctly IIS has to be configured. Go to Step 4.
    If Railo does not start, or you don't see the above screen, please try the following:
    • Check whether the service Railo 2.0 runs
    • If the service runs, please check whether the firewall is blocking the server to run
    • If the service does not run, please execute the following command in the {railo installation directory}

      C:\Program Files\Railo>
      httpd.exe -Xms512M -Xmx512M -conf conf/resin.conf -java_home jre -java_exe jre\bin\java
      Then the reason for Railo failing to start should be displayed
    • If Railo still does not run function properly, it is time to write an email to railo railo_talk@yahoogroups.com


  4. IIS and Resin need to mirror their configuration. So every host entry in the IIS (website) needs to reflect in the resin.conf found in the directory C:\Program Files\Railo\conf You might need to enter following lines inside the tag of the file:

    <host id="myweb.com"> <root-directory>d:/webroots/myweb.com</root-directory> <web-app id="/" document-directory="d:/webroots/myweb.com"/> </host>

    or to make it much more comfortable:

    <host regexp="(.+)">
    <host-name>${host.regexp[1]}</host-name>
    <root-directory>d:/webroots/${host.regexp[1]}</root-directory>
    <web-app id="/" document-directory="d:/webroots/${host.regexp[1]}"/>
    </host>

    In the second case resin determines with the help of a regular expression where to locate a certain webroot. So you only need to create a directory named d:\webroots\hostname and the setting is valid without having to restart the application server service. But I wouldn't recommend this kind of definition, because it can grant access to webroots without manually allowing it.

  5. Set up a new website according to your needs by using the according wizard.

  6. If not already existent, create a folder named scripts inside a common directory (eg. D:\webroots\).

  7. Copy the file C:\Program Files\Railo\Wind32\isapi_srun.dll into the created directory

  8. Inside the IIS management console navigate to the Web Service Extensions


  9. Click on Add new Web service extension


  10. Add the dll as a named extension and set it's status to Allowed
    Now your dll is a allowed extension you can use within the web site.

  11. If you want to use Railo globally with every website you create, right click on websites and follow the instructions below.
    • Click on "Web Sites" Properties
    • Click on Home Directory/Configuration
    • Add two Application Extension Mappings for .cfm and .cfc pointing to D:\webroots\scripts\isapi_srun.dll Please uncheck the Verify that file exists checkbox.

  12. If you only want a certain webhost to act on .cfm and .cfc files with Railo, you need to execute the above actions for the respective Website.

  13. Save the configuration of the IIS to disk, by selection All tasks/Save Configuration to disk in the context menu of the IIS server

  14. restart the IIS service All tasks/Restart IIS... Now the website should run with Railo.

  15. If you experience any issues with Railo, please follow the instructions on the following documentation page: http://www.caucho.com/resin-3.1/doc/install-iis.xtp

Get the Flash Player to see this player.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
John's Gravatar Are there also instructions for IIS7 available?
# Posted By John | 07.12.08 22:59
Gert Franz's Gravatar No not yet. But there will be soon. I will blogpost about it.

Gert
# Posted By Gert Franz | 08.12.08 14:04
Compu_guy's Gravatar I was wondering if anyone has sucessfully been able to connect Railo with IIS7 yet?
# Posted By Compu_guy | 03.01.09 15:37
Jason Durham's Gravatar I've faught all day to make Railo 3.0 Community run on a Win2k3 box that already had IIS6 installed on it. It would be very helpful to have updated instructions. My machine is now hosed and I'm frantically looking for a way to remove Railo and get IIS working properly.
# Posted By Jason Durham | 03.01.09 20:00
Brett's Gravatar With the latest download: ralio-3.0.1.000 the host entry needs to have the root directory set to "." rather than the document directory for it to work.
# Posted By Brett | 23.01.09 23:44
Matt's Gravatar following your instructions, i've been able to get coldfusion test files in the webroot to work properly, but loading sites deeper in has been a problem.

when i point my browser to for instance, http://localhost/site1/, it attempts to download the index.cfm file as opposed to executing it.

any clue as to where i'm screwing up the configuration?
# Posted By Matt | 13.03.09 18:28
Mike's Gravatar Hi,

I'm trying to set this up on my Vista 32bit machine with IIS7. I have it working on port 8600 but I can't seem to get it to work on port 80 with my CFM pages? This is what I have in my /railo/conf/resin.conf" file:

<!-- configures the default host, matching any host name -->
<host id="">
<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id="/">
<document-directory>C:/inetpub/wwwroot</document-directory>
</web-app>

<web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
<!--
- Administration application /resin-admin
-
- password is the md5 hash of the password.
- localhost is true to limit access to the localhost
-->
<prologue>
<resin:set var="resin_admin_password" value=""/>
<resin:set var="resin_admin_localhost" value="true"/>
</prologue>
</web-app>
</host>

<host id="foo.com">
<root-directory>C:/inetpub/wwwroot</root-directory>
<web-app id="/" document-directory="foo.com"/>
</host>

I've also added this domain in my host file as well. Every time I try to call:

http://foo.com/test.cfm

Which is my test script that prints the numbers 1 to 10 on the screen I get the following error in FireFox:

Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.

But if I run the script from this URL:

http://foo.com:8600/test.cfm

Everything works fine. Am I doing something wrong in my setup? Any help would be appreciated.

Thank you,

Mike
# Posted By Mike | 23.03.09 00:59
Adnan's Gravatar Well i need to know whether any one of you has tried to setup Railo on IIS5.1 (default IIS with XP).
I want to setup Railo on XP with IIS5.1.

Another question, this tutorial used Railo server, how can i achieve the same task with Railo Express. (developer edition)
# Posted By Adnan | 04.05.09 15:38
M. Vaughan's Gravatar GERT: Sorry I accidentally deleted the comment. Here it is again. Sorry M.


I'm having the same problem as Mike...

When I go to http://foo.com/test.cfm, I will get connection interrupted errors, but when I go to http://foo.com:8600/test.cfm, everything seems to work fine... Also interesting is that in either case, if I type the name of a non-existant cfm page, I will see an error page from railo stating the file cannot be found.

Suggestions?
# Posted By M. Vaughan | 11.05.09 09:14
Gert Franz's Gravatar M.
You should first of all contact our Mailing list: railo@googlegroups.com. Second, we'll try to replay the installation with a Resin 3.1.9 version as well since there were some issues with Resin 3.1.x below version 3.1.7. But in this case the installation needs to be made manually. Please check the corresponding documentation here:
http://classic.railo.ch/en/index.cfm?treeID=215
Gert
# Posted By Gert Franz | 11.05.09 09:17
jiaoyin's Gravatar how to setup more websites?
# Posted By jiaoyin | 04.07.09 05:05
Anthony Katgert's Gravatar No Gert I did not have fun with your tutorial, it still does not work, how about offering a license per VPS per month of using and have everything in good working order instead of offering these beta products
# Posted By Anthony Katgert | 18.07.09 12:47
Gert Franz's Gravatar Sorry Anthony that it didn't work as expected. The installation process is something straightforward. What's the issue? I would of course like to help if possible. Let me know...

Gert
# Posted By Gert Franz | 29.07.09 13:25
Railo Community's Gravatar Actually Anthony made a few simple mistakes nothing major we the "Railo community" where able to help out now he is a Railo convert. You IIS guide is really good but It might be nice to see this updated to 3.1 ( even though it's almost identical )
# Posted By Railo Community | 02.08.09 23:07
Mike's Gravatar Thank you so much for this! I tried setting Railo up once in the past and got quickly discouraged. This tutorial really made it EASY. THANK YOU! I'm now using Railo and I love it.
# Posted By Mike | 23.08.09 15:39
Ennio Bozzetti's Gravatar I followed this tutorial and I was able to get Railo to work on IIS6 on windows 2003... they only problem I have is that the root folder is not what I declared on the website on resin.conf like this

<host id="sptctest.com"> <root-directory>d:/websites/sptc</root-directory> <web-app id="/" document-directory="d:/websites/sptc"/> </host>

is this wrong?
# Posted By Ennio Bozzetti | 14.10.09 00:17
jbuda's Gravatar Is there a workaround for using port 80 in resin as opposed to 8600? Im getting the problem where i can see the website if i add the port into the url.

I have tried to change the default site in IIS6 to use a different port, but when i do and then try the website using Railo, i get a Bad Request error message.

Any help please!?
# Posted By jbuda | 03.12.09 12:04
Paul Kukiel's Gravatar If you follow this guide Railo will be connected to IIS and will be running over port 80 and 8600. The idea is that you only expose port 80 from behind your firewall. But to answer your question yes after you complete these steps Railo will be running on port 80 with IIS.
# Posted By Paul Kukiel | 03.12.09 15:54
Viktor Karpati's Gravatar Hi!
I have a strange problem. I am running VirtualBox with Windows 2003 Web Edition installed (it's my dev and test server). IIS6 + Resin + Railo works fine most of the time. All cfm webpages run correctly. However, when I try to reach http://www.mywebsite.com/railo-context, IIS throws a 404. Goodbye for form validation, cfimage, graphs, etc.
I can reach the administration panel only by adding port 8600 to the URL. Like http://www.mysite.com:8600/railo-context.
The problem seems to me, that IIS is trying to find the railo-context folder (which does not exist) before passing the request to Resin.
The funny thing is, that the some problem does not exist on my production server. There I can type http://www.mysite.com/railo-context, and it works. It is the same environment (Win2k3 + IIS + Resin + Railo).
Any idea?
# Posted By Viktor Karpati | 12.04.10 11:13
Gert Franz's Gravatar Vicor,

Have you unchecked the "Verify that file exists" checkbox under Application/Configuration/mapping IIS setting? If you leave that checkbox checked, IIS will verify whether the file exists or not. And since it is only a mapping that only Railo will know about, you need to uncheck that box.

Gert
# Posted By Gert Franz | 12.04.10 12:54
Martin's Gravatar This example DOES NOT work in real life. It simply does not work.
# Posted By Martin | 17.05.10 11:14
Gert Franz's Gravatar Martin,

I am sorry that the example does not work for you. What problems have you experienced? I install it always in the same way and I hardly have any problems. Can you give us a hint?

Gert
# Posted By Gert Franz | 17.05.10 14:27
Francis's Gravatar Hi Gert,
Is that possible to have both ColdFusion 8 and Railo will work with IIS 6 in Windows XP? Currently I'm having all my ColdFusion 8 sites running under IIS and now i Installed Railo and i'm able to access both the Web and Server Administrator as "http://localhost:8600/railo-context/admin/web.cfm&...; . But all we want to do is just need to use IIS as a web server for Railo and ColdFusion 8 version. Let me know is that possible.
# Posted By Francis | 24.05.10 08:07
hammeronthenet's Gravatar The sample-site I've created seems to work ok, but now I've got two problems:
- I'm unable to reach the railo's admin panel... in any manner I try it didn't work!
- If I write as URL something like "http://site/appdirectory";, the browser download me index.cfm in clear text. Obviously, if i write "http://site/appdirectory/index.cfm"; all works fine.
I post my resin.conf file (sorry if it's a bit long):
<!--
- Resin 3.1 configuration file.
-->
<resin xmlns="http://caucho.com/ns/resin";
xmlns:resin="http://caucho.com/ns/resin/core">;
<!-- adds all .jar files under the resin/lib directory -->
<class-loader>
<tree-loader path="${resin.home}/ext-lib"/>
<tree-loader path="${resin.root}/ext-lib"/>
<tree-loader path="${resin.home}/lib"/>
<tree-loader path="${resin.root}/lib"/>
</class-loader>
<!--
- Management configuration
-
- Remote management requires at least one enabled admin user.
-->
<management path="${resin.root}/admin">
<user name="admin" password="password" disable="true"/>
<resin:if test="${resin.professional}">
<deploy-service/>
<jmx-service/>
<log-service/>
<xa-log-service/>
</resin:if>
</management>
<!--
- Logging configuration for the JDK logging API.
-->
<log name="" level="info" path="stdout:"
timestamp="[%H:%M:%S.%s] {%{thread}} "/>
<!--
- 'info' for production
- 'fine' or 'finer' for development and troubleshooting
-->
<logger name="com.caucho" level="info"/>
<logger name="com.caucho.java" level="config"/>
<logger name="com.caucho.loader" level="config"/>
<!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>2s</dependency-check-interval>
<!--
- SMTP server for sending mail notifications
-->
<system-property mail.smtp.host="127.0.0.1"/>
<system-property mail.smtp.port="25"/>
<!--
- Sets the default character encoding to utf-8
-
- <character-encoding>utf-8</character-encoding>
-->
<!--
- You can change the compiler to "javac", "eclipse" or "internal".
-->
<javac compiler="internal" args="-source 1.5"/>
<!-- Security providers.
- <security-provider>
- com.sun.net.ssl.internal.ssl.Provider
- </security-provider>
-->
<!-- Uncomment to use Resin's XML implementations
-
- <system-property javax.xml.parsers.DocumentBuilderFactory
- ="com.caucho.xml.parsers.XmlDocumentBuilderFactory"/>
- <system-property javax.xml.parsers.SAXParserFactory
- ="com.caucho.xml.parsers.XmlSAXParserFactory"/>
-->
<cluster id="app-tier">
<!-- sets the content root for the cluster, relative to server.root -->
<root-directory>.</root-directory>
<server-default>
<!-- The http port -->
<http address="*" port="8600"/>
<!--
- SSL port configuration:
-
- <http address="*" port="8443">
- <openssl>
- <certificate-file>keys/gryffindor.crt</certificate-file>
- <certificate-key-file>keys/gryffindor.key</certificate-key-file>
- <password>test123</password>
- </openssl>
- </http>
-->
<!--
- The JVM arguments
-->
<jvm-arg>-Xmx256m</jvm-arg>
<jvm-arg>-Xss1m</jvm-arg>
<jvm-arg>-Xdebug</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
<!--
- Uncomment to enable admin heap dumps
- <jvm-arg>-agentlib:resin</jvm-arg>
-->
<!--
- arguments for the watchdog process
-->
<watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
<watchdog-port>6600</watchdog-port>
<!--
- Configures the minimum free memory allowed before Resin
- will force a restart.
-->
<memory-free-min>1M</memory-free-min>
<!-- Maximum number of threads. -->
<thread-max>256</thread-max>
<!-- Configures the socket timeout -->
<socket-timeout>65s</socket-timeout>
<!-- Configures the keepalive -->
<keepalive-max>128</keepalive-max>
<keepalive-timeout>15s</keepalive-timeout>
<!--
- If starting bin/resin as root on Unix, specify the user name
- and group name for the web server user.
-
- <user-name>resin</user-name>
- <group-name>resin</group-name>
-->
</server-default>
<!-- define the servers in the cluster -->
<server id="" address="127.0.0.1" port="6800"/>
<!--
- Configures the persistent store for single-server or clustered
- in Resin professional.
-->
<resin:if test="${resin.professional}">
<persistent-store type="cluster">
<init path="session"/>
</persistent-store>
</resin:if>
<!--
- For security, use a different cookie for SSL sessions.
- <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
-->
<!--
- Enables the cache (available in Resin Professional)
-->
<resin:if test="${resin.professional}">
<cache path="cache" memory-size="64M">
<!-- Vary header rewriting for IE -->
<rewrite-vary-as-private/>
</cache>
</resin:if>
<!--
- Enables periodic checking of the server status and
- check for deadlocks..
-
- All servers can add <url>s to be checked.
-->
<resin:if test="${resin.professional}">
<ping>
<!-- <url>http://localhost:8600/test-ping.jsp</url>; -->
</ping>
</resin:if>
<!--
- Defaults applied to each web-app.
-->
<web-app-default>
<prologue>
<!--
- Extension library for common jar files. The ext is safe
- even for non-classloader aware jars. The loaded classes
- will be loaded separately for each web-app, i.e. the class
- itself will be distinct.
-->
<class-loader>
<tree-loader path="${resin.root}/ext-webapp-lib"/>
</class-loader>
<!--
- Enable EL expressions in Servlet and Filter init-param
-->
<allow-servlet-el/>
</prologue>
<!--
- Sets timeout values for cacheable pages, e.g. static pages.
-->
<cache-mapping url-pattern="/" expires="5s"/>
<cache-mapping url-pattern="*.gif" expires="60s"/>
<cache-mapping url-pattern="*.jpg" expires="60s"/>
<cache-mapping url-pattern="*.png" expires="60s"/>
<!--
- for security, disable session URLs by default.
-->
<session-config>
<enable-url-rewriting>false</enable-url-rewriting>
</session-config>
<!--
- For security, set the HttpOnly flag in cookies.
- <cookie-http-only/>
-->
<!--
- Some JSP packages have incorrect .tld files. It's possible to
- set validate-taglib-schema to false to work around these packages.
-->
<jsp>
<validate-taglib-schema>true</validate-taglib-schema>
<fast-jstl>true</fast-jstl>
</jsp>
</web-app-default>
<!-- includes the app-default for default web-app behavior -->
<resin:import path="${resin.home}/conf/app-default.xml"/>
<!--
- Sample database pool configuration
-
- The JDBC name is java:comp/env/jdbc/test
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://localhost:3306/test</url>
<user></user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
-->
<!--
- Default host configuration applied to all virtual hosts.
-->
<host-default>
<!--
- With another web server, like Apache, this can be commented out
- because the web server will log this information.
-->
<access-log path="logs/access.log"
format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
rollover-period="1W"/>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"/>
<!-- creates the deploy directory for .ear expansion -->
<ear-deploy path="deploy">
<ear-default>
<ejb-server>
<config-directory>WEB-INF</config-directory>
</ejb-server>
</ear-default>
</ear-deploy>
<!-- creates the deploy directory for .rar expansion -->
<resource-deploy path="deploy"/>
</host-default>
<!-- configures a deployment directory for virtual hosts -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>
<!-- configures the default host, matching any host name -->
<host id="">
<!--
- configures an explicit root web-app matching the
- webapp's ROOT
-->
<web-app id="/">
<document-directory>C:/inetpub/wwwroot</document-directory>
</web-app>
<web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
<!--
- Administration application /resin-admin
-->
<prologue>
<resin:set var="resin_admin_external" value="false"/>
<resin:set var="resin_admin_insecure" value="true"/>
</prologue>
</web-app>
</host>
<host id="RailoTest">
<root-directory>C:/inetpub/wwwroot</root-directory>
<web-app id="/" document-directory="Railotest"/>
</host>
</cluster>
<!--
- Configuration for the web-tier/load-balancer
-->
<resin:if test="${resin.professional}">
<cluster id="web-tier">
<server-default>
<!-- The http port -->
<http address="*" port="9080"/>
</server-default>
<server id="web-a" address="127.0.0.1" port="6700"/>
<cache path="cache" memory-size="64M"/>
<host id="">
<web-app id="/">
<rewrite-dispatch>
<load-balance regexp="" cluster="app-tier"/>
</rewrite-dispatch>
</web-app>
</host>
</cluster>
</resin:if>
</resin>
Where is the problem???
# Posted By hammeronthenet | 25.05.10 13:38
spills's Gravatar Any IIS7 "official" instructions for Railo yet? I would love to give it a try on a 2008 box but I am concerned that I don't have all the info needed for "proper" installation i.e. resource management, security, setting up new sites, working with an existing ACF product.
# Posted By spills | 11.06.10 00:26
Gert Franz's Gravatar Sure,
just use the installers you find on projects.getrailo.org.
HTH
Gert
# Posted By Gert Franz | 11.06.10 10:46
spills's Gravatar @Gert the inststallers @ projects.getrailo.org are in beta and I would prefer Resin and not Tomcat which the installers package.
# Posted By spills | 12.06.10 22:50
Gert Franz's Gravatar Well it's more about hardening IIS afterwards, which is not a task that any installer should be responsible of. Anyway, if you don't want to check Google for it we are offering services like this on the commercial site. Let me know...

Gert
# Posted By Gert Franz | 15.06.10 19:42
AL's Gravatar I m trying to get this to work... so far ok. I have a virtual win 2003 with iis6 and its sort of working.

When i access a site, for instance localhost.. it excutes the cfm index file but it redirects it to /railo-context/
# Posted By AL | 23.07.10 17:09
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner