caucho
Resin
FAQ
Reference Guide
Demo
Tutorial

Getting Started
Configuration
IDE
Topics
JSP
XML/XSLT

Resin Web Server
Unix Apache
Windows Apache
Unix Netscape
IIS
WebSite
 Resin with Netscape

Windows Apache
Getting Started
IIS

  1. Compiling caucho_nsapi.so
  2. Configuring Netscape by hand
    1. Load Balancing
  3. Configuring resin.conf
  4. Netscape's obj.conf
  5. Testing the servlet engine
  6. Servlet Engine Production
  7. Windows

Resin provides a fast servlet runner for Netscape, allowing Netscape to run servlets, JSP and XTP files.

To configure Resin with Netscape, you must follow the following steps:

  1. Compile caucho_nsapi.so
  2. Configure Netscape
  3. Configure resin.conf
  4. Restart Netscape and start srun

Compiling caucho_nsapi.so

To compile and install caucho_nsapi on Unix, you'll need to run configure and then make.

The argument to --with-netscape is the directory containing the netscape start and stop scripts, i.e. the parent of the config directory.

unix> ./configure --with-netscape=/usr/local/netscape/https-your-hostname
unix> make

If you need finer control over the Netscape configuration, you can use the following arguments to ./configure. Resin needs netscape-include and netscape-conf.

--with-netscape=dirThe Netscape root directory.
--with-netscape-include=dirThe Netscape include directory.
--with-netscape-conf=confThe Netscape obj.conf file

Configuring Netscape by hand

Making caucho_nsapi will automatically change your obj.conf file. For reference, here are the changes:

magnus.conf
Init fn="load-modules" shlib="<build-dir>/caucho_nsapi.so" \
   funcs="caucho_service,caucho_filter,caucho_status"
obj.conf
<Object name=default>
NameTrans fn="caucho_filter" conf="<resin-home>/resin.conf" name="resin"
NameTrans fn="assign-name" from="/caucho-status" name="caucho-status"
...
</Object>

<Object name="resin">
Service fn="caucho_service"
</Object>
<Object name="caucho-status">
Service fn="caucho_status"
</Object>

Note: Versions prior to iPlanet 6 put the Init in obj.conf.

Note: The caucho-status is optional and probably should be avoided in a production site. It lets you ask plugin module about the Caucho status, valuable for debugging.

Restart Netscape. Now browse http://localhost/caucho-status. It should return a table indicating that the servlet runner is stopped.

Browse http://localhost/test.jsp. It should return a message like:

Cannot connect to Servlet Runner.

Load Balancing

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, Resin will send the request to the next available machine.

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 details.

resin.conf
<caucho.com>
<http-server>
  <srun id="a"host='host1' port='6802'/>
  <srun id="b" host='host2' port='6802'/>
  <srun-backup id="c" host='backup port='6802'/>
  ...
</http-server>
</caucho.com>

Configuring resin.conf

By default, Resin will look in resin1.2/doc for JSP files and resin1.2/doc/WEB-INF/classes for servlets and beans. To tell Resin to use Netscape's document area, you configure the app-dir. Change app-dir from 'doc' to something like '/usr/local/netscape/doc'.

resin.conf
<caucho.com>
  <http-server
      app-dir='/usr/local/netscape/docs'>
    <servlet-mapping url-pattern='/servlets/*'
              servlet-name='invoker'/>

    <servlet-mapping url-pattern='*.xtp'
                        servlet-name='com.caucho.jsp.XtpServlet'/>
    <servlet-mapping url-pattern='*.jsp'
                        servlet-name='com.caucho.jsp.JspServlet'/>
  </http-server>
</caucho.com>

Netscape's obj.conf

Installing Resin with Netscape modifies Netscape's obj.conf file. For most users, the default installation will be fine. More sophisticated users will need to modify the obj.conf file.

Init fn=load-types mime-types=mime.types
# load resin shared library
Init fn="load-modules" shlib="/home/resin/libexec/caucho_nsapi.so" \
     funcs="caucho_service,caucho_filter,caucho_status"

<Object name=default>
# you can change the conf value
NameTrans fn="caucho_filter" conf="/home/resin/conf/resin.conf" name="resin"
# comment out the following in production sites
NameTrans fn="assign-name" from="/caucho-status" name="caucho-status"
NameTrans fn=pfx2dir from=/ns-icons dir="/usr/local/src/nes/ns-icons" name="es-internal"
NameTrans fn=pfx2dir from=/mc-icons dir="/usr/local/src/nes/ns-icons" name="es-internal"

...
</Object>

...

<Object name="resin">
Service fn="caucho_service"
</Object>

<Object name="caucho-status">
Service fn="caucho_status"
</Object>

Testing the servlet engine

Now you need to start the servlet engine.

> resin2.0/bin/httpd.sh

Now browse http://localhost/test.jsp. You should get a 'file not found' message.

Create a test file '/usr/local/netscape/htdocs/test.jsp'

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

Browse http://localhost/test.jsp again. You should now get

2 + 2 = 4

Servlet Engine Production

A better way to run the servlet engine in a production environment is to use the start and stop scripts. These scripts add extra reliability to the server. If Resin should ever exit, it will automatically be restarted.

To start the servlet runner, use

unix> resin-2.1.0/bin/httpd.sh start

To stop it, use

unix> resin2.0/bin/httpd.sh stop

Windows

On Windows, the setup program should configure the obj.conf. Except that you don't need to compile the plugin on windows, the configuration is identical.


Windows Apache
Getting Started
IIS
Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.