Building and Deploying TAPAS

From TAPASWiki

Jump to: navigation, search

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

Prerequisites

  • Destination machine has ANT installed
  • Destination machine has SVN installed

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

Set up OpenTAPAS database in Postgresql

  1. Download Postgresql from http://www.postgresql.org/download/ (at the time of writing, I downloaded version 8.1.5)
  2. 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)
  3. Login to a shell as postgres
    su -l postgres
  4. Start PostgreSQL
    pg_ctl -D <datadirectory>/data -l logfile start
  5. Create a database for OpenTAPAS
    createdb tapas
  6. Initialize the database. From within
    <taupdirectory>/casa/db
    execute
    psql -d tapas -f tapas_schema.sql
    psql -d tapas -f tapas_data.sql
    psql -d tapas -f tapas_sequences.sql

Set up JBoss

  1. Download Jboss Application Server from http://jboss.org to <jbossdirectory> (at the time of writing, I downloaded version 4.0.2)
  2. Generate a keystore from within
    <jbossdirectory>/server/default/conf/
    using this command
    keytool -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.
  3. 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" />
  4. 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>
  5. 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>
  6. Start JBoss

Build and deploy CASA

  1. 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 property
    java.naming.provider.url=https://<computername>:8443/invoker/JNDIFactorySSL
  2. Build the commons library. From
    <taupdirectory>/commons
    execute
    ant rebuild
  3. Update
    <taupdirectory>/casa/casa.properties
    to reflect the path to
    <jbossdirectory>
  4. Build and deploy CASA. From within
    <taupdirectory>/casa
    execute
    ant deploy

Build and run TAPEAR

  1. From within
    <taupdirectory>/tapear
    execute
    ant rebuild
  2. From within
    <taupdirectory>/tapear
    execute
    ant start_jar
Personal tools