HTTP and Srun configuration is identical except for load balancing ( and .)HTTP configuration follows the Servlet 2.2 deployment descriptors. The nesting depth is important, but order is generally not important. In the sections that follow, the section header tells where the attribute belongs. For example, the configuration in looks like:
Most of the interesting configuration belongs in web-app. For example, belongs in a element, but belongs in the top-level element. The server contains a number of elements and each contains elements. Each configures a virtual host and each configures an application.
Configuration for the servlet engine. Any <resource-ref> resource configured in <http-server> is shared for all virtual hosts and web-apps in the server. So a database or EJB server configured in the <http-server> will be shared for all virtual hosts. Default application tags like <servlet-mapping> may appear in the <http-server> section. These tags will be defaults for the contained <web-app> and <host>. alternate-session-url-prefixConfigures an alternate URL prefix to be used for /~J=xxx/test.jsp style url-rewriting. There is no default. If alternate-session-url-prefix is configured, URL rewriting will 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.
cacheActivates the memory cache with a specified size. Resin's cache acts as a proxy cache. Pages with headers will be cached, avoiding expensive Java or Database processing.To activate caching, you must add a cache directive. By default, caching is disabled. The cache combines memory and file caching. The most referenced pages are served out of memory and the rest are served from the filesystem.
For example, a page created by several sophisticated and slow database queries may only change every 15 minutes. If that page sets its expires header, Resin can serve the generated page as fast as a static page. Default: by default, cache is disabled.
Specifies the file for error logging. The log is relative to $RESIN_HOME. You can use the special path to make the log relative to the host, e.g. .
Default: By default, a host's error log will use an error-log defined in http-server.
The url to display if the web server can't connect to Resin. This is a special case of error-page in the web-app configuration. The Apache and IIS plugins use this special error-page directive to display a custom error page when the web server can't connect to Resin. The location must be an absolute path understandable to the web server.
forbid-hostSelects a list of IPs that are forbidden.
forbid-host is implemented by com.caucho.http.security.ForbidHost. It is stored in JNDI as java:comp/env/caucho/forbid-host. An intelligent log might detect a denial of service attack and dynamically forbid the host. ignore-client-disconnectIgnores ClientDisconnectionExceptions thrown when the browser disconnects.
False by default, throws exceptions on disconnects. global-system-propertiesDetermines if system-properties are classloader specific or global. By default, Resin's web-apps and hosts have isolated system properties. So System.getProperty("test") in host foo.com might return a different value from System.getProperty("test") in host bar.com. Usually, this is the correct solution to prevents hosts and web-apps from affecting each other. Specialized applications may want to disable this feature however.
Default: The default value is false.
Defines a virtual host. If no hosts are specified, or if a request doesn't match a host, configuration in http-server will be used instead. The id may contain a list of hosts. Any host in the list will match. See application configuration for servlet configuration. Hosts can use instead of to dynamically create new hosts.
Any <resource-ref> resource configured in <http-server> is shared for all virtual hosts and web-apps in the server. So a database or EJB server configured in the <http-server> will be shared for all virtual hosts. Default application tags like <servlet-mapping> may appear in the <http-server> section. These tags will be defaults for the contained <web-app> and <host>.
Note: Only the Resin Java process understands regexps. Because mod_caucho, isapi_srun and the other web server plugins don't understand the regexps, you may need to do additional work to make the web server send the request to Resin. Default: If the attribute is null or '*', the <host> will be used as the default configuration for any virtual host that doesn't match a specific <host> block.httpDefines a HTTP or SSL port for the standalone server.
Specifies a list of URLs to test to check the webserver's uptime. Ping adds reliability to a web site. It launches a separate thread to check if a list of URLs return valid results, i.e. HTTP status 200. If the URLs fail after repeated attempts, Resin will exit. The parent process, either wrapper.pl or the NT service, will automatically restart Resin. Because the ping thread is in the same JVM as the web server, ping cannot detect all failure types. In particular, if the JDK itself freezes, ping can do nothing. It can detect problems like deadlocks or database connection overflows or memory leaks. The URLs listed in the <ping> should exercise the important operations in the application. For example, it should at least access the database.
Custom ping classes must extend com.caucho.http.admin.PingThread. For example, the PingMailer will mail when the PingThread fails.
No default. srunDefines multiple client machines for load balancing. This directive used by the web server (Apache or IIS) and by the Java portion of Resin. Each directive adds a new client to receive load balanced requests. With Resin 1.2, the resin.conf must have at least one <srun> or <http> element.
To start srun 'a' use a command line like
On Unix, when starting a daemon, you'll need to specify a unique pid file.
srun-backupDefines backup client machines for load balancing. This directive is only picked up by the load balancer. The Java portion of Resin treats a <srun-backup> like any other srun. Normally, <srun-backup> is only used when each web server has a primary <srun> in preference to other <srun> JVMs. See the load-balancing section for more information.
Number of threads to be used in keepalive requests. When Resin is used in combination with a web server, like Apache or IIS, Resin will reuse the socket connection to that web server if possible. specifies the number of theads that can be used in these keepalive connections.Defaults to 100.
Maximum number of request-handling threads. Defaults to 200.
Specifies the access log file. The log is relative to $RESIN_HOME. You can use the special path to make the log relative to the host, e.g. .
The variable controls how often the access log will be rotated. When the time runs out, Resin will move the old log file to a timestamped one, e.g. access.log20001114. Rollovers happen at midnight in the local time if the time period is a day or longer.The access log formatting variables follow the Apache variables:
The default format is:
If the web-app doesn't specify an access-log, it will use the host's access-log. doc-dirSpecifies the document directory for the <host> or <http-server>. <doc-dir> values may use use system properties, like or or even .
Default: Defaults to <root-dir> if specified. Otherwise <host> defaults to the document directory of the <http-server> <http-server> defaults to the server-root. root-dirSpecifies the root directory for the <host> or <http-server>. Non-document data like log files and war directories are based off the root directory. <root-dir> values may use use system properties, like or or even .
Default: Hosts defaults to the <root-dir> of the <http-server>. <http-server> defaults to the server-root. session-cookieConfigures session cookie. The default is "JSESSIONID". session-url-prefixConfigures the URL prefix to be used for url-rewriting. The default is ";jsessionid=". server-nameDefines the canonical url for the host. In some cases, the specific URL that's used for a virtual host might be different from the <host id='...'> name. <server-name> lets you specify the exact URL to be added when using a sendRedirect.
server-listenerSpecifies the classname for a listener when the server starts and shuts down. The class must be in the system classpath because it's called before the dynamic classpaths have been created and after they've been destroyed. The server listener class must extend com.caucho.http.admin.AbstractServerListener.
servlet-classloader-hackEnables the Servlet specification classloader hack. The Servlet 2.3 classloader order violates the JDK classloader specification. By default, therefore, Resin follows the JDK requirements. Those application which need to violate the JDK spec may enable the servlet-classloader-hack. By default, the hack is disabled. sticky-sessionsEnables or disables sticky-session load balancing. The default is true to enable sticky sessions.
Defines the character encoding to be used for decoding the URL. Because the HTTP protocol does not specify the encoding to be used, the server must specify the encoding beforehand. Default: utf-8
Specifies the maximum length allowed in a HTTP URL. Requests with longer lengths will receive an error. Default: 8192
Specifies a special directory to place war files. Any .war (web-application resource) file placed in the war directory will be automatically expanded and installed. The .war file will be expanded into , if specified.The war-dir is relative to $RESIN_HOME, not to the virtual host's app-dir.
Given the above example, if you put foo.war in resin1.2/foo-apps, Resin will automatically expand it and install it with the prefix . So browsing will give the top-level contents.Generally, war files use for configuration. The syntax is the same as for other application configuration.No war-dir is defined by default. war-expand-dirSpecifies the destination of war expansion. Any .war (web-application resource) file placed in the war-dir directory will be automatically expanded into war-expand-dir. You can also create a web-app by creating a directory in war-expand-dir. The war-dir is relative to $RESIN_HOME, not to the virtual host's app-dir. The special directory lets you define the root web-app.Generally, war files use for configuration. The syntax is the same as for other application configuration.Default: Defaults to the value of <war-dir>.
Specifies an application. Applications are self-contained subtrees of the web site. They have distinct Application objects, sessions, and servlet mappings. Applications can even be deployed entirely from .jar files. The full application configuration is described in a separate page. Applications have a root similar to the document root. By default, it's just the same as the relative path.Beneath the root, a special directory contains servlet classes and beans. contains Java source files and Java classes. contains additional jar files for the application.
The configuration allows for dynamic applications, for example, creating a new application for each user.
In the above example, users will put their own web.xml in . Classes belong in .Note: Only the Resin Java process understands regexps. Because mod_caucho, isapi_srun and the other web server plugins don't understand the regexps, you may need to do additional work to make the web server send the request to Resin.
|