home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.muug.mb.ca
/
2014.06.ftp.muug.mb.ca.tar
/
ftp.muug.mb.ca
/
pub
/
src
/
gopher
/
gopher1.01
/
doc
/
gindexd.doc
< prev
next >
Wrap
Text File
|
1992-04-07
|
8KB
|
246 lines
What is gindexd?
----------------
Gindexd allows you to serve indexes of data residing on a gopher
server. Gindexd will allow you to search through a voluminous amount
of data quickly.
Gopher Index server documentation.
----------------------------------
There are two different versions of gindexd, one that is specifically
tailored for NeXT machines, and one that is built using code from the
WAIS project.
Installation instructions for the NeXT gindexd.
-----------------------------------------------
First get the libtext and btree libraries. Available as a separate
tar file called NeXTtext.tar.Z. Go to the gindexd directory and
untar it. The files libbtree.a and libtext.a will be created. You may
copy them to /usr/local/lib if you so desire.
Type "make next"
Installtion instructions for the WAIS gindexd.
----------------------------------------------
First get the wais distribution ftp to "think.com" and get
/wais/wais-8-b4.tar.Z Untar this and edit the makefiles appropriate
for your system.
After you untar the thing, go into the top level directory and type
"make lib"
"make ir"
Or just type make if you want the whole thing.
Now copy the gindexd directory into the same level as the directories
ir, x, etc. i.e.
% cp -r index-server {your wais directory}/
Go into the index-server directory and type "make wais".
How To Set Up An Index Server
-----------------------------
An full-text index is used to rapidly find data in a set of files.
The first step in making a gopher index server is to build the index
on your data files.
For the NeXT this command is called ixBuild.
For the WAIS server this command is called waisindex.
Okay, how about a real world example? Suppose that you have a
directory structure that contains your grandmother's favorite recipes
located in /home/mudhoney/recipes/. Also assume that there are
subdirectories for cakes, pies, and stews i.e. :
-------
% pwd
/home/mudhoney/recipes
% ls
cakes/ pies/ stews/
-------
Assume also that you will be running a gopher data server on the
directory /home/mudhoney/recipes.
Building the index with the NeXT and ixBuild.
---------------------------------------------
Go into the directory you want as the root level of your index. If
you want to index all of the recipes you'd type the following:
cd /home/mudhoney/recipes
mkdir .index
ixBuild -V
This will make an index in the file:
/home/mudhoney/recipes/.index/index.ixif
If you wanted to just index the pies subdirectory you would do the
following:
cd /home/mudhoney/recipes/pies
mkdir ../.index
ixBuild -V -i../.index/index.ixif
...or
cd /home/mudhoney/recipes/pies
mkdir .index
ixBuild -V -i.index/index.ixif pies
It's important that the filenames that are generated by ixBuild have
the same format that is given by the gopher server! You can easily
test this by using ixFind. Make sure it doesn't contain the entire
path. Also make sure that when you're indexing a subdirectory that the
previous directories up to the root directory get added to the path by
ixBuild.
Building the Index with waisindex
---------------------------------
With waisindex it isn't necessary to be in the root directory of the
gopher server. The WAIS indexer stores filenames with their absolute
paths, this causes problems later.
If you want to index the whole recipe collection in
/home/mudhoney/recipes you'd do the following:
waisindex -r /home/mudhoney/recipes
The waisindex program will create a bunch of files starting with
index. These files together comprise an index to your data.
If you wanted to just index the pies subdirectory you would do the
following:
waisindex -r /home/mudhoney/recipes/pies
Starting Up the Index Server
----------------------------
Now that you have indexes you can actually run the gopher index server
on them. The first step you should do is to move the index files into
a directory all their own. Let's say that you chose
/home/mudhoney/indexes/recipes.
So, for the NeXT you would:
mkdir /home/mudhoney/indexes/recipes
mkdir /home/mudhoney/indexes/recipes/.index
cp {originaldir}/.index/index.ixif /home/mudhoney/indexes/recipes/.index
For the WAIS version you would:
mkdir /home/mudhoney/indexes/recipes
cp index.* /home/mudhoney/indexes/recipes
The next step is very important. You must create a "hostdata" file in
the same directory as the indexes. In this case you'd make a file
called "/home/mudhoney/indexes/recipes/hostdata".
In this file you need 2 to 3 pieces of information. The first line of
the hostdata file should contain the hostname of the machine that is
running a gopher server for the indexed data. The second line
contains the port that the data server is running at.
If you're running the WAIS version of gindexd then you'll have to add
a third line. This line should contain the directory of the gopher
data server. Gindexd will strip this off of all responses it sends
back. (This is why the WAIS indexing engine causes problems, it puts
in the whole path, not the relative path)
For example, our recipes index "hostdata" file would look like the
following:
mudhoney.micro.umn.edu
150
/home/mudhoney/recipes
This assumes that there is a gopher data server running on
mudhoney.micro.umn.edu at port 150. The nice part about using the
hostdata file is that you can move indexes off to other machines. Put
the indexes on the big sexy computers. And put the actual data off on
some sluggish machine.
{As of version 0.7 you can override the default title name returned by
gindexd. Add the keyword "ShowHeadline" at the end of the hostdata
file.
Also you can add the keyword "ShowDate" in the hostdata file. This will
put the date of the document in the Title.
}
After this step is completed you can actually run the gindexd daemon!
There two required options. The usage is:
gindexd [-DI] -p <portnumber> -i <indexdirectory> [-d databasename]
[-H alternate hostdata file]
The -p sets the port to run at. You can use any unused port. The -i
sets the index directory to look for indexes. (For the NeXT version
do *not* specify the subdirectory ".index". Give the directory above
it instead). The -D specifies that we should run in debug mode. The
-d parameter is only useful for the Wais indexer, it allows you to
specify a database name other than "index".
The -I parameter should be used when you are starting the indexer from
inetd. It's also useful when testing whether or not your indexes have
been built successfully.
The -H parameter can be used to specify an alternative hostdata file.
Here is the command we would use to start our recipe index daemon:
gindexd -p 151 -i /home/mudhoney/indexes/recipes
Setting Up Links To Index Servers
---------------------------------
This part is pretty simple. Just create a .link file on your gopher
data server that contains the pertinant information. Just make sure
that you get the "Type=" line correct. An index server is itemtype 7.
Here's what we would use for our recipe example:
Type=7
Host=mudhoney.micro.umn.edu
Port=151
Path=
Name=Grandma's Recipe Book
By fiddling with the Path= parameter and changing the type to "Type=1"
you can do some interesting things. When the user accesses the
following list they will get a directory of all the stuff that has
rhubarb pies in it.
Type=1
Host=mudhoney.micro.umn.edu
Port=151
Path=rhubarb pie
Name=Grandma's Rhubarb pie recipes.
This type of thing is especially usefull for data that changes
rapidly, like news. We've set up one such link that searches our
campus newspaper for the "What's Doing" schedule of events.