Installing JSPWiki using a Virtual Application Pattern
JayAllen 120000G6WH Visits (3934)
We’ve used a bunch of open-source Java applications in developerWorks over the years. When we were asked to give the VAP a try and document our experience we figured what better way to run it through its paces than to install, configure and run some of these open-source apps on it.
Because we’re huge fans of all things social networking we turned to a slim, elegant open source wiki, JSPWiki, as our first application on the VAP. It didn’t disappoint, and we even had some fun with it.
JSPWiki is perfect for a first application because it’s encapsulated all in one web application; it can run with a database but doesn’t require one, by default it stores its data in text files. All you need to do is download the application WAR file, make a few modifications to it for VAP dependent paths and settings, and add it to an EAR file for easy installation.
We’ve attached an empty EAR so all you need to do drop your modified WAR file in it. The context root of the application is set to /JSPWiki in the EAR application.xml but you can change it to anything you like.
Modifying the JSPWiki WAR
Once you’ve downloaded the JSPWiki WAR file you’re almost ready to begin but there’s one critical file that you have to change – jspwiki.properties located in JSPW
To change the base URL for JSPWiki:
Next we’ll set up the server directories for JSPWiki to write its files to. It took a bit of log crawling to find directories in the VAP that JSPWiki can write to but the following directories will work.
Tell JSPWiki the directory on the server to use for storing Wiki pages:
Next tell JSPWiki the directory for storing attachments:
Finally set up a JSPWiki log directory:
That’s it, save the file to the WAR and we’re ready to get down to business. For ease of deployment add the WAR file to the attached empty EAR. Again there are many ways to do this but we just drag and drop it into the EAR using 7-Zip.
Creating a Pattern for JSPWiki
We’ll assume you’ve already created a service instance so we’ll begin by managing it. From the IBM SmartCloud Control panel->Service Instances tab click Manage Service instance:
Login to IBM SmartCloud application workload services with the ID and password you set up when you created the service instance. Once in we’re going to straight to creating a virtual application pattern.
Now we’re at the really cool part. If you’ve ever struggled to install an application on Websphere you’re gonna love this, it’s all dragging and dropping and simple configuration. Ensure Web Application Pattern Type 2.0 is selected and then click on the green plus sign to bring up a dialog box.
Select Blank application in the dialog box then click Start Building…
From the Assets palette on the left drag onto the main diagramming area. Click inside the Enterprise Application box to reveal the configuration pane on the right. Upload the EAR file you updated with the modified JSPWiki WAR file earlier.
Click anywhere on the diagramming area to reveal the configuration pane on the right again and complete it with a name and description of the pattern, then save it. This is what the pattern will be called on the patterns page.
Return to the Patterns tab, refresh, and you’ll see the new pattern you just created appear in the list. Select it and then click deploy . Now click the Instances tab and select the pattern you just deployed, JSPWiki in our example. It’ll take a bit of time but all progress is logged so you have a good indication of how it’s going. You’ll know it’s complete when you see a screen like Figure 7.
Click on the endpoint and just like that you’ll be at JSPWiki! Before you start playing with it there’s *one* more configuration step you need to do. Since at the time of configuration we didn’t know the JSPWiki hostname to put in the baseUrl parameter we need to update the JSPWiki configuration. To update the config go to <end
We’re so close but there’s just one more step before we can start playing around – rebooting the instance to pick up the changed JSPWiki configuration. To do so go all the way back to the IBM SmartCloud Control panel –> Instances –> My instances tab. Once there find the JSPWiki instance you just created and select it. You’ll see the following, click Reboot instance.
Once the instance is restarted JSPWiki is ready to be used!
Have fun with your new wiki.
CJ, Arun, and Jay