Building and Deploying TAPAS
From TAPASWiki
This is a high-level overview of how to set up an installation of OpenTAPAS with both client and server applications deployed to the same machine. These instructions use the TAUP branch of the OpenTAPAS SVN repository, because that is what was available at the time of this initial draft.
Contents |
[edit]
Prerequisites
- Destination machine has ANT installed
- Destination machine has SVN installed
[edit]
Retrieve OpenTAPAS from Sourceforge SVN Repository
Open a shell, change to<taupdirectory>and type:
svn co -r 271 https://svn.sourceforge.net/svnroot/tap-apps/branches/taup
[edit]
Set up OpenTAPAS database in Postgresql
- Download Postgresql from http://www.postgresql.org/download/ (at the time of writing, I downloaded version 8.1.5)
- Install Postgresql. Setup user account with username='postgres' and password='egad55'. (Database username and password can be set to your local preference by editing hibernate.cfg.xml)
- Login to a shell as postgres
su -l postgres
- Start PostgreSQL
pg_ctl -D <datadirectory>/data -l logfile start
- Create a database for OpenTAPAS
createdb tapas
- Initialize the database. From within
<taupdirectory>/casa/db
executepsql -d tapas -f tapas_schema.sql psql -d tapas -f tapas_data.sql psql -d tapas -f tapas_sequences.sql
[edit]
Set up JBoss
- Download Jboss Application Server from http://jboss.org to <jbossdirectory> (at the time of writing, I downloaded version 4.0.2)
- Generate a keystore from within
<jbossdirectory>/server/default/conf/
using this commandkeytool -genkey -alias casa -keyalg RSA -keystore server.keystore -validity 3650
You will be prompted to answer a series of questions. Please note that the answer to the "first and last name?" question is important. This answer consitutes the CN= part of your so called distinguished name. TAPAS will check that the CN= part matches the end of the domain it requested the web page from. If the CN= and the the web page domain do not match then TAPEAR will be unable to connect to CASA. - Update
<jbossdirectory>/server/default/deploy/jbossweb-tomcat55.sar/server.xml
to use the keystore you just generated. Mine looks like<Connector port="8443" address="${jboss.bind.address}" maxThreads="100" minSpareThreads="5" maxSpareThreads="15" scheme="https" secure="true" clientAuth="false" keystoreFile="${jboss.server.home.dir}/conf/server.keystore" keystorePass="egad55" sslProtocol = "TLS" /> - Edit
<jbossdirectory>/server/default/deploy/http-invoker.sar/META-INF/jboss-service.xml
and add the following mbean<!-- Expose the Naming service interface via HTTPS --> <mbean code="org.jboss.invocation.http.server.HttpProxyFactory" name="jboss:service=invoker,type=https,target=Naming"> <!-- The Naming service we are proxying --> <attribute name="InvokerName">jboss:service=Naming</attribute> <!-- Compose the invoker URL from the cluster node address --> <attribute name="InvokerURLPrefix">https://</attribute> <attribute name="InvokerURLSuffix">:8443/invoker/JMXInvokerServlet</attribute> <attribute name="UseHostName">true</attribute> <attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute> <attribute name="JndiName"></attribute> <attribute name="ClientInterceptors"> <interceptors> <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor> <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor> <interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor> <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor> </interceptors> </attribute> </mbean> - Edit
<jbossdirectory>/server/default/deploy/http-invoker.sar/invoker.war/WEB-INF/web.xml
and add the following servlet declaration<servlet> <servlet-name>JNDIFactorySSL</servlet-name> <description>A servlet that exposes the JBoss JNDI Naming service stub through http. The return content is a serialized MarshalledValue containg the org.jnp.interfaces.Naming stub. This configuration handles requests for the standard JNDI naming service. </description> <servlet-class>org.jboss.invocation.http.servlet.NamingFactoryServlet</servlet-class> <init-param> <param-name>namingProxyMBean</param-name> <param-value>jboss:service=invoker,type=https,target=Naming</param-value> </init-param> <init-param> <param-name>proxyAttribute</param-name> <param-value>Proxy</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet><servlet-mapping> <servlet-name>JNDIFactorySSL</servlet-name> <url-pattern>/JNDIFactorySSL/*</url-pattern> </servlet-mapping> - Start JBoss
[edit]
Build and deploy CASA
- Update
<taupdirectory>/commons/src/org/opentapas/commons/remote/login.properties
to reflect your computer name (should match the name specified in the keystore). I edited one propertyjava.naming.provider.url=https://<computername>:8443/invoker/JNDIFactorySSL
- Build the commons library. From
<taupdirectory>/commons
executeant rebuild
- Update
<taupdirectory>/casa/casa.properties
to reflect the path to<jbossdirectory>
- Build and deploy CASA. From within
<taupdirectory>/casa
executeant deploy
[edit]
Build and run TAPEAR
- From within
<taupdirectory>/tapear
executeant rebuild
- From within
<taupdirectory>/tapear
executeant start_jar

