fb
info@yenlo.com
WSO2 API Manager 4 min

Installing WSO2 API Manager on Windows

Rob Blaauboer
Rob Blaauboer
Integration Consultant & WSO2 Trainer
Installing WSO2 API Manager on Windows

In this blog, I’m going to describe a generic way of installation of the WSO2 API Manager on your Windows machine. Why generic? Well, simply because although the versions of the API Manager may change, the installation procedure for the API Manager, and in general all WSO2 products, is pretty much the same. I am going to describe a situation where we install as little as possible and also not make lasting changes to the PC. We can surely also run in VirtualBox with Vagrant, but that would require additional installations which I would like to avoid. 

Hardware and OS

So, what do we need, what do we need? Well, first of all, a Windows PC. Although other operating systems of course will also work (e.g. Linux), they require a different setup and this blog is about installation on Windows – and to be more specific: Windows 10. 

Microsoft’ strategy to push Windows 10 into the market with free updates has surely worked with more than 1 billion devices running Windows 10. However, the older versions will probably also work. As far as the hardware goes, let’s say that we need a modern PC meaning Intel Core i3, i5, i7 or equivalent chips from AMD, 8 gigabytes of Ram and all the other things that you expect from a modern-day PC.

Java

For the large part, WSO2 is written in Java and therefore a JDK or JRE is needed. These supply the environment that is needed to run WSO2. There are a number of Java versions, numbered from 1 to 18 at the moment. However, WSO2 requires either Java 8 or 11. When we consider the API Manager, Java 8 is a good choice since it will accommodate older versions of the API Manager. If you are sticking with, for instance, API Manager 3.2.0, Java 11 works. As far as the distribution, Adopt OpenJDK is ok, but others also work. 

Let’s start by downloading Adopt OpenJDK 11 from this URL (Java 8 can be found here as well). We will use the zip file rather than the installer(MSI). Make sure you have the right version, i.e. x64.

WSO2 

For this blog, I am going to use the Apache 2.0 version of the API Manager. This version can freely be used as described in the license, but it is not suited for use in a production environment. 

I will download the version directly from the WSO2 GitHub page for API Manager. Please download both files, wso2am-3.2.0.zip and wso2am-analytics-3.2.0.zip. It is a good idea to also download the MD5 checksum (wso2am-3.2.0.zip.md5 and wso2am-analytics-3.2.0.zip.md5) to verify the download. When you calculate the checksum on your PC, it should match the one you downloaded.

Open a CMD window and type the following command:

Installing API Manager on Windows 1

CertUtil -hashfile <path to file> MD5

Change the <path to file> to the actual path and file location.

Installing API Manager on Windows 2

Compare this to the MD5 file wso2am-3.2.0.zip: 08EFC5AD08626CA5E0799F63A56B728F. The only difference is lower/uppercase. Repeat for the Analytics zip as well.

Creating a directory

Create a directory on, for instance, the desktop using File Explorer. Call it, for instance, WSO2-AM.

Copy the three downloaded files (JDK, AM and Analytics) to that directory. Unzip each zip. You will end up with this:

Installing API Manager on Windows 3

I do not want to change any environment variables or path settings, so I am going to create a batch file that will set the required variables like:

  • JAVA_HOME
  • PATH

This change is only for the duration of the batch file.

But first we need to enable the Analytics in the WSO2 API Manager. This is done by changing the deployment.toml file in [AM-HOME]/repository/conf. 

Search for Analytics.

Installing API Manager on Windows 4

Uncomment and set enable to true.

Installing API Manager on Windows 5

Save the file. We now have enabled Analytics. 

Starting everything

The batch file looks something like this. This will set the parameters JAVA_HOME and PATH for the duration of the batch file and command window. Change the location (i.e. C:\Users…) to match your local installation.

@set OLDPATH=%PATH%
@set OLDJH=%JAVA_HOME%
@echo Setting JAVA_HOME
@SET "JAVA_HOME=C:\Users\rob\Desktop\WSO2-AM\jdk-11.0.11+9"
@echo JAVA_HOME: %JAVA_HOME%

@echo Setting PATH
@SET "PATH=C:\Users\rob\Desktop\WSO2-AM\jdk-11.0.11+9\bin;%PATH%"
@echo PATH: %PATH%

@echo starting WSO2 AM Analytics Worker Node
@cd C:\Users\rob\Desktop\WSO2-AM\wso2am-analytics-3.2.0\bin
@start worker.bat

@echo starting WSO2 AM Analytics Dashboard Node
@cd C:\Users\rob\Desktop\WSO2-AM\wso2am-analytics-3.2.0\bin
@start dashboard.bat

@echo starting WSO2 AM 3.2.0
@cd C:\Users\rob\Desktop\WSO2-AM\wso2am-3.2.0\bin
@start wso2server.bat

@cd ..\..

@set PATH=%OLDPATH%
@set JAVA_HOME=%OLDJH%
@echo Done

@set PATH=%OLDPATH%
@set JAVA_HOME=%OLDJH%
@echo Done

Result

This will start the worker, dashboard and API Manager in three separate windows whilst not making permanent changes to the computer, only for the duration of the command / terminal session the values have changed but also set to their original values. You can access the API Manager via the Management UI, Publisher portal, Devportal in your browser. This is the link to the Analytics Dashboard

Conclusion

This is a simple and non-intrusive way to install the WSO2 API Manager and Analytics on your PC. If you were to fully automate the setup with PowerShell, you could create a simple batch file that you could run whenever you need a setup on your PC. 

If you want to learn more about API Manager, please take a look at our Yenlo Training pages.

Whitepaper:
Advanced API Management Guide

advanced api 2
Get it now
eng
Close
We appreciate it
Care to share

Please select one of the social media platforms below to share this pages content with the world