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

📄 host-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 2 页
字号:
<document><header>  <title>&lt;host>: Virtual Host configuration</title>  <version>Resin 3.1</version>  <description>  <p>Describes the virtual host configuration tags.</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-tags.xtp">Web Application</a> configuration for web.xml (Servlet) configuration.</li><li>See <a href="env-tags.xtp">Resource</a> configuration for resources: classloader, databases, JMS, EJB, and IoC beans.</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="&lt;access-log>" version="Resin 2.1"><parents>cluster, host, web-app</parents><p>&lt;access-log> configures the access log file.</p><p>As a child of <a config-tag="web-app"/>, overrides thedefinition in the <a config-tag="host"/> that the web-app isdeployed in. As a child of <a config-tag="host"/>, overrides thedefinition in the <a config-tag="server"/> that the host isin.</p><deftable title="&lt;access-log> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>archive-format</td>  <td>the format for the archive filename when a rollover occurs,        see <a href="#rollover">Rollovers</a>.  </td>  <td>see below</td></tr><tr>  <td>format</td>  <td>Access log format.</td>  <td>see below</td></tr><tr>  <td>hostname-dns-lookup</td>  <td>log the dns name instead of the IP address (has a performance hit).</td>  <td>false</td></tr><tr>  <td>path</td>  <td>Output path for the log entries,see <a href="config-log.xtp#path">"Log Paths"</a>.</td>  <td>required</td></tr><tr>  <td>rollover-period</td>  <td>how often to rollover the log.  Specify in days (15D), weeks (2W),         months (1M), or hours (1h). See <a href="#rollover">Rollovers</a>.   </td>  <td>none</td></tr><tr>  <td>rollover-size</td>  <td>maximum size of the file before a rollover occurs, in bytes (50000),         kb (128kb), or megabytes (10mb).          See <a href="#rollover">Rollovers</a>.  </td>  <td>1mb</td></tr><tr>  <td>resin:type</td>  <td>a class extending <a href="javadoc|com.caucho.server.log.AccessLog|"/>        for custom logging  </td>  <td>com.caucho.server.log.AccessLog</td></tr><tr>  <td>init</td>  <td>Resin-IoC initialization for the custom class</td>  <td>n/a</td></tr></deftable><def title="&lt;access-log> schema">element access-log {  auto-flush?  &amp; archive-format?  &amp; auto-flush-time?  &amp; exclude?  &amp; format?  &amp; path?  &amp; rollover-count?  &amp; rollover-period?  &amp; rollover-size?  &amp; init?}</def><p>The default archive format is</p><pre>  <var>path</var> + ".%Y%m%d" or  <var>path</var> + ".%Y%m%d.%H" if rollover-period &lt; 1 day.</pre><p>The access log formatting variables follow the Apache variables:</p><!-- duplicated in config-log.xtp, cluster.xtp, host-tags.xtp --><deftable title="format patterns"><tr>  <th>Pattern</th>  <th>Description</th></tr><tr><td>%b</td>    <td>result content length</td></tr><tr><td>%D</td>    <td>time taken to complete the request in microseconds (since 3.0.16)</td></tr><tr><td>%h</td>    <td>remote IP addr</td></tr><tr><td>%{<var>xxx</var>}i</td>    <td>request header <var>xxx</var></td></tr><tr><td>%{<var>xxx</var>}o</td>    <td>response header <var>xxx</var></td></tr><tr><td>%{<var>xxx</var>}c</td>    <td>cookie value <var>xxx</var></td></tr><tr><td>%n</td>    <td>request attribute</td></tr><tr><td>%r</td>    <td>request URL</td></tr><tr><td>%s</td>    <td>status code</td></tr><tr><td>%{<var>xxx</var>}t</td>    <td>request date with optional time format string.</td></tr><tr><td>%T</td>    <td>time taken to complete the request in seconds</td></tr><tr><td>%u</td>    <td>remote user</td></tr><tr><td>%U</td>    <td>request URI</td></tr></deftable><p>The default format is:</p><def title="default access log format">"%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\""</def><p><var>resin:type</var> allows for custom logging.  Applications canextend a custom class from <a href="javadoc|com.caucho.http.log.AccessLog|"/>.  <a href="resin-ioc.xtp">Resin-IoC initialization</a> can be used to set beanparameters in the custom class.</p><example title="Example: &lt;access-log> in host configuration">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="app-tier">  &lt;host id=""&gt;    &lt;access-log path='log/access.log'&gt;      &lt;rollover-period&gt;2W&lt;/rollover-period&gt;    &lt;/access-log&gt;  &lt;/host>&lt;/cluster&gt;&lt;/resin&gt;</example><example title="Example: custom access log">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="app-tier">  &lt;host id='foo.com'&gt;    &lt;access-log resin:type='test.MyLog'&gt;               path='${resin.root}/foo/error.log'               rollover-period='1W'&gt;      &lt;init&gt;        &lt;foo&gt;bar&lt;/foo&gt;      &lt;/init&gt;    &lt;/access-log&gt;    ...  &lt;/host&gt;&lt;/cluster>&lt;/resin></example></defun>    <defun title="&lt;ear-deploy>"><parents>host, web-app</parents><p>Specifies ear expansion.</p><p>ear-deploy can be used in web-apps to define a subdirectoryfor ear expansion.</p><deftable title="&lt;ear-deploy> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>archive-path</td>  <td>The path to the directory containing ear files</td>  <td>path</td></tr><tr>  <td>ear-default</td>  <td>resin.xml default configuration for all ear files, e.g. configuringdatabase, JMS or EJB defaults.</td>  <td></td></tr><tr>  <td>expand-cleanup-fileset</td>  <td>Specifies the files which should be automatically deleted when anew .ear version is deployed.</td>  <td></td></tr><tr>  <td>expand-directory</td>  <td>directory where ears should be expanded</td>  <td>value of <var>path</var></td></tr><tr>  <td>expand-prefix</td>  <td>automatic prefix of the expanded directory</td>  <td>_ear_</td></tr><tr>  <td>expand-suffix</td>  <td>automatic suffix of the expanded directory</td>  <td></td></tr><tr>  <td>lazy-init</td>  <td>if true, the ear file is only started on first access</td>  <td>false</td></tr><tr>  <td>path</td>  <td>The path to the deploy directory</td>  <td>required</td></tr><tr>  <td>redeploy-mode</td>  <td>"automatic" or "manual".  If automatic, detects new .ear filesautomatically and deploys them.</td>  <td>automatic</td></tr><tr>  <td>url-prefix</td>  <td>optional URL prefix to group deployed .ear files</td>  <td></td></tr></deftable><def title="&lt;ear-deploy> schema">element ear-deploy {  path  &amp; archive-directory?  &amp; ear-default?  &amp; expand-cleanup-fileset?  &amp; expand-directory?  &amp; expand-path?  &amp; expand-prefix?  &amp; expand-suffix?  &amp; lazy-init?  &amp; redeploy-mode?  &amp; require-file*  &amp; url-prefix?}</def></defun><defun title="&lt;error-page>" version="Resin 3.1"><parents>cluster, host, webapp</parents><p>&lt;error-page> defines a web page to be displayed when an error occursoutside of a web-app.Note, this is not a default error-page, i.e. ifan error occurs inside of a &lt;web-app&gt;, the error-page forthat web-app will be used instead.</p><p>See <a href="webapp.xtp#error-page">webapp: error-page</a>.</p></defun><defun title="&lt;host>" version="Resin 3.0"><parents>cluster</parents><p>&lt;host> configures a virtual host.  Virtual hosts must beconfigured explicitly.</p><deftable title="&lt;host> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr><td>id</td>    <td>primary host name</td>    <td>none</td></tr><tr><td>regexp</td>    <td>Regular expression based host matching</td>    <td>none</td></tr><tr><td>host-name</td>    <td>Canonical host name</td>    <td>none</td></tr><tr><td>host-alias</td>    <td>Aliases matching the same host</td>    <td>none</td></tr><tr><td>secure-host-name</td>    <td>Host to use for a redirect to SSL</td>    <td>none</td></tr><tr><td>root-directory</td>    <td>Root directory for host files</td>    <td>parent directory</td></tr><tr><td>startup-mode</td>    <td>'automatic', 'lazy', or 'manual', see <a href="resin-tags.xtp#startup-mode">Startup and Redeploy Mode</a></td>    <td>automatic</td></tr></deftable><example title="Example: explicit host in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">&lt;host host-name="www.foo.com"&gt;  &lt;host-alias&gt;foo.com&lt;/host-alias&gt;  &lt;host-alias&gt;web.foo.com&lt;/host-alias&gt;  &lt;root-directory&gt;/opt/www/www.foo.com&lt;/root-directory&gt;  &lt;web-app id="/" document-directory="webapps/ROOT"&gt;      &lt;/web-app&gt;  ...&lt;/host&gt;&lt;/cluster>&lt;/resin></example><example title="Example: regexp host in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">&lt;host regexp="([^.]+)\.foo\.com"&gt;  &lt;host-name&gt;${host.regexp[1]}.foo.com&lt;/host-name&gt;  &lt;root-directory&gt;/var/www/hosts/www.${host.regexp[1]}.com&lt;/root-directory&gt;  ...&lt;/host&gt;&lt;/cluster>&lt;/resin></example><p>It is recommended that any &lt;host&gt; using a regexp includea &lt;host-name&gt; to set the canonical name for the host.</p></defun><defun title="&lt;host-alias>"><p>&lt;host-alias> defines a URL alias for matching HTTP requests.Any number of &lt;host-alias> can be used for each alias.</p><p>The host-alias can be used either in the resin.xml or ina host.xml when use host-deploy together with resin:import.</p><def title="&lt;host-alias> schema">element host-alias {  string}</def><example title="Example: host-alias in the resin.xml">&lt;resin xmlns="http://caucho.com">&lt;cluster id="">  &lt;host id="www.foo.com" root-directory="/var/www/foo.com">    &lt;host-alias>foo.com&lt;/host-alias>    &lt;web-app id=""/>  &lt;/host>&lt;/cluster>&lt;/resin></example><p>Since the &lt;host-deploy> and &lt;host> tags lets you add ahost.xml file to customize configuration, the &lt;host-alias> canalso fit in the custom host.xml page.</p><example title="Example: host-alias in a /var/www/hosts/foo/host.xml">&lt;host xmlns="http://caucho.com">  &lt;host-name>www.foo.com&lt;/host-name>  &lt;host-alias>foo.com&lt;/host-alias>  &lt;web-app id="" root-directory="htdocs"/>&lt;/host></example></defun><defun title="&lt;host-alias-regexp>"><p>&lt;host-alias-regexp> defines a regular expression for matchingURLs for a given virtual host.</p><def title="&lt;host-alias-regexp> schema">element host-alias-regexp {  string}</def><example title="Example: host-alias-regexp in the resin.xml">&lt;resin xmlns="http://caucho.com">&lt;cluster id="">  &lt;host id="www.foo.com" root-directory="/var/www/foo.com">    &lt;host-alias-regexp>.*foo.com&lt;/host-alias-regexp>    &lt;web-app id=""/>  &lt;/host>&lt;/cluster>&lt;/resin></example></defun><defun title="&lt;host-default>" version="Resin 3.0"><parents>cluster</parents><p>&lt;host-default> configures defaults for a virtual host.</p><p>The host-default can contain any of the host configuration tags.It will be used as defaults for any virtual host.</p></defun><defun title="&lt;host-deploy>" version="Resin 3.0.4"><parents>cluster</parents><p>&lt;host-deploy> configures an automatic deployment directoryfor virtual host.</p><deftable title="&lt;host-deploy> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>archive-directory</td>  <td>path to the archive directory</td>  <td>path</td></tr><tr>  <td>path</td>  <td>path to the deploy directory</td>  <td>required</td></tr><tr>  <td>expand-cleanup-fileset</td>  <td>an ant-style fileset defining which directories to cleanup when

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -