Because the flexibility of Resin's configuration can be overwhelming, we've collected the most important configuration here. Once you understand the basic configuration, you can use it as a framework to attach more detailed configuration as you need it. You may want to look at: basic configuration in the tutorial section. System-specific installation information is in a different section. An index of all configuration elements. Configuring Resin involves configuring the following: ports and protocols: http, ssl, srun resources (JNDI): databases, JMS, EJB, JNDI links virtual hosts and web-applications classpaths servlets: web.xml Resin organizes classes and JNDI resources into a tree. Each node in the tree inherits classes and JNDI resources from its parents and adds it's own classes and resources. So a database configured for the virtual host would be available for every web-app in the host. The following creates a basic working configuration for a Resin standalone configuration. Resin will compile and load servlets and classes placed in and jars placed in in . The url will invoke a servlet in . The url will run a JSP in . <caucho.com> <http-server> <http port='8080'/> <host id=''> <doc-dir>/home/ferg/public_html</doc-dir> <war-dir>webapps</war-dir> <web-app id='/'> </web-app> </host> </http-server> </caucho.com> Servlet configuration normally belongs in the web.xml in the WEB-INF directory. Resin-specific configuration, e.g. database configuration, belongs in a resin-web.xml file in WEB-INF or in the resin.conf. Because Resin merges the contents of resin-web.xml, web.xml, and resin.conf, so you can put everything in the resin.conf if that makes your application easier to maintain. The following web.xml configures the special "invoker" servlet, which lets you call servlets using the classname in the URL like /servlet/qa.MyServlet. In general, it's a better idea to create specific servlet-mappings for each servlet for better security. <web-app> <servlet-mapping> <url-pattern>/servlet/*</url-pattern> <servlet-name>invoker</servlet-name> </servlet-mapping> </web-app> caucho.com is just a container for any Caucho configuration http-server contains all configuration for the Resin server. The most important configuration variable is . configures the document root. can appear in />, />, and />. If it's not specified, it defaults to the parent. <caucho.com> <http-server> <app-dir>/usr/local/apache/htdocs</app-dir> ... </http-server> </caucho.com> <caucho.com> <http-server> <app-dir>d:\inetpub\wwwroot</app-dir> ... </http-server> </caucho.com> <caucho.com> <http-server> <app-dir>doc</app-dir> ... </http-server> </caucho.com> Configures the HTTP port for Resin to listen at. AttributeMeaningDefault portTCP post to listen torequired hostTCP interface to listen toall interfaces <caucho.com> <http-server> <http host='localhost' port='6802'/> ... </http-server> </caucho.com> Configures a servlet runner port for Resin to listen at. AttributeMeaningDefault portTCP post to listen torequired hostTCP interface to listen toall interfaces <caucho.com> <http-server> <srun host='localhost' port='6802'/> ... </http-server> </caucho.com> Each http-server contains some virtual hosts. Most configurations will use the default host. <caucho.com> <http-server> <host id=''> ... </host> </http-server> </caucho.com> Each host contains some web applications. A web application is just a container for some servlets. It's closely related to the javax.servlet.ServletContext. Most configurations will use the default web-app. <caucho.com> <http-server> <host id=''> <web-app id='/'> ... </web-app> </host> </http-server> </caucho.com> Maps url patterns to servlets. has two children, and . selects the urls which should execute the servlet. The special is used to dispatch servlets by class name. For example, /servlets/test.HelloServlet. /path/to/servletExact URL match /prefix/*Matching everything with a prefix *.jspMatching everything with an extension /Replace the default servlet In the following example, the URL invokes the servlet <web-app id='/'> <servlet> <servlet-name>hello</servlet-name> <servlet-class>test.HelloWorld</servlet-class> </servlet> <servlet-mapping> <url-pattern>/hello-world</url-pattern> <servlet-name>hello</servlet-name> </servlet-mapping> <servlet-mapping> <url-pattern>*.xtp</url-pattern> <servlet-name>com.caucho.jsp.XtpServlet</servlet-name> </servlet-mapping> </web-app> Defines a servlet alias for later mapping. More details are in the servlet configuration section. servlet-nameThe servlet's name (alias) servlet-classThe servlet's class (defaults to servlet-name) init-paramInitialization parameters In the following example, the url invokes the servlet . The servlet will use getInitParameter("title") to get the string "Hello, World". <web-app id='/'> <servlet-mapping> <url-pattern>/hello.xtp</url-pattern> <servlet-name>hello</servlet-name> </servlet-mapping> <servlet> <servlet-name>hello</servlet-name> <servlet-class>test.HelloWorld</servlet-class> <init-param title='Hello, World'/> </servlet> </web-app> The following description condenses the full configuration summary. caucho.com ::= http-server http-server ::= http* | srun* | host* host ::= war-dir | web-app* web-app ::= servlet-mapping* | servlet* servlet ::= servlet-name | servlet-class | init-param* servlet-mapping ::= url-pattern | servlet-name