cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

JSPWikiOnGlassfish

This site is powered by http://jspwiki.org running on GlassFish. GlassFish is an open source project whose goal is to implement a full Java EE compliant application server. It's sponsored by Sun Microsystems and hosted at https://glassfish.dev.java.net/. GlassFish is the base of Sun Java System Application Server product and also is the reference implementation of Java EE 5 spec.

This document captures our experience with running JSPWiki on GlassFish.

Installation

JSPWiki is just a plain java web application. Just deploy the war using the web admin console and you can be up and running in a minute. But we found it better to use a slightly different scheme

  • Create a dir somewhere on the server, name it for example /nbwiki
  • Unpack the war file under /nbwiki/war
  • Use the GlassFish admin console to deploy from local directory /nbwiki/war

This is to save to headache when you want to upgrade JSPWiki. With this scheme one can rename /nbwiki/war to /nbwiki/war.old, unpack the new version of JSPWiki into /nbwiki/war, copy over the important files from war.old/WEB-INF, probabably also your custom JSPWiki template, restart the domain. In case of trouble one can roll back quickly. Of course you should have a staging server somewhere internally and test everything before upgrade software on a public server. But even with staging bad things still can happen when you go live. The other benefit is if you upgrade by uploading the war file via the web console, it overwrites the exiting web app dir, including JSPWiki config file.

Configuration

Assume you deploy JSPWiki in a domain named "domain1". Before starting the JSPWiki web app, you need to do the following steps manually

  • merge WEB-INF/jspwiki.jaas into <gf>/domains/domain1/config/login.conf
  • merge WEB-INF/jspwiki.policy into <gf>/domains/domain1/config/server.policy, and customize the policy there
  • copy WEB-INF/jspwiki.jks to <gf>/domains/domain1/config/jspwiki.jks. This is important. I made a mistake once and spent hours on it

Session timeout by default is 30 minutes. This may be too short, change it in the admin console for all web apps (http://yourserver:4848/), node Configuration -> Web Container -> Session Properties, or just JSPWiki, by modifying its web.xml and add this XML fragment

<session-config>
    <!-- set timeout to 3600 seconds -->
    <session-timeout>3600</session-timeout>
  </session-config>
</web-app>