Changes between Version 9 and Version 10 of tap
- Timestamp:
- Mar 9, 2015 1:24:11 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
tap
v9 v10 15 15 16 16 {{{ 17 $JRE_HOME/bin/java -jar $PATH_TO_DERBY_LIB /db-derby-10.10.1.1-bin/lib/derbyrun.jar server start -p YOUR_PORT -h 0.0.0.0 &17 $JRE_HOME/bin/java -jar $PATH_TO_DERBY_LIB/db-derby-10.10.1.1-bin/lib/derbyrun.jar server start -p DERBY_PORT -h 0.0.0.0 & 18 18 }}} 19 19 20 20 To start derby successfully add a socket permission in JAVA 7 by including in $JRE_HOME/lib/security/java.policy the following line: 21 21 {{{ 22 permission java.net.SocketPermission "HOST:PORT", "listen,resolve"; 23 24 }}} 22 permission java.net.SocketPermission "HOST:DERBY_PORT", "listen,resolve"; 23 24 }}} 25 25 26 === Expose our datasource in Tomcat === 27 26 28 Tomcat gets users and roles from conf/tomcat-users.xml by default. We are going to change this in order to get users and roles from a given database. 27 29 First of all, include both derbyclient.jar and derbynet.jar in $CATALINA_HOME/lib. After doing that, we need to add a new resource called “jdbc/admin” in GlobalNamingResurces: … … 30 32 {{{ 31 33 <Resource name="jdbc/adminDB" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 32 validationQuery="SELECT count(*) FROM users" maxActive="20" maxIdle="10" username=" password" password="secret"34 validationQuery="SELECT count(*) FROM users" maxActive="20" maxIdle="10" username="admin" password="adm!n" 33 35 driverClassName="org.apache.derby.jdbc.ClientDriver" url="jdbc:derby://host:port/derbypath/derbydb" readOnly="false"/> 34 36 }}} 35 37 36 38 === Set the realm === 39 37 40 A Realm is a “database” of usernames and passwords that identify valid users of a web application (or set of web applications), plus an enumeration of the list of roles associated with each valid user. The servlet container will be connected to the database and it also be aware of the username and the corresponding roles. Define this realm inside <Engine> in your server.xml: 38 41 … … 42 45 }}} 43 46 47 === Expose the datasource as JNDI resource === 48 49 TAP gets the datasource from the JNDI resource "jdbc/adminDB". Add to $CATALINA_HOME/conf/context.xml the following line: 50 51 {{{ 52 <ResourceLink global="jdbc/adminDB" name="jdbc/adminDB" type="javax.sql.DataSource"/> 53 }}} 44 54 45 55 == Initial TAP setup == … … 58 68 tap.email.noreply = no-reply@your_host.com 59 69 tap.email.admin = admin@host.com 60 tap.filter.groups = TAP_USER,TAP_ADMIN #Invisible in TAP Groups 70 tap.filter.groups = TAP_USER,TAP_ADMIN #Invisible in TAP Groups. 61 71 }}} 62 72