📄 host-tags.xtp
字号:
an archive is redeployed</td> <td></td></tr><tr> <td>expand-directory</td> <td>path to the expansion directory</td> <td>path</td></tr><tr> <td>host-default</td> <td>defaults for the expanded host</td> <td></td></tr><tr> <td>host-name</td> <td>the default hostname, based on the directory</td> <td>${name}</td></tr></deftable><def title="<host-deploy> schema">element host-deploy { archive-directory? & expand-cleanup-fileset? & expand-directory? & host-default? & host-name? & path?}</def><p>The following example configures <var>/var/www/hosts</var> asa host deployment directory. Each virtual host will have a<var>webapps</var> directory for .war deployment. So the directory<var>/var/www/hosts/www.foo.com/webapps/bar/test.jsp</var> wouldserve the URL <var>http://www.foo.com/bar/test.jsp</var>.</p><example title="<host-deploy>"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <root-directory>/var/www</root-directory> <host-deploy path="hosts"> <host-default> <resin:import path="host.xml" optional="true"/> <web-app-deploy path="webapps"/> </host-default> </host-deploy> </cluster></resin></example></defun><defun title="<host-name>"><p><host-name> defines the canonical name for a virtual host.The <host-name> will be used in Resin's logging, management, andis available in the host's variables.</p><def title="<host-host> schema">element host-name { string}</def></defun><defun title="<redeploy-mode>"><p><redeploy-mode> configures the virtual-host's behavior whenit detects changes in configuration files or classes. The<dependency-check-interval> controls how often the virtual hostwill check for updates.</p><deftable title="startup-mode values"><tr> <th>Mode</th> <th>Description</th></tr><tr> <td>automatic</td> <td>automatically restart when detecting changes</td></tr><tr> <td>manual</td> <td>only restart only on a JMX administration request</td></tr></deftable><def title="<restart-mode> schema">element startup-mode { string}</def></defun><defun title="Resources" version="Resin 3.1"><parents>resin, cluster, host, web-app</parents><p>All <a href="env-tags.xtp">Resource tags</a> areavailable to the <host>, for example, resourceslike <database> or <authenticator>. Resources defined atthe host level are available for all web-apps in the host.</p><example title="Example: shared database in host"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server id="a" .../> <host id="www.foo.com"> <database jndi-name="jdbc/test"> <driver type="org.postgresql.Driver"> <url>jdbc:postgresql://localhost/test</url> <user>caucho</user> </driver> </database> <web-app-default path="webapps"/> </host> </cluster></resin></example></defun><defun title="<rewrite-dispatch>" version="Resin 3.1"><parents>cluster, host, web-app</parents><p><rewrite-dispatch> defines a set of rewriting rules fordispatching and forwarding URLs. Applications can use these rulesto redirect old URLs to their new replacements.</p><p>See <a href="rewrite-tags.xtp">rewrite-dispatch</a> for moredetails.</p><example title="rewrite-dispatch"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <host host-name="www.foo.com"> <rewrite-dispatch> <redirect regexp="^/foo" target="/index.php?foo="/> </rewrite-dispatch> </host> </cluster></resin></example></defun><defun title="<root-directory>" version="Resin 3.1"><p><root-directory> configures the virtual host's filesystem root.</p><p>Because the virtual host's root will typically contain non-public files likelog files, all web-apps should have a path below the host.</p><def title="<root-directory> schema">element root-directory { string}</def></defun><defun title="<secure-host-name>"><p><secure-host-name> sets a host-name or URL to be used for secureredirection. For some security configurations, Resin needs to redirect froman insecure site to a secure one. The <secure-host-name> configuresthe host to redirect to.</p><p>See <a href="resin-security.xtp">Resin security</a>.</p><def title="<secure-host-name> schema">element secure-host-name { string}</def></defun><defun title="<startup-mode>"><p><startup-mode> configures the virtual-host's behavior on Resin startup,either "automatic", "lazy" or "manual".</p><deftable title="startup-mode values"><tr> <th>Mode</th> <th>Description</th></tr><tr> <td>automatic</td> <td>automatically start when Resin starts</td></tr><tr> <td>lazy</td> <td>start only when the first request is received</td></tr><tr> <td>manual</td> <td>start only when JMX administration requests a start</td></tr></deftable><def title="<startup-mode> schema">element startup-mode { string}</def></defun><defun title="<web-app>"><parents>host, web-app</parents><p><web-app> configures a web application.</p><deftable title="<web-app> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>id</td> <td>The url prefix selecting this application.</td> <td>n/a</td></tr><tr> <td>url-regexp</td> <td>A regexp to select this application.</td> <td>n/a</td></tr><tr> <td>document-directory</td> <td>The document directory forthe application, corresponding to a url of <var>/<i>id</i>/</var>. A relative path is relative to the <a config-tag="root-directory"/> of the containing <a config-tag="host"/>. Can use regexp replacement variables.</td><td>A relative path constricted with the id or the regexp match</td></tr><tr> <td>startup-mode</td> <td>'automatic', 'lazy', or 'manual', see <a href="resin.xtp#startup-mode">Startup and Redeploy Mode</a></td> <td>automatic</td></tr><tr> <td>redeploy-mode</td> <td>'automatic' or 'manual', see <a href="resin.xtp#startup-mode">Startup and Redeploy Mode</a></td> <td>automatic</td></tr></deftable><p>When specified by <var>id</var>, the application will be initialized onserver start. When specified by <var>url-regexp</var>, the applicationwill be initialized at the first request. This means that<var>load-on-startup</var> servlets may start later than expected for<var>url-regexp</var> applications.</p><p>The following example creates a web-app for /apacheusing the Apache htdocs directory to serve pages.</p><example title="Example: custom web-app root" ><resin xmlns="http://caucho.com/ns/resin"><cluster id="app-tier"><host id=''> <web-app id='/apache' root-directory='/usr/local/apache/htdocs'> ...</host></cluster></resin></example><p>The following example sets the root web-app to the IISroot directory. </p><example title="Example: IIS root directory"><resin xmlns="http://caucho.com/ns/resin"><cluster id="app-tier"><host id=''> <web-app id='/' root-directory='C:/inetpub/wwwroot'></host></cluster></resin></example><p>When the <var>web-app</var> is specified with a <var>url-regexp</var>,<var>root-directory</var> can use replacement variables (<var>$2</var>).</p><p>In the following, each user gets his or her own independentapplication using <var>~user</var>.</p><example title="Example: web-app root based on regexps"><resin xmlns="http://caucho.com/ns/resin"><cluster id="app-tier"> <host id=''> <web-app url-regexp='/~([^/]*)' root-directory='/home/$1/public_html'> ... </web-app></host></cluster></resin></example></defun><defun title="<web-app-default>"><parents>cluster, host, web-app</parents><p><web-app-default> configures common values for all web applications.</p></defun><defun title="<web-app-deploy>" type="defun"><parents>host, web-app</parents><p>Specifies war expansion.</p><p>web-app-deploy can be used in web-apps to define a subdirectoryfor war expansion. The tutorials in the documentationuse web-app-deploy to allow servlet/tutorial/helloworld to be anindependent war file.</p><deftable title="<web-app-deploy> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>archive-directory</td> <td>directory containing the .war files</td> <td>value of <var>path</var></td></tr><tr> <td>expand-cleanup-fileset</td> <td>defines the files which should be automatically deletedwhen an updated .war expands</td> <td>all files</td></tr><tr> <td>expand-directory</td> <td>directory where wars should be expanded</td> <td>value of <var>path</var></td></tr><tr> <td>expand-prefix</td> <td>prefix string to use when creating the expansion directory, e.g. _war_</td> <td></td></tr><tr> <td>expand-suffix</td> <td>prefix string to use when creating the expansion directory, e.g. .war</td> <td></td></tr><tr> <td>path</td> <td>The path to the webapps directory</td> <td>required</td></tr><tr> <td>redeploy-check-interval</td> <td>How often to check the .war files for a redeploy</td> <td>60s</td></tr><tr> <td>redeploy-mode</td> <td>"automatic" or "manual"</td> <td>automatic</td></tr><tr> <td>require-file</td> <td>additional files to use for dependency checking for auto restart</td> <td></td></tr><tr> <td>startup-mode</td> <td>"automatic", "lazy" or "manual"</td> <td>automatic</td></tr><tr> <td>url-prefix</td> <td>url-prefix added to all expanded webapps</td> <td>""</td></tr><tr> <td>versioning</td> <td>if true, use the web-app's numeric suffix as a version</td> <td>false</td></tr><tr> <td>web-app-default</td> <td>defaults to be applied to expaned web-apps</td> <td></td></tr><tr> <td>web-app</td> <td>overriding configuration for specific web-apps</td> <td></td></tr></deftable><def title="<web-app-deploy> schema">element web-app-deploy { archive-directory? & expand-cleanup-fileset? & expand-directory? & expand-prefix? & expand-suffix? & path? & redeploy-check-interval? & redeploy-mode? & require-file* & startup-mode? & url-prefix? & versioning? & web-app-default* & web-app*}</def><s2 title="Overriding web-app-deploy configuration"><p>The web-app-deploy can override configuration for an expanded war witha matching <web-app> inside the <web-app-deploy>. The<document-directory> is used to match web-apps.</p><example title="Example: resin.xml overriding web.xml"><resin xmlns="http://caucho.com/ns/resin"><cluster id=""><host id=""><web-app-deploy path="webapps"> <web-app context-path="/wiki" document-directory="wiki"> <context-param database="jdbc/wiki"> </web-app></web-app-deploy></host></cluster></resin></example></s2><s2 title="versioning"><p>The versioning attribute of the <web-app-deploy> tag improves web-appversion updates by enabling a graceful update of sessions. The web-appsare named with numeric suffixes, e.g. foo-10, foo-11, etc, and can bebrowsed as /foo. When a new version of the web-app is deployed, Resincontinues to send current session requests to the previous web-app. Newsessions go to the new web-app version. So users will not be aware ofthe application upgrade.</p></s2></defun></body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -