⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 host-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 2 页
字号:
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="&lt;host-deploy> schema">element host-deploy {  archive-directory?  &amp; expand-cleanup-fileset?  &amp; expand-directory?  &amp; host-default?  &amp; host-name?  &amp; 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="&lt;host-deploy>">&lt;resin xmlns="http://caucho.com/ns/resin">  &lt;cluster id="app-tier">    &lt;root-directory>/var/www&lt;/root-directory>    &lt;host-deploy path="hosts">      &lt;host-default>        &lt;resin:import path="host.xml" optional="true"/>        &lt;web-app-deploy path="webapps"/>      &lt;/host-default>    &lt;/host-deploy>  &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;host-name>"><p>&lt;host-name> defines the canonical name for a virtual host.The &lt;host-name> will be used in Resin's logging, management, andis available in the host's variables.</p><def title="&lt;host-host> schema">element host-name {  string}</def></defun><defun title="&lt;redeploy-mode>"><p>&lt;redeploy-mode> configures the virtual-host's behavior whenit detects changes in configuration files or classes.  The&lt;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="&lt;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 &lt;host&gt;, for example, resourceslike &lt;database&gt; or &lt;authenticator>.  Resources defined atthe host level are available for all web-apps in the host.</p><example title="Example: shared database in host">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="app-tier"&gt;     &lt;server id="a" .../>     &lt;host id="www.foo.com">        &lt;database jndi-name="jdbc/test"&gt;            &lt;driver type="org.postgresql.Driver"&gt;                &lt;url&gt;jdbc:postgresql://localhost/test&lt;/url&gt;                &lt;user&gt;caucho&lt;/user&gt;            &lt;/driver&gt;        &lt;/database&gt;        &lt;web-app-default path="webapps"/>    &lt;/host&gt;  &lt;/cluster&gt;&lt;/resin&gt;</example></defun><defun title="&lt;rewrite-dispatch>" version="Resin 3.1"><parents>cluster, host, web-app</parents><p>&lt;rewrite-dispatch&gt; 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">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="app-tier"&gt;    &lt;host host-name="www.foo.com">      &lt;rewrite-dispatch&gt;        &lt;redirect regexp="^/foo" target="/index.php?foo="/&gt;      &lt;/rewrite-dispatch&gt;    &lt;/host&gt;  &lt;/cluster&gt;&lt;/resin&gt;</example></defun><defun title="&lt;root-directory>" version="Resin 3.1"><p>&lt;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="&lt;root-directory> schema">element root-directory {  string}</def></defun><defun title="&lt;secure-host-name>"><p>&lt;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 &lt;secure-host-name> configuresthe host to redirect to.</p><p>See <a href="resin-security.xtp">Resin security</a>.</p><def title="&lt;secure-host-name> schema">element secure-host-name {  string}</def></defun><defun title="&lt;startup-mode>"><p>&lt;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="&lt;startup-mode> schema">element startup-mode {  string}</def></defun><defun title="&lt;web-app>"><parents>host, web-app</parents><p>&lt;web-app> configures a web application.</p><deftable title="&lt;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" >&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="app-tier">&lt;host id=''&gt;  &lt;web-app id='/apache' root-directory='/usr/local/apache/htdocs'&gt;  ...&lt;/host&gt;&lt;/cluster>&lt;/resin></example><p>The following example sets the root web-app to the IISroot directory. </p><example title="Example: IIS root directory">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="app-tier">&lt;host id=''&gt;  &lt;web-app id='/' root-directory='C:/inetpub/wwwroot'&gt;&lt;/host>&lt;/cluster>&lt;/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">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="app-tier">  &lt;host id=''&gt;    &lt;web-app url-regexp='/~([^/]*)'             root-directory='/home/$1/public_html'&gt;    ...    &lt;/web-app&gt;&lt;/host&gt;&lt;/cluster>&lt;/resin></example></defun><defun title="&lt;web-app-default>"><parents>cluster, host, web-app</parents><p>&lt;web-app-default> configures common values for all web applications.</p></defun><defun title="&lt;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="&lt;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="&lt;web-app-deploy> schema">element web-app-deploy {  archive-directory?  &amp; expand-cleanup-fileset?  &amp; expand-directory?  &amp; expand-prefix?  &amp; expand-suffix?  &amp; path?  &amp; redeploy-check-interval?  &amp; redeploy-mode?  &amp; require-file*  &amp; startup-mode?  &amp; url-prefix?  &amp; versioning?  &amp; web-app-default*  &amp; web-app*}</def><s2 title="Overriding web-app-deploy configuration"><p>The web-app-deploy can override configuration for an expanded war witha matching &lt;web-app&gt; inside the &lt;web-app-deploy&gt;.  The&lt;document-directory&gt; is used to match web-apps.</p><example title="Example: resin.xml overriding web.xml">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">&lt;host id="">&lt;web-app-deploy path="webapps"&gt;  &lt;web-app context-path="/wiki"              document-directory="wiki"&gt;    &lt;context-param database="jdbc/wiki"&gt;  &lt;/web-app&gt;&lt;/web-app-deploy&gt;&lt;/host>&lt;/cluster>&lt;/resin></example></s2><s2 title="versioning"><p>The versioning attribute of the &lt;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 + -