Resin Documentationapp server |
<host>: virtual host configurationDescribes the virtual host configuration tags. child of <cluster>,<cluster-default>,<server>,<server-default>,<host>,<host-default>,<web-app>,<web-app-default>
<access-log> configures the access log file. As a child of <web-app>, overrides the definition in the <host> that the web-app is deployed in. As a child of <host>, overrides the definition in the <server> that the host is in. The default archive format is + ".%Y%m%d" or + ".%Y%m%d.%H" if rollover-period < 1 day. The access log formatting variables follow the Apache variables:
The default format is: "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" com.caucho.http.log.AccessLog. Resin-IoC initialization can be used to set bean parameters in the custom class. allows for custom logging. Applications can extend a custom class from
element access-log { path? & path-format? & archive-format? $amp;auto-flush? & auto-flush-time? & exclude* & format? & hostname-dns-lookup? & rollover-period? & rollover-size? & rollover-count? & resin:type? & init? } <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <host id=""> <access-log path='log/access.log'> <rollover-period>2W</rollover-period> </access-log> </host> </cluster> </resin> <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <host id='foo.com'> <access-log> <test:MyLog xmlns:test="urn:java:test"> path='${resin.root}/foo/error.log' rollover-period='1W'> <test:foo>bar</test:foo> </test:MyLog> </access-log> ... </host> </cluster> </resin> Specifies ear expansion. ear-deploy can be used in web-apps to define a subdirectory for ear expansion.
element ear-deploy { path & archive-directory? & ear-default? & expand-cleanup-fileset? & expand-directory? & expand-path? & expand-prefix? & expand-suffix? & lazy-init? & redeploy-mode? & require-file* & url-prefix? } child of <web-app>
Allows applications to customize the response generated for errors. By default, Resin returns a 500 Servlet Error and a stack trace for exceptions and a simple 404 File Not Found for error pages. With <error-page>, you may specify a handler page for these errors. The handler page has several request attributes set so that it may log, display, or otherwise use information about the error that occured. The following table describes the available attributes.
element error-page { (error-code | exception-type)? & location } <web-app xmlns="http://caucho.com/ns/resin"> <error-page> <error-code>404</error-code> <location>/file_not_found.jsp</location> </error-page> </web-app> <web-app xmlns="http://caucho.com/ns/resin"> <error-page exception-type="java.lang.NullPointerException" location="/nullpointer.jsp"/> </web-app> <%@ page session="false" isErrorPage="true" %> <html> <head><title>404 Not Found</title></head> <body> <h1>404 Not Found</h1> The url <code>${requestScope["javax.servlet.error.request_uri"]}</code> was not found. </body> </html> child of <host>
<host-alias> defines a URL alias for matching HTTP requests. Any number of <host-alias> can be used for each alias. The host-alias can be used either in the resin.xml or in a host.xml when use host-deploy together with resin:import. Since the <host-deploy> and <host> tags lets you add a host.xml file to customize configuration, the <host-alias> can also fit in the custom host.xml page. element host-alias { string } <resin xmlns="http://caucho.com"> <cluster id=""> <host id="www.foo.com" root-directory="/var/resin/foo.com"> <host-alias>foo.com</host-alias> <web-app id=""/> </host> </cluster> </resin> <host xmlns="http://caucho.com"> <host-name>www.foo.com</host-name> <host-alias>foo.com</host-alias> <web-app id="" root-directory="htdocs"/> </host> child of <host>
<host-alias-regexp> defines a regular expression for matching URLs for a given virtual host. element host-alias-regexp { string } <resin xmlns="http://caucho.com"> <cluster id=""> <host id="www.foo.com" root-directory="/var/resin/foo.com"> <host-alias-regexp>.*foo.com</host-alias-regexp> <web-app id=""/> </host> </cluster> </resin> child of <cluster>
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. child of <cluster>
<host-deploy> configures an automatic deployment directory for virtual hosts. The host-deploy will add an EL variable ${host.name}, referring to the name of the host jar file.
element host-deploy { archive-directory? & expand-cleanup-fileset? & expand-directory? & host-default? & host-name? & path? } The following example configures as a host deployment directory. Each virtual host will have a directory for .war deployment. So the directory would serve the URL .<resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <root-directory>/var/resin</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> child of <host>
<host-name> defines the canonical name for a virtual host. The <host-name> will be used in Resin's logging, management, and is available in the host's variables. element host-name { string } child of <web-app>
default automatic<redeploy-mode> specifies how Resin handles updates to web-apps and .war files. By default, Resin restarts web-apps when classes or configuration files change.
element redeploy-mode { automatic | manual } <root-directory> specifies the base directory for the contexts. All EL-style directory paths are relative to the root-directory. element root-directory { r_path-Type } <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <root-directory>/var/resin/app-tier</root-directory> <server id="a" ...> <host host-name="www.foo.com"> </cluster> </resin> <secure-host-name> sets a host-name or URL to be used for secure redirection. For some security configurations, Resin needs to redirect from an insecure site to a secure one. The <secure-host-name> configures the host to redirect to. See Resin security. element secure-host-name { string } <startup-mode> configures the virtual-host's behavior on Resin startup, either "automatic", "lazy" or "manual".
element startup-mode { string } web-app configures a web application. When specified by <url-regexp>, the application will be initialized at the first request. This means that servlets may start later than expected for applications. , the application will be initialized on server start. When specified by
The following example creates a web-app for /apache using the Apache htdocs directory to serve pages. <host id=''> <web-app id='/apache' root-directory='/usr/local/apache/htdocs'> ... </host> The following example sets the root web-app to the IIS root directory. <web-app id='/' root-directory='C:/inetpub/wwwroot'> When the is specified with a , can use replacement variables ( ).In the following, each user gets his or her own independent application using .<host id=''> <web-app url-regexp='/~([^/]*)' root-directory='/home/$1/public_html'> ... </web-app> </host> child of <cluster>
<web-app-default> defines default values for any web-app in the cluster. <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <web-app-default> <servlet servlet-name="resin-php" servlet-class="com.caucho.quercus.servlet.QuercusServlet"/> <servlet-mapping url-pattern="*.php" servlet-name="resin-php"/> </web-app-default> <host id=""> ... </cluster> </resin> Specifies war expansion. web-app-deploy can be used in web-apps to define a subdirectory for war expansion. The tutorials in the documentation use web-app-deploy to allow servlet/tutorial/helloworld to be an independent war file.
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* } Overriding web-app-deploy configurationThe web-app-deploy can override configuration for an expanded war with a matching <web-app> inside the <web-app-deploy>. The <root-directory> is used to match web-apps. <resin xmlns="http://caucho.com/ns/resin"> <cluster id=""> <host id=""> <web-app-deploy path="webapps"> <web-app context-path="/wiki" root-directory="wiki"> <context-param database="jdbc/wiki"> </web-app> </web-app-deploy> </host> </cluster> </resin> versioningThe versioning attribute of the <web-app-deploy> tag improves web-app version updates by enabling a graceful update of sessions. The web-apps are named with numeric suffixes, e.g. foo-10, foo-11, etc, and can be browsed as /foo. When a new version of the web-app is deployed, Resin continues to send current session requests to the previous web-app. New sessions go to the new web-app version. So users will not be aware of the application upgrade.
|