                   README for SDB(1.4.1b) SERVER(CGI script)
                   --------------------------------------

This README will cover some of the basics of compiling/setting up the 
'sdb' CGI script w/ an HTTPD server

They both bascially work like any other CGI script and don't require
anything special except for a few conventions when setting up the HTML
document which will be explained below.


Building 'sdb'
=============

 Features:
 ---------
 Seee CHANGES section at the end of the README

 Requirements:
 ------------

Compiling 'sdb':
---------------
1. Edit the Makefile found in toplevel directory
   and set the following varibles. See Makefile for further info.

   CC                      -> cc, gcc
   CFLAGS                  -> -DDEBUG=2(if you want debugging)
   SYSCONFIGFLAGS          -> compiler specific flags
   HDF_LIBS                -> location of libdf.a, libmfhdf.a, libjeg.a,libz.a
   HDF_INC                 -> location of HDF include files.

2. type 'make'. This should build the target script 'sdb'.


SDB Setup
=========
When setting up the 'sdb' CGI script in an HTML document the following
conventions should be observed:

1. The CGI script expects the path to the HDF/netCDF file to passed as
   an evironment variable PATH_INFO from the HTTPD server .
   You need to do the following.

e.g say the file is located as '/usr/local/etc/httpd/htdocs/hdf/test.hdf' 
   and the CGI script is located in you 'cgi-bin' directroy as '/cgi-bin/sdb'. 
   Furthermore, the HTTPD document area is '/usr/local/etc/httpd/htdocs'.
   In the HTML file you need a reference like the following.

   <A HREF="/cgi-bin/(script name)/(directory where file is)?(filename)>

   e.g.

   <A HREF="/cgi-bin/sdb/hdf?test.hdf">

   NOTE that path to the hdf file relative to the HTTPD documentation
   area '/usr/local/etc/httpd/htdocs' is 'hdf' which is added to the
   the end of the script(/cgi-bin/sdb) and becomes '/cgi-bin/sdb/hdf'.

2. Initial requests like the above are obtained using the CGI GET
   Method. Subsequent requests use either forms where appropriate
   (and so use the CGI POST Method) or the GET Method.


Trouble Shooting
===================

   The first place to look is to view the source of the resulting HTML
   document in the client(if one is returned)and take a look at the
   HREF link and make sure that it looks like the link in part(1 above.

   If further problems exist, you can turn debugging on using the
   compile flag -DDEBUG=3 which will output debugging info to '/tmp/sdb2.log'.
   If you look through the file after a session you can sort of get
   and indication where things went wrong. Read 'myutil.h' for more
   info on the debugging procedures used.

   I have included a small CSH shell script called 'test_sdb' that
   mimics the environment provided by the HTTPD server. You can
   test if the CGI script handles the first GET method by filling
   in the appropriate environment variables(file location, file name,..etc)
   This will give you a good idea if the script itself works.....


    Nancy Yeager <nyeager@ncsa.uiuc.edu>
    NCSA , University of Illinois
    HDF Group
    152 Computing Applications Bldg.
    605 E. Springfield Ave.
    Champaign, IL 61820

