Resin provides a fast servlet runner for IIS 4.0 and PWS, allowing IIS
to run servlets and JSP files.
To configure Resin with IIS, you must follow the following steps:
- Configure IIS/PWS
- Configure resin.conf
- Start httpd
You should use resin-2.1.0/bin/setup.exe to setup your configuration.
If you use setup.exe, you can just skip to the next section.
ISAPI Filter Priority
isapi_srun.dll installs itself as the default priority. Some users may need
to set the priority to a higher level, e.g. to override IIS's DAV support.
resin.conf should mirror the configuration of IIS. In other words, you
need to configure the document root and any directory aliases.
For many users, you only need to change the path-mapping attributes.
attribute from 'doc' to something like 'd:\inetpub\wwwroot'. For more
complicated configurations, you'll need to add
Testing the servlet engine
From the Resin bin folder, you need to start httpd.exe to start the
Now browse http://localhost/test.jsp. You should get a 'file not
Create a test file 'd:\inetpub\wwwroot\test.jsp'
2 + 2 = <%= 2 + 2 %>
Browse http://localhost/test.jsp again. You should now get
As a final test, change language to 'java' and refresh the page.
Nothing should change.
The following configuration line arguments are recognized by httpd.exe.
When installed as a service, these argument will be used when
the service starts.
|-verbose||Write more verbose information to the log file
|-resin_home <path>||Sets the location of Resin
|-java_home <path>||Specify the JDK location
|-msjava||Use Microsoft's JVM
|-nojit||Disable JIT compilation to help debugging
|-classpath <cp>||Add to the classpath
|-J<arg>||Set a Java command line argument, e.g. -J-nojit.
|-X<arg>||Set a Java -X command line argument, e.g. -Xms128m.
|-D<foo=bar>||Set a Java variable, e.g. -Dresin.home=here.
|-install||Install as an NT service
|-install-as <name>||Install as an NT service with the specific name.
|-remove||Remove as an NT service
|-remove-as <name>||Remove as an NT service with the specific name.
Memory configuration is part of the JVM's arguments. For most JVMs,
you can find the full list by starting "java -X".
|-Xms<size>||Initial Java heap size, e.g. -Xms32m
|-Xmx<size>||Maximum Java heap size, e.g. -Xmx128m
|Deploying as an NT Service|
Once you're comfortable with using Resin with IIS, you can install it
as an NT service. As a service, Resin will automatically start when
NT reboots. The service will automatically restart Resin if it
To install the service, use
dos> resin-2.1.0/bin/httpd -install
To remove the service, use
dos> resin-2.1.0/bin/httpd -remove
You will either need to reboot the machine or start the service
from the Control Panel/Services panel to start the server. On a
machine reboot, NT will automatically start the servlet runner.
Note: There is a bug in many JDKs which cause the JDK to exit when the
administrator logs out. JDK 1.3 and later can avoid that bug if the
JDK is started with -Xrs.
dos> resin-2.1.0/bin/httpd -install -Xrs
In Resin 1.2, you can distribute requests to multiple machines. All
requests in a session will go to the same host. In addition, if one
host goes down, the IIS filter will send the request to the next
In addition, you can specify backup machines. The backup only will serve
requests if all primaries are down.
See the http config section for more
<srun id="a" host='host1' port='6802'/>
<srun id="b" host='host2' port='6802'/>
<srun-backup id="c" host='backup' port='6802'/>
Experts may want to configure Resin/IIS by hand instead
of using the setup program. If you need to know the steps involved:
- Make sure httpd.exe works
- If you have a virtual site, you must have the virtual directory
- Copy isapi_srun.dll to the IIS scripts directory, .
You may need to run .
- (optional) Create a resin.ini in pointing to the resin.conf.
- Configure IIS to load isapi_srun.dll as an ISAPI filter.
- Restart IIS (control panel/services) or followed
- Browse /servlet/Hello and /foo.jsp.
You should see a "cannot connect" error.
- Start httpd.exe
- Browse /servlet/Hello and /foo.jsp. You should now see the servlet.
Copying isapi_srun.dll to
directory is relatively
straightforward. If you're upgrading to a new version of Resin, you
may need to stop IIS (control panel/services) to get permission to
The resin.ini is an optional file in
override the automatic registry $RESIN_HOME/conf/resin.conf configuration
file. If you only have one Resin server, you should not create a resin.ini
and let isapi_srun.dll use the registry value set by the setup.exe program.
resin.ini is only needed if you have multiple Resin configuration
files for different IIS virtual hosts.
The resin.ini should contain the following line:
Adding an ISAPI filter is accomplished in the IIS manager.
- Check your configuration with the standalone bin/httpd.
In other words, add a <http port='8080'/> block and
- Check . That will tell if
the ISAPI filter/extension is properly installed.
- Each srun host should be green and the mappings should
match your resin.conf.
- If caucho-status fails entirely, the problem is in the
(bypassing the filter). If this fails, IIS can't find isapi_srun.dll.
- Check that isapi_srun.dll is in
- Make sure that your IIS host has a mapping from
to and that the has execute
- If you've created a new
IIS web site, you need to create a virtual directory pointing
to the directory.
- If caucho-status shows the wrong mappings, there's something wrong
with the resin.conf.
- If caucho-status shows a red servlet runner, then httpd.exe hasn't
- If you get a "cannot connect to servlet engine", caucho-status
will show red, and httpd.exe hasn't started properly.
- If httpd.exe doesn't start properly, you should look at the logs
in resin2.0/log. You should start to get
- If you get Resin's file not found, the IIS configuration
is good but the resin.conf probably points to the wrong directories.
|Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.|
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.