WSO2

F. Ana. D
3 min readNov 28, 2020

I start working on WSO2 months ago, so my knowledge about it is still very low. I am going to write the steps to install + basic configuration until it running alright.

The first time I install WSO2 on my local was with big help from my Senior, so I don’t know much about how to install it. Until I have a new clean workspace. So I need to work hard remembering the steps that my senior did when configuring WSO2. So here I am now trying to document my attempt to install WSO2 on my own. I am using WSL 18.04 on Windows 10, just so you know.

  • Install WUM

Install WSO2 Update Manager (wum) here. Ah, you need to have WSO2account too. Go create one if you haven’t!

After you download it, extract it into /usr/local, something like this:

tar -C /usr/local -xzf wum-3.0.6-linux-x64.tar.gz

Then, add the path to the PATH environment:

export PATH=$PATH:/usr/local/wum/bin

Finally, Check if wum installed successfully by running `wum`.

$ wum
WUM keeps WSO2 products up-to-date.
Usage:
wum [command]
Available Commands:
......
  • Download WSO2 products

First, initialize wum, and input the WSO2 credential that you created earlier.

$ wum init
Please enter your WSO2 credentials to continue
Authenticating...
Done!
Setting default channel full...
-- Welcome to WUM 3.0.6 --........

After that, you can download the products, I choose the latest version per July 2020.

wum add wso2am-3.1.0
wum add wso2is-km-5.10.0

They usually downloaded to this path `.wum3/products/` Now, unzip them to your desired path, for example: unzip them to wso folder:

unzip .wum3/products/wso2am/3.1.0/wso2am-3.1.0.zip ~/wso/wsoam
unzip .wum3/products/wso2is-km/5.10.0/wso2is-km-3.1.0.zip ~/wso/wsois
  • Prepare the database

WSO products come with an h2 database, but I am using Percona 5.7. Create the databases and don’t forget to change ana with your user and password.

create database regdb character set latin1;
create database apim_db character set latin1;
grant all previleges regdb.* to ana@localhost identified by 'ana';
grant all previleges apim_db.* to ana@localhost identified by 'ana';

After databases ready, now import the SQL needed, in your own way. I am using Mysql Workbench. IS-HOME is wso2is-km and api-m_home is wsoam.

import these to regdb:<IS-HOME>/dbscripts/identity/mysql.sql
<IS-HOME>/dbscripts/identity/uma/mysql.sql
<IS-HOME>/dbscripts/consent/mysql.sql
<IS-HOME>/dbscripts/mysql.sql
import these to apim_db:
<API-M_HOME>/dbscripts/apimgt/mysql.sql
  • Add MysqlConnector.jar to /repository/components/lib
  • Configure APIM & IS deployment.toml

In this part, I still lack knowledge of every line of this file (API-M_HOME/repository/conf/deployment.toml and IS-HOME/repository/conf/deployment.toml). I only know a few of them. You can compare it with the original file to find out the difference.

  • Configure log4j2.properties

For a better experience when debugging, we edit this file (API-M_HOME/repository/conf/log4j2.properties).

  • Configure scim2-schema-extension

This file (IS-HOME/repository/conf/scim2-schema-extension.config) is still a mystery for me for now. Hope I can understand this after writing this article lol.

  • If your IS-KM is version 5.10.0, Configure these files.

`IS-HOME/repository/components/tools/forget-me/extensions/user-store/conf/config.json`

from

"handler-mapping;org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager":"jdbc-handler",

to

"handler-mapping;org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager":"jdbc-handler",

`IS-HOME/repository/conf/user-mgt.xml`

from

<UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">

to

<UserStoreManager class="org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager">

`IS-HOME/repository/resources/conf/infer.json` and `API-M-HOME/repository/resources/conf/infer.json`

from

"user_store.type": {"database": {"user_store.class": "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager",

to

"user_store.type": {"database": {"user_store.class": "org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager",
  • Now, start IS first from IS-HOME/bin run `./wso2server.sh`
$ ./wso2server.sh
JAVA_HOME environment variable is set to /usr/lib/jvm/default-java
CARBON_HOME environment variable is set to /home/ana/wso/wsois
Using Java memory options: -Xms256m -Xmx1024m
callhome [org.wso2.callhome.internal.CallHomeActivator] DEBUG : Activating CallHome agent
org.apache.openjpa [org.apache.openjpa.osgi.PersistenceActivator] DEBUG : JPA-PersistenceUnits:ode-dao,ode-store
org.apache.openjpa [org.apache.openjpa.osgi.PersistenceActivator] DEBUG : JPA-PersistenceUnits:HT-PU
........
[2020-07-10 09:15:04,280] [] INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} - Server : WSO2 Identity Server-5.10.0
[2020-07-10 09:15:04,283] [] INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} - WSO2 Carbon started in 140 sec
[2020-07-10 09:15:04,983] [] INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} - Mgt Console URL : https://localhost:9444/carbon/
  • Then, start APIM from API-M_HOME/bin run `./wso2server.sh`
ana@LAPTOP-QGNC79IR bin$ ./wso2server.sh
JAVA_HOME environment variable is set to /usr/lib/jvm/default-java
CARBON_HOME environment variable is set to /home/ana/wso/wsoam
Using Java memory options: -Xms256m -Xmx1024m
andes [org.wso2.andes.wso2.internal.QpidBundleActivator] INFO : Setting BundleContext in PluginManager
callhome [org.wso2.callhome.internal.CallHomeActivator] DEBUG : Activating CallHome agent
[2020-07-10 09:16:52,547] INFO - CarbonCoreActivator Starting WSO2 Carbon...
.........
[2020-07-10 09:18:28,511] INFO - StartupFinalizerServiceComponent Server : WSO2 API Manager-3.1.0
[2020-07-10 09:18:28,513] INFO - StartupFinalizerServiceComponent WSO2 Carbon started in 142 sec
[2020-07-10 09:18:29,911] INFO - CarbonUIServiceComponent Mgt Console URL : https://localhost:9443/carbon/
[2020-07-10 09:18:29,915] INFO - CarbonUIServiceComponent API Developer Portal Default Context : https://localhost:9443/devportal
[2020-07-10 09:18:29,916] INFO - CarbonUIServiceComponent API Publisher Default Context : https://localhost:9443/publisher

If that happens, then you're okay, Ana! Take a break and get some sleep. Go! Hope this article will help me again next time ~

--

--

F. Ana. D

Software Engineer — [Note: English is not my first language so please bear with me]