<document>
<localtoc/>

- See the index for a list of all the tags.
- See Web Application configuration for web.xml (Servlet) configuration.
- See Environment configuration for resources: classloader, databases, connectors, and resources.
- See Log configuration for access log configuration, java.util.logging, and stdout/stderr logging.

<parents>resin</parents>

<cluster> configures a set of servers used for load-balancing and for sharing distributed sessions.

<example> <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server id="a" address="192.168.0.1"/> <server id="b" address="192.168.0.2"/> <host id=""> <web-app-deploy path="webapps"/> </host> </cluster> </resin> </example>
id Name of the cluster required
<parents>resin</parents>

For reliability, Resin periodically checks the amount of free memory available. When the free memory drops below <min-free-memory>, even after garbage collection, Resin will force a JVM restart.

In general, application developers should use a heap profiler to eliminate memory leaks and OutOfMemoryErrors. Because an OutOfMemoryError can cause severe problems with the application, Resin detects the low memory before those errors can be thrown.

<default>1M</default>

<resin> is the top-level configuration tag for the resin.conf file. The <resin> tag needs to specify the Resin namespace, to allow for validation of the configuration file.

The environment of the top-level <resin> is the global classpath. This environment can be important for <log> configuration for threads which run with using only the global class loader. Because the <resin> environment does not have a dynamic class loader, dynamically loaded classes, like custom jars in resin/lib are not available.

<resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server id=""> <http address="*" port="8080"/> </server id=""> <resin:import path="app-default.xml"/> <host id=""/> <web-app id="/"/> </host> </cluster> </resin>
variable corresponding API
resin-home CauchoSystem.getResinHome()
server-root CauchoSystem.getServerRoot()
<parents>server, host</parents>

Specifies the root directory for the <server> and <host> contexts. All EL-style directory paths are relative to the root-directory.

Enable the use of the security manager for the JVM.

<example> <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <security-manager/> ...

See also:

- Security Manager

Add one or more security providers. Each entry specifies the name of a security provider class. The name is used to instantiate an instance of the object, which is then passed to .

<example> <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <security-provider> com.sun.net.ssl.internal.ssl.Provider </security-provider> <security-provider> example.MyProvider </security-provider> ... <parents>resin</parents>

Main configuration for the server, configuring ports, threads and virtual hosts.

- Common resources for all virtual hosts and web-apps.
- Thread pooling
- HTTP and SRUN/Cluster ports
- Caching
- virtual host configuration and common web-app-default

The <server> will generally contain a <class-loader> configuration which loads the resin/lib jars dynamically, allowing for system-wide jars to be dropped into resin/lib. <server> configures the main dynamic environment. Database pools common to all virtual hosts, for example, should be configured in the <server> block.

The <server> configures the <thread-pool> and a set of <http> and <srun> ports which share the thread pool. Requests received on those ports will use worker threads from the thread pool.

alternate-session-url-prefix a prefix to add the session to the beginning of the URL as a path prefix instead of the standard ;jsessionid= suffix. For clients like mobile devices with limited memory, this will allow careful web designers to minimize the page size. null
keepalive-max the maximum number of keepalive connections 512
keepalive-timeout the maximum time a connection is maintained in the keepalive state 120s
<server> ... <alternate-session-url-prefix>/~J=</alternate-session-url-prefix> ...
variable corresponding API
serverId server.getServerId()
root-dir server.getRootDirectory()
server-root server.getRootDirectory()
function corresponding API
jndi Jndi.lookup(String)
<parents>resin</parents>

Configures the maximum time Resin will wait for the server to shutdown gracefully before forcing an exit.

<default>60s</default> <parents>server</parents>

<thread-pool> configures the thread pool shared among all ports.

thread-max maximum number of working threads 200
spare-thread-min minimum number of spare working threads 5

<thread-max> is the absolute maximum number of connection worker threads allowed. <thread-max> may be limited by OS/JVM restrictions, especially the stack size. -Xss and/or ulimit -s may be required for large numbers of threads, e.g. "ulimit -s 2048" on some versions of Linux would allow for 1024 total threads in the JVM.

<spare-thread-min> configures Resin's adaptive thread pooling. Resin tries to keep <spare-thead-min> idle threads available at all time. Sites with large spikes in connection loads may need to increase the <spare-thread-min> value.

<parents>resin</parents>

Note: at present, this directive is deprecated because of timing issues with log file creation and ownership. It is recommended that you use some other method to remap port 80 to port 8080.

Configures the Unix setuid user name used after Resin binds the reserved ports as root.

There are some conventions for tag names that provide similar functionality.

<fileset> provides the ability to match a set of files. It is modelled after the ant tag by the same name.

dir the starting directory required
include an include pattern do not include all files
exclude an exclude pattern do not exclude any files

A pattern can contain two special characters: '*' and '**'. '*' matches any part of path, but does not match the path separator. '**' matches any part of a path, including the path separator.

<example> <fileset dir="lib"> <include name="*.jar"/> </fileset> MATCH lib/foo.jar MATCH lib/bar.jar NO MATCH lib/baz/foo.jar <example> <fileset dir="lib"> <include name="**/*.jar"/> </fileset> MATCH lib/foo.jar MATCH lib/bar.jar MATCH lib/baz/foo.jar

The is used in a number of places to determine the behaviour of a resource when the server starts.

The startup-mode has three values: "automatic", "lazy", and "manual".

- automatic - starts the resource on server start (default)
- lazy - starts the resource on the first use
- manual - waits for JMX to start the resource

The is used in a number of places to determine the behaviour of a resource when it is replaced or modified while the server is running.

The redeploy-mode has two values: "automatic", and "manual".

- automatic - restarts the resource when it is modified (web.xml, *.class, *.war, etc).
- manual - waits for JMX to restart the resource when changes occur.

</document>