📄 resin.xtp
字号:
<document><header> <product>resin</product> <title>resin.xml: Ports, Virtual Hosts, Clustering and Threads</title> <version>Resin 3.0</version> <description> <p>Describes the resin, server, host, and port configuration in the resin.xml.</p> </description></header><body><localtoc/><s1 title="See Also"><ul><li>See the <a href="index-tags.xtp">index</a> for a list of all the tags.</li><li>See <a href="webapp.xtp">Web Application</a> configuration for web.xml (Servlet) configuration.</li><li>See <a href="config-env.xtp">Environment</a> configuration for resources: classloader, databases, connectors, and resources.</li><li>See <a href="config-log.xtp">Log</a> configuration for access log configuration, java.util.logging, and stdout/stderr logging.</li></ul></s1><defun title="<cluster>" version="Resin 3.0"><parents>resin</parents><p><cluster> configures a set of servers used for load-balancing and forsharing distributed sessions.</p><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><deftable-childtags><tr><td>id</td> <td>Name of the cluster</td> <td>required</td></tr></deftable-childtags></defun><defun title="<min-free-memory>" version="Resin 3.0"><parents>resin</parents><p>For reliability, Resin periodically checks the amount of freememory available. When the free memory drops below<min-free-memory>, even after garbage collection, Resin will forcea JVM restart.</p><p>In general, application developers should use a heap profilerto eliminate memory leaks and OutOfMemoryErrors. Because anOutOfMemoryError can cause severe problems with the application, Resindetects the low memory before those errors can be thrown.</p><default>1M</default></defun><defun title="<resin>" version="Resin 3.0"> <p><resin> is the top-level configuration tag forthe resin.xml file. The <resin>tag needs to specify the Resin namespace, to allow for validationof the configuration file.</p><p>The environment of the top-level <resin> is the global classpath.This environment can be important for <log> configurationfor 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 jarsin resin/lib are not available.</p><example title="resin"><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></example><deftable title="EL variables defined by <resin>"><tr><th>variable</th> <th>corresponding API</th> <th/></tr><tr><td>resin-home</td> <td>CauchoSystem.getResinHome()</td> <td/></tr><tr><td>server-root</td> <td>CauchoSystem.getServerRoot()</td> <td/></tr></deftable></defun><defun title="root-directory" version="Resin 3.0"><parents>server, host</parents><p>Specifies the root directory for the <server> and <host>contexts. All EL-style directory paths are relative tothe root-directory.</p></defun><defun title="security-manager"><p>Enable the use of the security manager for the JVM.</p><example><resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <security-manager/> ...</example><p>See also:</p><ul><li><a href="securitymanager.xtp">Security Manager</a></li></ul></defun><defun title="security-provider"><p>Add one or more security providers. Each entry specifies the name of asecurity provider class. The name is used to instantiate an instance of theobject, which is then passed to <a href="javadoc|java.security.Security|addProvider"/>.</p><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> ...</example></defun><defun title="server" version="Resin 3.0"><parents>resin</parents><p>Main configuration for the server, configuring ports,threads and virtual hosts.</p><ul><li>Common resources for all virtual hosts and web-apps.</li><li>Thread pooling</li><li>HTTP and SRUN/Cluster ports</li><li>Caching</li><li>virtual host configuration and common web-app-default</li></ul><p>The <server> will generally contain a <class-loader> configurationwhich loads the resin/lib jars dynamically, allowing for system-wide jarsto be dropped into resin/lib. <server> configuresthe main dynamic environment. Database pools common to all virtual hosts,for example, should be configured in the <server> block.</p><p>The <server> configures the <thread-pool> and a setof <http> and <srun> ports which share the thread pool.Requests received on those ports will use worker threads from thethread pool.</p><deftable-childtags><tr><td>alternate-session-url-prefix</td> <td>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.</td> <td>null</td></tr><tr><td>keepalive-max</td> <td>the maximum number of keepalive connections</td> <td>512</td></tr><tr><td>keepalive-timeout</td> <td>the maximum time a connection is maintained in the keepalive state</td> <td>120s</td></tr></deftable-childtags><example title="alternate-session-url-prefix"><server> ... <alternate-session-url-prefix>/~J=</alternate-session-url-prefix> ...</example><s2 name="server-el" title="EL variables and functions"><deftable title="EL variables defined by <server>"><tr><th>variable</th> <th>corresponding API</th></tr><tr><td>serverId</td> <td><i>server</i>.getServerId()</td></tr><tr><td>root-dir</td> <td><i>server</i>.getRootDirectory()</td></tr><tr><td>server-root</td><td><i>server</i>.getRootDirectory()</td></tr></deftable><deftable title="EL functions defined by <server>"><tr><th>function</th> <th>corresponding API</th></tr><tr><td>jndi</td> <td><a href="javadoc|com.caucho.naming.Jndi|lookup(String)">Jndi.lookup(String)</a></td></tr></deftable></s2></defun> <!-- server --><defun title="shutdown-wait-max" version="Resin 3.0"><parents>resin</parents><p>Configures the maximum time Resin will wait for the server toshutdown gracefully before forcing an exit.</p><default>60s</default></defun><defun title="<thread-pool>" version="Resin 3.0"><parents>server</parents><p><thread-pool> configures the thread pool shared among all ports.</p><deftable-childtags><tr><td>thread-max</td> <td>maximum number of working threads</td> <td>200</td></tr><!--<tr><td>spare-thread-max</td><td>maximum number of spare working threads</td><td>20</td></tr>--><tr><td>spare-thread-min</td><td>minimum number of spare working threads</td><td>5</td></tr></deftable-childtags><p><thread-max> is the absolute maximum number of connection workerthreads allowed. <thread-max> may be limited by OS/JVMrestrictions, especially the stack size. -Xss and/or ulimit -s may berequired for large numbers of threads, e.g. "ulimit -s 2048" on someversions of Linux would allow for 1024 total threads in the JVM.</p><!--<p><spare-thread-max> and <spare-thread-min> configure Resin'sadaptive thread pooling. Resin tries to keep between <spare-thead-min>and <spare-thread-max> idle threads available at all time. Siteswith large spikes in connection loads may need to increase the<spare-thread-min> value.</p>--><p><spare-thread-min> configures Resin'sadaptive thread pooling. Resin tries to keep <spare-thead-min>idle threads available at all time. Siteswith large spikes in connection loads may need to increase the<spare-thread-min> value.</p></defun><defun title="user-name" version="Resin 3.0"><parents>resin</parents><p>Note: at present, this directive is deprecated because of timingissues with log file creation and ownership. It is recommended thatyou use some other method to remap port 80 to port 8080.</p><p>Configures the Unix setuid user name used after Resin binds thereserved ports as root.</p></defun><s1 name="common" title="Common Tags"><p>There are some conventions for tag names that provide similar functionality.</p><s2 title="fileset" version="Resin 3.0.7" type="defun"><p><fileset> provides the ability to match a set of files. It ismodelled after the ant tag by the same name.</p><deftable-childtags><tr><td>dir</td> <td>the starting directory</td> <td>required</td></tr><tr><td>include</td> <td>an include pattern</td> <td>do not include all files</td></tr><tr><td>exclude</td> <td>an exclude pattern</td> <td>do not exclude any files</td></tr></deftable-childtags><p>A pattern can contain two special characters: '*' and '**'. '*' matches anypart of path, but does not match the path separator. '**' matches any part ofa path, including the path separator. </p><example><fileset dir="lib"> <include name="*.jar"/></fileset>MATCH lib/foo.jarMATCH lib/bar.jarNO MATCH lib/baz/foo.jar</example><example><fileset dir="lib"> <include name="**/*.jar"/></fileset>MATCH lib/foo.jarMATCH lib/bar.jarMATCH lib/baz/foo.jar</example></s2></s1> <!-- common --><s1 name="startup-mode" title="Startup and Redeploy Mode"><p>The <a config-tag="startup-mode"/> is used in a number of places todetermine the behaviour of a resource when the server starts.</p><p>The startup-mode has three values: "automatic", "lazy", and "manual".</p><ul><li>automatic - starts the resource on server start (default)</li><li>lazy - starts the resource on the first use</li><li>manual - waits for JMX to start the resource</li></ul><p>The <a config-tag="redeploy-mode"/> is used in a number of places todetermine the behaviour of a resource when it is replaced or modified while theserver is running.</p><p>The redeploy-mode has two values: "automatic", and "manual".</p><ul><li>automatic - restarts the resource when it is modified (web.xml, *.class, *.war, etc).</li><li>manual - waits for JMX to restart the resource when changes occur.</li></ul></s1> <!-- startup-mode --></body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -