Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

Admin30.InstallOnJelastic

How to install openCRX on Jelastic

Jelastic (acronym for Java Elastic) is an unlimited PaaS and Container based IaaS within a single
platform that provides high availability of applications, automatic vertical and horizontal scaling
via containerization. For more information see here. This guide explains
how to setup openCRX on Jelastic.

Prerequisites

This guide assumes that you are familiar with the basic features of Jelastic.

IMPORTANT: This guide assumes that openCRX 3.0 Server is successfully setup as described in openCRX 3.0.0 Server Installation Guide.

Create and configure environment

Launch the Jelastic administration console and create a new JAVA environment with the following topology:

  • Apache 2.2 as frontend (we did not test nginx but it should work as well)
  • TomEE 1.7 as application server
  • PostgreSQL as database (you can migrate to another supported database later on at any time. For more information see here)

Select Apache 2.2 as frontend:

Select TomEE 1.7 / Java 7 as application server:

Select PostgreSQL 9.4 as database:

After building the environment the layout should look as follows:

As a next step we have to create a new database. Login to the PostgreSQL administration console and create a new database instance as shown below:

The following fields are mandatory and must be set as follows:

  • Name: CRX (default database name of openCRX)
  • Template: template0 (this template allows to set the collation to C)
  • Encoding: UTF-8 (openCRX supports UTF-8 encoding only)
  • Collation: C (allows ordering as required by openCRX. For more information see here)

After the database is created we have to create the bootstrap database schema. This schema contains only a minimal set of tables required to start start openCRX and login as Root administrator. Select the database CRX and click on the SQL button to launch the SQL script window. Get the create schema script from here and upload it to the SQL script window by clicking on the Choose File button:

The script should run without errors as shown below:

Next we have to prepare TomEE 1.7. Click on the Config button of the TomEE node as shown below:

Select the directory apps click on the Upload button and upload the file opencrx-core-CRX.ear. You can get the file from an existing openCRX server installation. It is located in the directory ./apache-tomee-webprofile-1.7.1/apps/.

Next switch to the directory lib and upload the following files:

  • catalina-openmdx.jar: You can get the file from an existing openCRX server installation. It is located in the directory ./apache-tomee-webprofile-1.7.1/lib/.
  • postgresql-9.4-1202.jdbc4.jar: you should download the latest JDBC driver for PostgreSQL from here.

Next switch to the directory server and open the file variables.conf. Paste the following text:

    # BEGIN openCRX
    -Dfile.encoding=UTF-8
    -Dorg.openmdx.kernel.collection.InternalizedKeyMap.TrustInternalization=true
    -Dorg.opencrx.maildir=home/maildir
    -Dorg.opencrx.airsyncdir=home/airsyncdir
    -Dorg.opencrx.mediadir=home/mediadir
    # -Dorg.opencrx.usesendmail.CRX=false
    # -Dorg.openmdx.persistence.jdbc.useLikeForOidMatching=false
    # -Djavax.jdo.option.TransactionIsolationLevel=read-committed
    # END openCRX

In a next step we have to configure TomEE so that it can access the database. Open the file tomee.xml and paste the following text:

    <?xml version="1.0" encoding="UTF-8"?>
    <tomee>
      <!-- see http://tomee.apache.org/containers-and-resources.html -->

      <!-- openCRX/PostgreSQL -->
      <Resource id="jdbc_opencrx_CRX" type="DataSource">
        JdbcDriver org.postgresql.Driver
        JdbcUrl jdbc:postgresql://{{pg env and host name}}/CRX
        UserName {{pg username}}
        Password {{pg password}}
        JtaManaged true
        RemoveAbandoned true
        RemoveAbandonedTimeout 10
        LogAbandoned true
        MaxWait 100
      </Resource>

      <!-- activate next line to be able to deploy applications in apps -->
      <Deployments dir="apps" />

    </tomee>

Make sure that you replace place holders {{pg env and host name}}, {{pg username}}, {{pg password}} with the proper settings from your Jelastic environment.

Now open tomcat-users.xml and and paste the text below. This allows us to login as user admin-Root.

    <?xml version='1.0' encoding='utf-8'?>
    <tomcat-users>
      <role rolename="OpenCrxUser"/>
      <role rolename="OpenCrxRoot"/>
      <role rolename="OpenCrxAdministrator"/>  
      <user username="admin-Root" password="manager99" roles="OpenCrxRoot,OpenCrxAdministrator"/>
    </tomcat-users>

Last we have to modify server.xml as shown below. We have to add the option URIEncoding="UTF-8" for the connectors AJP/1.3 and HTTP/1.1. This guarantees proper URL encoding for all UTF-8 characters:

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" URIEncoding="UTF-8" />

Now restart the TomEE node as shown below:

Switch to the logs by clicking an the Log icon and select the log file catalina. This shows the startup progress of TomEE and openCRX:

Now click on the Open in browser icon.

This connects the TomEE with the root URL. Append opencrx-core-CRX to the URL in the browser address bar. This brings up the login screen of openCRX:

Now you have a running (empty) openCRX instance. Follow the instructions of the upgrade guide in order to complete the installation of openCRX:

  • Launch and run the database schema wizard
  • Load the code tables
  • Create and setup the segment 'Standard'