Month: January 2016

Installing WebSphere on Linux

In order to test/resolve certain WebSphere specific OpenAM bugs, I decided to install this lovely container on a brand new Ubuntu VM. Now I must tell, I’m slightly biased towards open source containers, as they tend to be actually usable and aren’t as overcomplicated as their enterprise competitors (yes I’m talking about you WebSphere and WebLogic). So keeping that in mind let’s see what kind of suffering does one have to go through to get to a running WebSphere instance. NB: this is mostly a rant, the mostly useful info can be found at the bottom of this post. 🙂

How not to do it

I started with searching for “download ibm websphere 8.5.0”, and after a few clicks I figured out a few things:

  • There are service packs for each release or something alike, and apparently 8.5.0.2 is the latest for 8.5.0
  • There is also a release called 8.5.5
  • According to Wikipedia 8.5.5 can run on Java 8 as well

Since I like shiny new things, and one can only hope that new is always better, I decided that I want to install 8.5.5. After visiting the 8.5.5 pages I had to realize that installing 8.5.5 has the prerequisite of having 8.5.0 installed (enterprise software, eh), so let’s go back to the 8.5.0.2 downloads again…
The descriptions of the downloads are rather dubious, so I ended up downloading the first downloadable thing, and hoped for the best. Of course at this point I didn’t even wonder why the hell I need to download 2.4 GiB worth of ZIP files for an application server…
So I have unzipped the 2 downloaded files and I had to conclude that simply put there is no binary file that you can actually run. It turns out that the files that I just got now, are files that can be utilized by an IBM Installation Manager (facepalm). Of course there is little to no information about whether all the IM versions are actually able to install all existing IBM software, but who knows, maybe I’ll get lucky.

Nope. The IBM Installation Manager doesn’t really allow you to install anything by default, you need to add repositories manually to get it working (why it doesn’t come with default set of repositories that allows installing anything is beyond me), so I end up trying to point IM towards my unzipped 8.5.0.2 files and it seems like it’s able to pick up that repository.config file just fine. Trying to install anything still yields the same error though about not having any repositories present or that the ones configured have nothing installable. Just great.
The problem must be that I’m using the wrong version of the IM, and maybe an older version will be able to work with my downloaded 8.5.0.2, right? So I start to look for an IM version that is recommended for 8.5.0.2, after some random Google hits I find a documentation that mentions 1.5.3 version of IM, and I’ll attempt to download it, but I hit a new problem now.

Apparently writing 64 bit software for Linux seems to be a difficult thing to do for IBM, and the only downloadable items are for 32 bit Linux and some very weird 64 bit platforms that I’ve never heard of before. Downloading the 32 bit version of IM and then installing the following packages on Ubuntu helped a little bit:

apt-get install lib32z1 libgcc1:i386

But even with this old version of IBM IM I’m unable to install 8.5.0.2. At this point I just start to search a lot more, and finally I get to the holy grail.

How to install WebSphere

Search for WebSphere Express Trial and go through some silly registration process then make sure you uncheck all options about contacting you and if you did everything right, you will get access to a WebSphere 8.5.5.8 installer (somehow downloading the Express does not have the prerequisite of installing 8.5.0, no comment).

Once installed using the IBM Installation Manager you should realize that the IBM JDK shipped with WebSphere is a 32 bit only application, so make sure you’ve ran the above apt-get command beforehand.

Create a custom profile

I still don’t really know what a profile is meant to be, but I had this strong urge to create one, as everything in WebSphere seems to rely on these things. So I came up with the following commands:

$ bin/manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default -profileName default -profilePath /opt/IBM/WebSphere/AppServer/profiles/default
$ bin/manageprofiles.sh -setDefaultName -profileName default

Making my profile the default one should mean that I don’t have to use the -profileName default all the time when interacting with the CLI, so hopefully that will make my life easier in the long run.

At this stage I should mention that if for some reason the profile creation just hangs and doesn’t want to finish at all, then apparently your problem is that your /bin/sh does not map to /bin/bash! I mean what the hell…

Using IBM JDK7

Foolishly I thought that a standalone IBM JDK7 can be utilized by WebSphere, but of course I couldn’t really get that to work (not sure how to make managesdk aware of an external JDK installation), so I had to follow the official guide of downloading a WebSphere specific IBM JDK7, and then I had to use the managesdk utility to ensure that my default profile will use IBM JDK7:

$ bin/managesdk.sh -setNewProfileDefault -sdkName 1.7_32

That’s it, after all this you should be able to run WebSphere with the following command:

$ bin/startServer.sh server1 # No idea where that server1 comes from

Once WebSphere is running you can access the admin console at http://localhost:9060/ibm/console (if you only enter localhost:9060 you will face an error message to be absolutely user friendly), and your applications should be theoretically under port 9080 (because who needs to be consistent with every other container and port 8080).

Next time I’ll blog about OpenAM instead, promise. 🙂