[sword-devel] Diatheke

Chris Little sword-devel@crosswire.org
Tue, 2 Jan 2001 11:59:30 -0800


First, I would strongly recommend using the latest version of SWORD from
CVS.  It has a MUCH improved version of Diatheke in it that fixes many bugs
and includes support for new ThML modules.  It's also easier to build since
it's in the SWORD source tree already, in the apps/console/diatheke
directory.

If you don't want to bother with getting CVS, tell me and I can post a
snapshot online.

> I placed all of sword-1.5.tar.gz into a directory /sword and placed
> everything from kjv.zip into /html/sword
>
> I copied the contents of /html/kjv/kjv.conf into /sword/mods.onf
> and changed
> the paths like this:

You will probably find it easier to use the new module configuration format,
which doesn't require copying all the module .conf files into a single big
mods.conf file.  To use it you just need to set up an environment variable
SWORD_PATH equal to the directory containing your mods.d directory.  In your
case I would use /sword.  You could add a line "export SWORD_PATH=/sword" to
one of your startup scripts, like /etc/bashrc or /etc/profile to make this
the default setting for all users.

Then you can just install new modules by unzipping them into /sword.  The
.conf files will go into /sword/mods.d and the rest of the module files will
go somewhere in the /sword/modules tree.

> It took me a while to figure out this is where my stuff is on the server.
> When I made this change, make worked and it created two files called
> diatheke.o and diatheke.d

Those are both intermediate/temporary build files.  There should also have
been a file called, simply, "diatheke".  That's the actual executable.  I'd
recommend putting it somewhere where it is accessible by all users
(including the httpd daemon running as user nobody) such as /usr/bin or
/usr/local/bin.

The next thing you need to do is copy diatheke.pl and dia-def.pl into you
cgi-bin directory.  Now edit diatheke.pl.  There are two variables at the
beginning that need to be changed.  $diatheke should be set to match the
location of diatheke (the executable) on your machine.  "nice
/usr/bin/diatheke" is the default, so leave it if you placed diatheke in
/usr/bin.  The 'nice' should be left as well, and just tells the cgi to run
the program at low priority.  $sword_path should be set equal to the
environment variable you set for the path, in your case "/sword".

The cgi should now be set up.  Loading
http://elbourne.org/cgi-bin/diatheke.pl should give a blank page, with a
SWORD logo at the bottom.
http://elbourne.org/cgi-bin/diatheke.pl?KJV=on&verse=jn3:16 should actually
show a verse.  You can use index-public.html from the diatheke directory as
a template for building your own HTML interface to the CGI.

If you have any other questions, please do ask.

--Chris