Also, > -----Original Message----- > From: Rick Roberts [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 09, 2003 11:32 AM > To: Tomcat Users List > Subject: Still need help with JDBCRealm > > > Of the several applications running on this server, > I am only trying to apply a JDBCRealm to the /hd application > initially. Once I get it working on one application, then I > want to apply JDBCRealm to all of my apps. >
>From the Tomcat docs: The <Realm> element can be nested inside one of three different elements, which has a direct impact on the "scope" of that Realm (i.e. which web applications will share the same authentication information): * Inside an <Engine> element - This Realm will be shared across ALL web applications on ALL virtual hosts, UNLESS it is overridden by a Realm element nested inside a subordinate <Host> or <Context> element. * Inside a <Host> element - This Realm will be shared across ALL web applications for THIS virtual host, UNLESS it is overridden by a Realm element nested inside a subordinate <Context> element. * Inside a <Context> element - This Realm will be used ONLY for THIS web application So in your server.xml , your Realm is inside the engine, and *could* be used for any of the contexts defined there. If only the /hd application makes use of authentication, then this is fine. But if you wanted *only* the /hd application to be *able* to use this JDBC Realm, then you'd need to define the Realm element inside the context for /hd. I think you understand that though, but I'm just making sure. > <Engine name="Standalone" defaultHost="localhost" debug="0"> > > <!-- Global logger unless overridden at lower levels --> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="catalina_log." suffix=".txt" > timestamp="true"/> > > <!-- ######### snipped realm from this location ########### --> > > <!-- Define the default virtual host --> > <Host name="localhost" debug="0" appBase="webapps" > unpackWARs="true" autoDeploy="true"> > > <Logger className="org.apache.catalina.logger.FileLogger" > directory="logs" > prefix="localhost_log." > suffix=".txt" > timestamp="true"/> > > <!-- NSFS Context --> > <Context path="/nsfs" docBase="nsfs" debug="0" > reloadable="true" > crossContext="true"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="nsfs_log." suffix=".txt" timestamp="true"/> > </Context> > > <!-- HelpDesk Context --> > <Context path="/hd" docBase="hd" debug="0" reloadable="true" > crossContext="true"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="hd_log." suffix=".txt" timestamp="true"/> > <!-- ######## added realm here ######## --> > <Realm className="org.apache.catalina.realm.JDBCRealm" > connectionName="AI_DBA" > connectionPassword="SUKHOI" > connectionURL="jdbc:oracle:thin:@sukoi:1521:orcl" > driverName="oracle.jdbc.driver.OracleDriver" > userTable="REALM_USER" > userNameCol="LOGIN" > userCredCol="PASSWORD" > userRoleTable="REALM_ROLE" > roleNameCol="ROLE" > /> > </Context> > > <!-- SQLEdit Context --> > <Context path="/sqledit" docBase="sqledit" debug="0" > reloadable="true" > crossContext="true"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="sqledit_log." > suffix=".txt" > timestamp="true"/> > </Context> > > <!-- ActionItems Context --> > <Context path="/ai" docBase="ai" debug="0" reloadable="true" > crossContext="true"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="ai_log." suffix=".txt" timestamp="true"/> > </Context> > > </Host> > > </Engine> > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]