How to Deploy WSO2 G-reg 3.6.0 on WebLogic 10.3

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Charitha Kankanamge
  • 17 Jan, 2011

Applies To 

WSO2 Governance Registry 3.6.0
Oracle WebLogic Server 10.3.3

 

 

Table of Contents

 
We will look into the following topics within this tutorial.
 
1.  Preparing WebLogic server
2.  Building a deployable artifact
3.  Configuring SSL on WebLogic
4.  Updating WSO2 Governance Registry configuration files
5.  Installing WSO2 Governance Registry on WebLogic
 

1. Preparing WebLogic Server

First, we should create a new domain in WebLogic server so that we can isolate WSO2 Governance Registry deployment from the others. Create a new weblogic domain by running config.sh {bat} located at
WebLogic_HOME/wlserver_10.3/common/bin directory. Let's assume the new domain is greg_domain.

Access your weblogic domain direcrtory and start weblogic (Go to WebLogic_HOME/user_projects/domains/greg_domain/bin and run startWebLogic.cmd).

2. Building a deployable artifact

Now, we need to build an artifact from WSO2 Governance Registry binary distribution so that it can be deployed on WebLogic server. Download WSO2 Governance Registry-3.6.0 from wso2.org/downloads/governance-registry. Extract the downloaded .zip into a directory. Copy repository and resources directories in to a new folder. Hereafter, we will refer to this new directory as greg-repo, i.e. /home/charitha/governance/greg-repo.

Also, create a new directory, greg, and copy the WEB-INF directory located at the lib/core directory of the downloaded WSO2 Governance Registry-3.6.0 to the greg directory. Now, your greg-repo should have the following sub directories.

- repository

- resources

- greg

The greg directory will be used as the webapp root and we will point to that during the installation process. In order to enable WSO2 Carbon logging inside WebLogic, you should copy log4j.properties file in the extracted WSO2 Governance Registry-3.6.0 directory to greg-repo\greg\WEB-INF\classes. Also, make sure to copy xalan-*.jar, xercesImpl-*.jar and xml-apis-*.jar from the lib/endorsed directory of the extracted WSO2 Governance Registry binary distribution to weblogic endorsed directory before you start WebLogic Server.

3. Configuring SSL on WebLogic

We must enable SSL in weblogic server since the interactions with WSO2 Governance Registry will have happened through HTTPS. Login to weblogic administration console (you should have configured username and password for admin console when creating your WebLogic domain) and go to Environment --> Servers. Then, select AdminServer.
Click on the Keystores tab. Configure Keystores as shown below.

keystores
 

Keystore = Custom Identity & Custom Trust
Custom Identity Keystore = /home/charitha/governance/greg-repo/resources/security/wso2carbon.jks
Custom Identity Keystore Type = JKS
Custom Identity Keystore Passphrase = wso2carbon
Confirm Custom Identity Keystore Passphrase = wso2carbon
Custom Trust Keystore = /home/charitha/governance/greg-repo/resources/security/wso2carbon.jks
Custom Trust Keystore Type = JKS
Custom Trust Keystore Passphrase = wso2carbon
Confirm Custom Trust Keystore Passphrase = wso2carbon

Now, select SSL tab and enter the following values.

Identity and trust locations = keystores
Private Key Alias = wso2carbon
Private Key Passphrase = wso2carbon
Confirm Private Key Passphrase = wso2carbon

Save the configuration and go to the General tab. Select the checkbox next to "SSL listen port enabled." Now, we have configured the necessary changes to enable SSL on weblogic. Let's continue with deploying WSO2 Governance Registry on weblogic.

4. Updating WSO2 Governance Registry configuration files

WSO2 Governance Registry is provided with a set of configuration files in GREG_HOME (root of the binary distribution)/repository/conf directory, which can be used to update the ports, database settings, web application context roots, etc. We will update carbon.xml, axis2.xml, registry.xml and user-mgt.xml which can be found at the above greg-repo/repository/conf directory.

First, open carbon.xml and update the ServerURL element as follows.

<ServerURL>https://localhost:7002/greg/services/</ServerURL>

 

Note that we have configured weblogic to run on 7002 port.
Since we deploy WSO2 Governance Registry on WebLogic server on non-root webContext, update the WebContextRoot element as follows.

<WebContextRoot>/greg</WebContextRoot> Save and close carbon.xml.

Open registry.xml and update DB URL as follows.

<url>jdbc:h2:/home/charitha/governance/greg-repo/repository/database/WSO2CARBON_DB;create=true</url>

 

Now, open user-mgt.xml and update database URL as follows.

<url>jdbc:h2:/home/charitha/governance/greg-repo/repository/database/WSO2CARBON_DB;create=true</url>

 

Make sure to specify the absolute path of the WSO2CARBON_DB in both of the above elements.

We must change the http and https ports in Transports section of axis2.xml as follows.

<transportReceiver name="http"
class="org.wso2.carbon.core.transports.http.HttpTransportListener">
<parameter name="port">7001</parameter>
</transportReceiver>
<transportReceiver name="https"
class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
 <parameter name="port">7002</parameter>
</transportReceiver>

 

5. Installing WSO2 Governance Registry on WebLogic

We have completed the required configurations and, now, are ready to deploy WSO2 Governance Registry on weblogic.

First, shutdown the weblogic server instance if it is still running.

Open a new command window or shell and change the directory to WebLogic_HOME/user_projects/domains/greg_domain/bin.

Define an environment variable called CARBON_HOME and set the path to your greg-repo directory.

In MS Windows; set CARBON_HOME=C:\governance\greg-repo.

In Linux; export CARBON_HOME=/home/user/governance/greg-repo.

Run startWebLogic.cmd.

Once the server is started successfully, log in to weblogic administration console using https://localhost:7002/console.

Then, go to the Summary of Deployments page and select Install.

Locate the deployment root by selecting /home/charitha/governance/greg-repo/greg directory.

The web app root directory will be shown with a radio button option as follows.

deployment

Click on next to proceed through the wizard and continue with the default settings. Once the deployment is successful, save the configuration and select start --> servicing all requests.

Now, we are done with the deployment.

You can access the management console using https:\\localhost:7002\greg\carbon

 

Author:

Charitha Kankanamge

Senior Technical Lead and Manager - Quality Assurance; WSO2, Inc.

charitha@wso2.com