caucho
Resin
FAQ
Reference Guide
Demo
Tutorial

Getting Started
Configuration
IDE
Topics
JSP
XML/XSLT

Virtual Hosts
Balancing
Distributed Sessions
Caching
JavaScript
Filters
Servlets
Admin
WebDAV
Velocity
EJB Clients
JMX
Burlap
Hessian
 Servlet Library

Filters
Topics
Admin

Admin Servlet

Resin 2.0.5 provides a primitive status servlet /resin-status. It's disabled by default to avoid any security issues. The servlet must be enabled explicitly, like:

<web-app id='/admin'>
  <allow-admin>true</allow-admin>
  <servlet-mapping url-pattern='/resin-status'
                   servlet-name='com.caucho.http.servlet.ResinStatusServlet'>
    <init-param enable='read'/>
  </servlet-mapping>

  <!-- only allow the localhost to use the admin --> 
  <security-constraint>
    <ip-constraint>127.0.0.1/32</ip-constraint>

    <web-resource-collection>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
  </security-constraint>
</web-app>

The allow-admin also puts a com.caucho.http.admin.ApplicationAdmin object in the servlet context as caucho.admin.

LoadBalanceServlet

Configures a front-end Resin instance to load-balance requests to backend Resin instances. Each LoadBalanceServlet instance will distribute the requests to a configured srun-group.

The backend Resin instances will need to have separate resin.conf files so they will handle the request instead of forwarding the requests back to themselves.

If the request already has a session, the backend server maching that session will be used, i.e. LoadBalanceServlet supports sticky-sessions. Otherwise, the least busy backend server will be used as counted by number of active requests. If several backend servers are equally busy, the selection uses a round-robin to distribute the load.

<caucho.com>
<http-server>

  <http id='front' port='8080'/>

  <srun id='a' srun-group='backend'
        host='192.168.0.1' port='6802'/>
  <srun id='b' srun-group='backend'
        host='192.168.0.2' port='6802'/>

  <web-app>
    <servlet servlet-name='com.caucho.http.servlet.LoadBalanceServlet'>
      <init-param srun-group='backend'/>

    <servlet-mapping url-pattern='*.jsp'
                    servlet-name='backend'/>

    <servlet-mapping url-pattern='/remote/*'
                    servlet-name='backend'/>
  </web-app>

</http-server>
</caucho.com>

CGIServlet

Implements CGI calls.

<web-app>
  <servlet-mapping url-pattern='*.cgi'
                  servlet-name='com.caucho.http.servlet.CGIServlet'/>
</web-app>

FastCGIServlet

Implements the FastCGI protocol. FastCGI allows some CGI clients like PHP to run quicker and more efficiently.

<web-app>
  <servlet-mapping url-pattern='*.php'
                  servlet-name='com.caucho.http.servlet.FastCGIServlet'>
      <init-param server-address='localhost:6666'/>
  </servlet-mapping>
</web-app>

Assuming PHP has been compiled with -fastcgi enabled, you might start PHP like:

unix> /opt/resin/bin/fastcgirunner.pl -port 6666 php


Filters
Topics
Admin
Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.