Installing JSPWiki and Tomcat

From AIRWiki
Jump to: navigation, search

Quick notes (maybe they will become a full tutorial one day...):

  • be sure you have JDK installed (Java5 or Java6 should be both fine) and Eclipse (choose "Eclipse Classic" from here)
  • be sure your environment variables are set the proper way (in particular, JAVA_HOME. See below for final setup)
  • download both Tomcat binaries and JSPWiki sources: for Tomcat, we're using v5.5, that you can download from here (direct links: linux binaries, windows installer). For JSPWiki sources, you might want to download either stable or beta here (link to stable sources here)
  • extract Tomcat in one directory (here we chose /opt/tomcat5.5). Tomcat can then be started just by calling its startup file, in our case /opt/tomcat5.5/bin/startup.sh. Once started, try to connect to your local Tomcat server just by entering the following URL in your browser:
http://localhost:8080
  • Now you can import the JSPWiki sources into a new Eclipse project: to do this, just open Eclipse, choose File->Import and then Existing Projects into Workspace. Choose Select archive file and then select the JPSWiki sources ZIP file. Click Finish and the project will be imported!
  • The build.xml file needs a patch: change all (two) occurrencies of keytool with ${env.JAVA_HOME}/bin/keytool inside this file
  • The installation script file can be modified in an easier way to work with your system: just copy the following inside your install.sh file
#!/bin/sh
#
#  A very simple installer script which restarts tomcat as well.
#
#  This is just a sample.
#
 echo "Installing in private"
 TOMCAT_HOME=/opt/tomcat5.5
 private=1
#
 $TOMCAT_HOME/bin/shutdown.sh
#
 ant clean
 ant war
#
 rm -rf $TOMCAT_HOME/webapps/JSPWiki
 USER=`whoami`
 cp /tmp/$USER/JSPWiki/install/*.war $TOMCAT_HOME/webapps
#
 cd $TOMCAT_HOME/webapps
 rm -rf JSPWiki
 mkdir JSPWiki
 cd JSPWiki
 jar xf ../JSPWiki.war
#
 $TOMCAT_HOME/bin/startup.sh
  • After this, just running install.sh as root from the JSPWiki directory inside your workspace will recompile and redeploy the wiki into your system.
  • Finally, an excerpt from /etc/environment. This should help you to understand which environment variables have to be set and how. Also remember that ${JAVA_HOME}/bin and ${ANT_HOME}/bin have to be added to your path.
JAVA_HOME="/java"  (a symlink from /java to /opt/jdk.version has been created)
CATALINA_HOME="/opt/tomcat5.5"  (/opt/tomcat5.5 is where the Tomcat tgz has been extracted)
CATALINA_BASE="/opt/tomcat5.5"
CATALINA_TMPDIR="/opt/tomcat5.5/temp"
ECLIPSE_HOME="/home/mala/eclipse"  (this is the dir where eclipse has been extracted)
ANT_HOME="${ECLIPSE_HOME}/plugins/org.apache.ant_1.6.5" (note: ant version might change)