Jigsaw: A Revolutionary Web Server for Linux

Mr. Haddad exposes the design philosophy and essential features of the Jigsaw web Server, an open-source project from W3C, and provides a brief guide for installing it on Linux.
1. Unpack the Distribution File

The distribution comes in the form of jigsaw-x.x.x.tar.gz. You need to choose a place to unpack it. I installed it under /usr/local/Jigsaw. However, you can install it in a directory of your choice. Since the selection of the installation directory will not be the same for all of us, we will call this directory INSTDIR. You have to change INSTDIR with the absolute path where you have unpacked the distribution.

To unpack the distribution, at the shell prompt you apply:

% tar -xzvf jigsaw-x.x.x.tar.gz

This will create a number of directories under the Jigsaw main directory:

Jigsaw/src jigsaw sourcesJigsaw/scripts sample scripts to start the Jigsaw server and the JigAdmin serverJigsaw/classes pre-compiled classesJigsaw/lib native code support for SolarisJigsaw/Jigsaw the root directory to run the server in

The Jigsaw/Jigsaw directory contains:

  • The configuration directory for the server

  • The configuration directory for the administration server

  • The directory for log files

  • The directory for caching when using Jigsaw as a caching proxy

  • The exported file space

2. Set up the Environment

Next, we specify to the Java interpreter the place where Jigsaw classes are stored. We do this by setting the CLASSPATH environment variable. For Jigsaw 2.1.0 and up, we set it as follows:

% CLASSPATH=INSTDIR/Jigsaw/classes/jigsaw.jar:INSTDIR/Jigsaw/classes/sax.jar:INSTDIR/Jigsaw/classes/xp.jar:.% export CLASSPATH
3. Build the Property Files

The last step is to build the property files. We do that by switching into the Jigsaw subdirectory:

% cd INSTDIR/Jigsaw/Jigsaw

and execute:

% java Install

Running Jigsaw

After completing the installation procedure, we are set to run Jigsaw. We switch into the installation directory and type in the following command:

% java org.w3c.jigsaw.Main -host host -root INSTDIR/Jigsaw/Jigsaw

where host is the full IP hostname of the machine, and INSTDIR is the absolute path of the location where we have unpacked the distribution file.

Alternatively, we could run the provided script that would start the Jigsaw sever for us:

% ./script/jigsaw.sh &

Jigsaw will run and produce a debug message such as the following:

[root@byblos ]# ./scripts/jigsaw.shloading properties from: /usr/local/Jigsaw/Jigsaw/config/server.props
*** salvaging resource manager state...
*** resource store state salvaged, using: 1
*** Warning : JigAdmin[2.1.1]: no logger specified, not logging.
JigAdmin[2.1.1]: serving at http://byblos.lmc.ericsson.se:8009/*** salvaging resource manager state...*** resource store state salvaged, using: 31
Jigsaw[2.1.1]: serving at http://byblos.lmc.ericsson.se:8001/

Testing the Installation

To verify that the Jigsaw server is up and running, start your favorite web browser and point it to your workstation address at port 8001, which is the default port for the Jigsaw server. Et voilà! We get the Jigsaw server home page (see Figure 1), similar to the Apache installation home page.

Figure 1. Jigsaw Server Home Page

Similarly, to check if the JigAdmin server started properly, we follow the same procedure except that we specify port 8009, which is the default port for the JigAdmin Server.

Setting Jigsaw to Run at System Startup

Now the Jigsaw server is up and running. However, if you reboot the machine, Jigsaw will not automatically start. To set up Jigsaw to start at boot time, you need to follow three steps:

1. Create a file called, for instance, jigsawstart with the following contents:

#!/bin/sh# Jigsaw Launcher Script
# Note:
# to be adjusted to reflect your own installation
# Define Jigsaw Path

# Define Jigsaw libraries Path

/usr/local/jdk1.2.2/bin/java -Xms16m -Xmx128m org.w3c.jigsaw.Main
${JIGSAW_HOME}/Jigsaw $*

2. Save the file in /bin or /usr/bin and allow execution permission on it by typing % chmod +x jigsawstart

3. Edit /etc/rc.d/rc.local and add an entry to start up the jigsawstart script. All we need to do is add the following lines at the end of rc.local:

echo "Running Jigsaw ..."/usr/bin/jigsawstart &

This procedure guarantees Jigsaw start up at boot time.