geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Geronimo Wiki] Update of "Tomcat" by jgenender
Date Fri, 06 May 2005 21:14:39 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Geronimo Wiki" for change notification.

The following page has been changed by jgenender:
http://wiki.apache.org/geronimo/Tomcat

------------------------------------------------------------------------------
  
  = The geronimo-tomcat.xml =
  
- The geronimo-tomcat.xml file is the equivalent of the Tomcat context.xml file.  It allows
you to configure specific configurations on a web application by web application basis. It
is in this file you will be able to describe the context-root, attach application specific
valves and realms, and declare your security mapping.
+ The geronimo-tomcat.xml file is the equivalent of the Tomcat context.xml file.  It allows
you to configure specific set-up parameters on a web application by web application basis.
It is in this file you will be able to describe the context-root, attach application specific
valves and realms, and declare your security mapping.  The Geronimo deployer can deploy with
this file internally to the web application, or externally.  For the sake of this section,
we will concentrate on an internal configuration.  The geronimo-tomcat.xml is very similar
to the geronimo-jetty.xml with a couple of minor enhancements, and this file will normally
reside in your war file's WEB-INF directory.
  
- TODO: Explain the geronimo-tomcat.xml
+ The geronimo-tomcat.xml allows you to configure specific attributes regarding your specifc
web application.  You may set the context-root, class loader priority, the Tomcat Realm object,
the tomcat-valve-chain, security role mappings, resource naming references, and configure
Gbeans.
+ 
+ The following is an example geronimo-tomcat.xml file:
+ {{{
+ <web-app
+     xmlns="http://geronimo.apache.org/xml/ns/web/tomcat"
+     xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+     configId="org/apache/geronimo/test">
+ 
+     <context-root>/test</context-root>
+     <context-priority-classloader>false</context-priority-classloader>
+     <virtual-server>www.myexamplehost.com</virtual-server>
+     <tomcat-realm>TomcatJACCRealm</tomcat-realm>
+     <tomcat-valve-chain>FirstValve</tomcat-valve-chain>
+ 
+     <security-realm-name>Geronimo</security-realm-name>
+     <security>
+         <default-principal realm-name="tomcat-properties-realm">
+             <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="metro"/>
+         </default-principal>
+     </security>
+ 
+     <gbean name="TomcatJACCRealm" class="org.apache.geronimo.tomcat.RealmGBean">
+         <attribute name="className">org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm</attribute>
+         <attribute name="initParams">
+             userClassNames=org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal
+             roleClassNames=org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal
+         </attribute>
+     </gbean>
+ 
+     <gbean name="FirstValve" class="org.apache.geronimo.tomcat.ValveGBean">
+         <attribute name="className">org.apache.catalina.authenticator.SingleSignOn</attribute>
+         <reference name="NextValve"><moduleType>J2EEModule</moduleType><name>SecondValve</name></reference>
+     </gbean>
+ 
+     <gbean name="SecondValve" class="org.apache.geronimo.tomcat.ValveGBean">
+         <attribute name="className">org.apache.catalina.valves.AccessLogValve</attribute>
+         <attribute name="initParams">
+             prefix=localhost_access_log.
+             suffix=.txt
+             pattern=common
+         </attribute>
+     </gbean>
+ </web-app>
+ }}}
+ 
+ In this particular file, we have configured a web application that responds to a URL context
of /test and only for the virtual host www.myexamplehost.com.  It has set up a simple security
mapping that uses the tomcat-properties-realm (which is declared in the included j2ee-server-tomcat-plan.xml
that came with the Geronimo source).  Declaring this security configuration also assumes we
will be using JACC, so we have created the TomcatGeronimoRealm Gbean and added the reference
to the {{{<tomcat-realm>}}} parameter.  We are also using some valves that are specific
to this context, so we have created the {{{FirstValve}}} and {{{SecondValve}}} Gbeans as a
chain, and set set the {{{<tomvat-valve-chain>}}} to the fir first valve in the chain
({{{FirstValve}}}).
+ 
+ TODO: Explain more on the parameters here...
  
  = Status =
  

Mime
View raw message