Caucho maker of Resin Server | Application Server (Java EE Certified) and Web Server


 

Resin Documentation

home company blog docs 
app server 
 Resin Server | Application Server (Java EE Certified) and Web Server
 

resin.xml: configuration overview


Overview of the Resin configuration: resin.properties for most common properties and resin.xml for full customization.

Overview

All Resin configuration is ultimately managed by the resin.xml. To keep configuration manageable, the resin.xml imports properties files like resin.properties, and xml files like cluster-default.xml and health.xml. Many sites will never need to change the resin.xml and can just modify the resin.properties.

Concepts and naming conventions

  • cluster - a collection of identically-configured servers.
  • environment - isolated class-loader contexts with shared resources: server, host and web-app are the main environments.
  • host - a HTTP virtual host.
  • proxy cache - HTTP proxy cache.
  • resource - drivers or services available to the application though JNDI or CDI like databases, JMS queues, custom CDI-configured service. Resin-specific resources include security, authenticators, health-checks and the rewrite/dispatch system.
  • rewrite/dispatch - the configuration for dispatching HTTP URLs to servlets and response codes like Apache's mod_rewrite.
  • server - a Resin JVM instance. There may be multiple servers on a machine.
  • watchdog - a JVM instance which watches over the Resin server and restarts the server if necessary.
  • web-app - a HTTP web-application which runs servlets.

resin.properties

The resin.properties defines properties used by the resin.xml for the Resin server and cluster. Many sites will only need to modify the resin.properties for their configuration.

Example: key resin.properties
# web-tier Triad servers: web-0 web-1 web-2
# web_servers      : 192.168.1.20:6810
# web.http          : 80

# app-tier Triad servers: app-0 app-1 app-2
app_servers      : 192.168.1.10:6800 192.168.1.11:6800

app.http          : 8080

setuid_user   : resin
setuid_group  : resin

home_cluster : app
elastic_cloud_enable : true

jvm_args  : -Xmx2048m -XX:MaxPermSize=256m

web_admin_enable  : true

admin_user     : my-admin
admin_password : {SSHA}G3UOLv0dkJHTZxAwmhrIC2CRBZ4VJgTB

The properties in resin.properties are converted into JSP EL variable used by the resin.xml, like port="${http}".

Properties can be qualified by the server's name or by its cluster. The app.http in the above example is the ${http} variable specific to the "app" cluster. You can also use app-0.http to define a custom http port for a specific server.

resin.xml

The resin.xml file is the root of Resin's configuration. Other files like the resin.properties and cluster-default.xml are imported files to organize the configuration. Conceptually, they're all delegated from the resin.xml.

The resin.xml configures clusters, servers, virtual hosts, web-app deployment, resources, health checks, and class-loaders. Almost all of Resin's behavior is configured by the resin.xml.

The standard resin.xml distributed with Resin and its property file reisn.properties configures a standard, flexible clustering system including an application server tier, a http web tier, and virtual hosts. Many sites will not need to modify the standard resin.xml.

The resin.xml is flexible enough to configure non-http servers. If you have a non-http Java service, it can take advantage of Resin's watchdog, lifecycle and health system by being configured as a standard CDI service in a non-http Resin system.

Example: resin.xml outline
<resin xmlns="http://caucho.com/ns/resin"
          xmlns:resin="urn:java:com.caucho.resin">

  <cluster-default>          
    <!-- shared configuration across all clusters -->
    
    <resin:import path="classpath:META-INF/caucho/app-default.xml"/>
    
    <resin:import path="${__DIR__}/health.xml" optional="true"/>
  </cluster-default>          
    
  <cluster id="my-cluster">

    <server-default>
      <!-- thread limits, JVM config, keepalives, ports, HTTP -->

      <http port="8080"/>
    </server-default>

    <server id="server-a" address="192.168.1.10" port="6800"/>
    <server id="server-b" address="192.168.1.11" port="6800"/>

    <host id="www.myhost.com" root-directory="hosts/myhost.com">

      <resin:MovedPermanently regexp="/old-file" target="/new-path"/>
    
      <web-app-deploy path="webapps"
           expand-preserve-fileset="WEB-INF/work/**"/>

      <web-app id="/custom">
      </web-app>
      
    </host>
  
  </cluster>
          
</resin>

Next Steps

  • resin.properties configuration shows how to customize basic configuration.
  • resin.xml configuration shows more advanced and specialized configuration.
  • command-line describes using the resinctl command line interface.
  • deployment deploying applications to a running server.
  • clustering describes clustering, cloud, and dynamic servers.
  • resin-admin describes the /resin-admin browser-based interface.
  • health describes the Resin health and monitoring system.
  • REST admin describes the REST interface for remote third-party admin integration.
  • Resin HTTP Web Server describes fast, scalable HTTP web server.
  • HTTP URL Rewrite describes Resin's URL rewriting (like mod_rewrite).
  • Security describes authentication, authorization and SSL.

Copyright © 1998-2015 Caucho Technology, Inc. All rights reserved. Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.