| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Describes the cluster configuration tags. See Also
access-log child of server, host Specifies the access log file.
The variable controls how often the access log will be rotated. When the time runs out, Resin will move the old log file to a timestamped one, e.g. access.log20001114. Rollovers happen at midnight in the local time if the time period is a day or longer.The access log formatting variables follow the Apache variables:
The default format is:
The default format is:
<server> <access-log id='log/access.log'> <rollover-period>2W</rollover-period> </access-log> ... </server> If the web-app doesn't specify an access-log, it will use the host's access-log. cache child of server Configures Resin's internal HTTP proxy cache. Resin's cache can dramatically improve performance by avoiding re-evaluation of slowly changing database-backed changes. We strongly recommend using the proxy caching when possible for a simple, standards-based performance boost. Using the proxy cache is described more fully in the caching documentation.
cluster child of server Defines the cluster of Resin JVMs used for load-balancing and for sharing distributed sessions. <cluster> <client-live-time>30s</client-live-time> <srun id="a" host="192.168.0.1" port="6802" index="1"/> <srun id="b" host="192.168.0.2" port="6802" index="2"/> </cluster>
host child of server Configures a virtual host. Virtual hosts must be configured explicitly.
<host host-name="www.foo.com"> <host-alias>foo.com</host-alias> <host-alias>web.foo.com</host-alias> <root-directory>/opt/www/www.foo.com</root-directory> <web-app id="/" document-directory="webapps/ROOT"> </web-app> ... </host> <host regexp="([^.]+)\.foo\.com"> <host-name>${'${'}host.regexp[1]}.foo.com</host-name> <root-directory>/opt/www/www.${'${'}host.regexp[1]}.com</root-directory> ... </host> It is recommended that any <host> using a regexp include a <host-name> to set the canonical name for the host. host-default child of server, host-deploy Defaults for a virtual host. The host-default can contain any of the host configuration tags. It will be used as defaults for any virtual host. host-deploychild of serverConfigures a deploy directory for virtual host. The host-deploy will add an EL variable \${name}, referring to the name of the host jar file.
httpchild of serverConfigures a HTTP port listening for HTTP requests. When configuring multiple JVMs, each <http> will have a unique <server-id> which allows the -server command-line to select which ports the server should listen to.
The @virtual-host attribute overrides the browser's Host directive,
specifying the explicit host and port for
min-free-memorychild of resinFor 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 1Mopensslchild of http, srun, portConfigures SSL.
More documentation is available in the Security section. The mod_ssl documentation for Apache is a good source of information on OpenSSL.
The class that corresponds to <openssl> is com.caucho.vfs.OpenSSLFactory. persistent-storechild of serverDefines the cluster-aware persistent store used for sharing distributed sessions. The allowed types are "jdbc", "cluster" and "file". The "file" type is only recommended in single-server configurations. The <persistent-store> configuration is in the <server> level because it needs to share update information across the active cluster and the <cluster> definition is at the <server> level. Sessions activate the persistent store with the <use-persistent-store> tag of the <session-config>. See Persistent sessions for more details. <resin xmlns="http://caucho.com/ns/resin"> <cluster> <server id="a"> <cluster-port address="192.168.0.1" port="6800"/> </server> <server id="b"> <cluster-port address="192.168.0.2" port="6800"/> </server> <persistent-store type="jdbc"> <init> <data-source>jdbc/session</data-source> <max-idle-time>24h</max-idle-time> </init> </persistent-store> <web-app-default> <session-config use-persistent-store="true"/> </web-app-default> </cluster> </resin>
pingchild of serverStarts a thread that periodically makes a request to the server, and restarts Resin if it fails. This facility is used to increase server reliability - if there is a problem with the server (perhaps from a deadlock or an exhaustion of resources), the server is restarted. A failure occurs if a request to the url returns an HTTP status that is not 200. Since the local process is restarted, it does not make sense to specify a url that does not get serviced by the instance of Resin that has the ping configuration. Most configurations use url's that specify 'localhost' as the host. This pinging only catches some problems because it's running in the same process as Resin itself. If the entire JDK freezes, this thread will freeze as well. Assuming the JDK doesn't freeze, the PingThread will catch errors like deadlocks. <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <cluster id="app-tier"> <ping url="http://localhost/"/> ... </cluster> </cluster> <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <cluster id="app-tier"> <ping> <url>http://localhost:8080/index.jsp</url> <url>http://localhost:8080/webapp/index.jsp</url> <url>http://virtualhost/index.jsp</url> <url>http://localhost:443/index.jsp</url> <sleep-time>5m</sleep-time> <try-count>5</try-count> <!-- a very busy server --> <socket-timeout>30s</socket-timeout> </ping> ... </cluster> </resin>
The class that corresponds to <ping> is com.caucho.server.admin.PingThread. Mail notification when ping failsA refinement of the ping facility sends an email when the server is restarted. <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <server> <ping resin:type="com.caucho.server.admin.PingMailer"> <url>http://localhost:8080/index.jsp</url> <url>http://localhost:8080/webapp/index.jsp</url> <mail-to>[email protected]</mail-to> <mail-from>[email protected]</mail-from> <mail-subject>Resin ping has failed for server ${'${'}server.name}</mail-subject> </ping> ... </server> </resin> portchild of serverThe port tag allows for custom protocols using Resin's thread and connection management. The custom protocol will extend from com.caucho.server.port.Protocol. <server> <port id="" host="localhost" port="8888"> <protocol resin:type="example.Magic8BallProtocol"/> </port> </server> resinTop-level configuration 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"> <server> <http id='' host='*' port='8080'/> <resin:import path="app-default.xml"/> <host id=""/> <web-app id="/"/> </host> </server> </resin>
The class that corresponds to this tag is com.caucho.server.resin.ResinServer root-directorychild of server, hostSpecifies the root directory for the <server> and <host> contexts. All EL-style directory paths are relative to the root-directory. security-managerEnable the use of the security manager for the JVM. <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <security-manager/> ... See also: security-providerAdd 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 java.security.Security. <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> ... serverchild of resinMain configuration for the server, configuring ports, threads and virtual hosts.
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.
<server> ... <alternate-session-url-prefix>/~J=</alternate-session-url-prefix> ... The class that corresponds to <server> is com.caucho.server.resin.ServletServer EL variables and functions
shutdown-wait-maxchild of resinConfigures the maximum time Resin will wait for the server to shutdown gracefully before forcing an exit. default 60ssrunchild of clusterConfigures a clustered HMUX listener. When configuring Resin in a load-balanced cluster, each Resin instance will have its own <srun> configuration, which Resin uses for distributed session management and for the load balancing itself. When configuring multiple JVMs, each <srun> will have a unique <server-id> which allows the -server command-line to select which ports the server should listen to.
The class that corresponds to <srun> is com.caucho.server.cluster.ClusterPort
|