The CrossWire Bible Society
  Home     About Us     Bible Societies, Outreach Ministries, & Publishers       Read the Bible  
       Contact     Volunteers & Developers     The SWORD Project    

   
SWORDWeb is a set of tools and ready to install web application for exposing SWORD functionality on a website.

See it in action

http://www.crosswire.org/study/

Installation

These instructions are Linux specific (don't all real websites run on Linux?), but the components used to make SWORDWeb operate all claim to be cross-platform, so please modify these instructions to work on the platform of your choice

Basic steps to get things up on your end:

Prerequisites

(along with the version we're using-- newer versions should work fine):

omniORB (omniORB-4.1.4) <-- recommended over ORBit


or

ORBit (ORBit2-2.12.4)
ORBit C++ (orbitcpp-1.3.9)

If you choose ORBit, it must be configured to NOT use its own accelerated transport, but instead, the standard IIOP. This is a little tricky. We do this by placing a file: /usr/etc/orbitrc, containing:
ORBIIOPIPv4=1
ORBIIOPIPv6=1
ORBIIOPUSock=0

This should be alternatively located at /etc/orbitrc, or /usr/local/etc/orbitrc, depending on how you configured ORBit

Java Development Kit (Sun JDK build 1.6.0-b13)
JSP/Servlet Engine (Apache Tomcat/6.0.20)

Example Prerequisite Machine

Ubuntu 9.10 with these packages:
  • subversion
  • automake
  • libtool
  • g++ (or build-essential on older Ubuntu systems)
  • zlib1g-dev
  • libicu-dev
  • libcurl4-openssl-dev
  • libclucene-dev
  • omniidl4
  • libomniorb4-dev
  • openjdk-6-jdk
RHEL6.2 (some of these require optional channel enabled along with EPEL repo added)
  • zlib-devel
  • libcurl
  • libcurl-devel
  • icu
  • libicu
  • libicu-devel
  • clucene-core
  • clucene-core-devel
  • omniORB-devel
and Tomcat downloaded from Apache and extracted to /opt/tomcat and started with /opt/tomcat/bin/startup.sh

NB: The Tomcat packages (tomcat6 tomcat6-admin) that come with Ubuntu (and similar packages from Fedora) are configured to place parts of Tomcat all throughout your system and this makes initial setup and development with SWORDweb more of a challenge for the un-initiated. Unless you are already familiar with your distribution's Tomcat packages, it is recommended to simply download Apache Tomcat from the apache website and unzip to /opt/tomcat. Everything will be self-contained in this folder and work fine.

Instructions:

Obtain sword and swordweb from SVN

$ svn co https://crosswire.org/svn/sword/trunk/ sword
$ svn co https://crosswire.org/svn/swordweb/trunk/ swordweb

Then:

$ cd sword

Then edit ./usrinst.sh to reflect any preferences you might have.

Then run:

$ ./autogen.sh
$ ./usrinst.sh

Be sure the options listed at the end satisfy your requirements. For example, you will probably want to be sure Lucene support is enabled. If not, you'll need to install your distro's clucene-devel package. Same with libicu-devel. Install distro packages and repeat ./usrinst.sh until SWORD finds everything you want. Then continue:

$ make
$ su
# make install
# make install_config
# exit

The SWORD engine should now be installed. You should be able to download any books from our site (http://www.crosswire.org/sword/modules/ Choose the RawZip download link for each book) that you wish to make available and unzip them to /usr/share/sword.

Alternative, you can use the command line module installation manager with something like:

$ sudo installmgr -sc
$ sudo installmgr -r CrossWire
$ sudo installmgr -ri CrossWire KJV
$ sudo installmgr -ri CrossWire StrongsGreek
$ sudo installmgr -ri CrossWire StrongsHebrew

You can test that the engine is working and finding its library with something like:

$ cd tests
$ make
$ ./mgrtest

Once the engine is working, building the ORB service should be pretty basic:

$ cd bindings/corba/omniorbcpp

or

$ cd bindings/corba/orbitcpp

then

$ make

At this point you can test that the ORB is working. There is a test client that makes basic calls to the service. To test, run ./server, then in another window, run ./testclient The IOR was outputted to the screen when you ran the ./server.

Once the service is working fine, `sudo make install` should copy 'server' to '/usr/bin/swordorbserver' for you, or you can move it someplace accessible yourself.

Now, if you'd like to get our webclient running, these steps should do it for you:

First, symlink the webapp folder inside your swordweb svn checkout to tomcat's webapps folder. For example:

ln -s ~/swordweb/webapp /opt/tomcat/webapps/swordweb

This makes tomcat aware of your swordweb web application and will cause it to serve requests for something like: http://localhost:8080/swordweb (this won't work yet, as we haven't completed the setup.)

Now let's build the Java stub which allows swordweb to talk with the SWORD engine. Still from the root of your sword svn checkout:

$ cd bindings/corba/java
$ vi Makefile

(or substitute vi for your favorite editor, and modify TOMCAT_HOME to point to your jsp engine, then modify instdir to point to your swordweb webapp folder. e.g., instdir=/home/myuser/swordweb/webapp or instdir=${TOMCAT_HOME}/webapps/swordweb)

$ make
$ make install

There is also a rudimentary testclient script in this directory which will run a simple java client which launches the c++ swordorbserver and tries to attach to it and call a few simple methods. If you would like to try, you will likely have to edit the testclient script and supply the correct paths.

Moving on to the swordweb svn checkout... there should be a src directory included which should be compiled using the associated Makefile, following suite, as before, being sure to first edit the Makefile to supply the appropriate paths.

Things SHOULD now show signs of life with something like:
http://localhost:8080/swordweb

There are many settings which you will want to adjust. Have a look at the configuration file:
swordweb/webapp/WEB-INF/swordweb.properties

There are a few simple examples under swordweb/examples. For learning to use the tools, these are much more concise than the full web application.

Help



Bug Reports / Feedback




        CrossWire Bible Society; P. O. Box 2528; Tempe, AZ   85280-2528   USA