		README for the Fast Installation Option
			Updated: July 20, 2017

These are the instructions for installing the JGOFS/GLOBEC
data serving software using the "Fast Install" method. This 
method takes advantage of a tar file with all the latest 
JGOFS/GLOBEC software in place and is based on the 
JGOFS/GLOBEC V2.2 software release and updated in 2017
to support installing an options server using the same
tar file.

This process will be hampered if you do not own existing 
JGOFS/GLOBEC files in the JGOFS/GLOBEC directories. Check 
the file protections to verify that you have the necessary 
privileges.

If you have an existing JGOFS/GLOBEC installation, the only 
subdirectory structure you want to preserve and reuse 
is your ../objects directory tree. Since the fast install 
option does not automatically replace your existing ../objects 
subdirectory, you should be okay. However, if you want to be sure, 
rename your objects subdirectory or backup your existing
environment before your upgrade. (See step 2a.)

To install the software it is highly recommended that you
save a complete backup of your current software installation 
as a tar file just in case reality strikes. (We do make an 
attempt not to replace your existing copy of dir, objects/, 
and other files, however.)

	1. Change directory to your data server root directory: E.g.

		cd /data_server_root

	2.a Create a tar file of your existing data serving site:

		tar -cvf existing_data_site.tar .

In any case, you should preserve your existing copy of the dir
application located in ../data_server_root/htmlbin subdirectory.
If you are the cautious type, you can rename copies of the
following routines to be sure they are saved before the update.
However, we attempt to protect you by supplying relacements for
these files with names modified with underscores before and 
after the name. The files or directory names include:

	htmlbin/dir
	objects directory
	

Sample copying or renamings are:

	cp htmlbin/dir htmlbin/dir-save
and
	
	mv objects objects_save
	
However, these steps should not be necessary as the objects directory
and the dir application are not "automatically" updated.

The version provided (located in the <root directory>/htmlbin) of
_dir_ usually has to be edited for such entries as $jghome, $topdir, 
and $office. The dir application does not yet take advantage of 
the configuration file so have to be hand edited. Until then, the 
new version is supplied as _dir_ so as not to delete your existing 
copy. At this point, you are usually safe to use your own, existing 
copy of this routine.


	2.b If this is the first time you are upgrading your 
pre-version 2 data server, make a copy of build_env.pl, since it
will contain several site specific values. These site specific values
are now maintained in a separate file call build_env.conf.  It is 
useful to see what options and choices you made for these options (e.g. 
$jghome, $topdir, and $office) so you can duplicate these in the 
build_env.conf file. This step can be skipped in an existing JGOFS/GLOBEC
Version 2 site as well as in a new installation.


	3. Get a copy of "fast_install" tar file and verify that
your backup exists.

You can get a copy of the "Fast Install" tar file from the JGOFS/GLOBEC
software site and place it in your data server root directory via ftp:

	ftp://globec.whoi.edu/pub/software/JGOFS_GLOBEC

Before untaring the new release, it is good practice to backup
your existing JGOFS/GLOBEC directories (see step 1 and 2 above).


	4. Untar tar file

Untar the fast_install tar file in the data server root
directory:

        cd <data server root directory>
	tar -xvf fast_install-V1.xx

	5. Dealing with special files including

		_build-env_.conf
		_objects_
		htmlbin/_dir_


After untaring, several files may need to be either put in place or
modified.

Compare your copy of the build-env.conf file to the new version
called _build-env_.conf. Make any changes necessary, although this
is rarely necessary. If you do not have a copy of the build-env.conf 
file, create it and make the few necessary changes. Note that the 
values specified in this configuration file superseed the values 
specified in the build-env.pl file.

	5a.	diff  _build-env_.conf  build-env.conf

or

		cp  _build-env_.conf  build-env.conf

Make the necessary edits to your copy of the build-env.conf file. 
Usually, this only involves specifying the name of your data server.

	5b. The objects directory:

If this is a new installation, rename the _objects_ directory to
objects. If this is an existing installation, please, SKIP THIS
STEP.

		mv _objects_ objects [Only if this is a new installation]

Note that there are several new entries in the top level .objects
file that are needed for an options server installation. You may want
to copy these new entries into your own top level .objects file 
located at

		<server root>/objects/.objects

However, this is not necessary for a regular data server installation. 


	5c. Keep your own version of dir or use distributed _dir_:

Reuse your existing version of dir or edit the version included as necessary.
If you are using the distributed version, be sure to rename it to dir

		mv  htmlbin/_dir_  htmlbin/dir [Only if necessary]

The newest version of dir uses a css file which is included in this
distribution as ../htdocs/css/_dataSystem_.css. You can access it from
our site or make your own copy and store it in your web tree in a 
subdirectory called css.


	6. Build the JGOFS/GLOBEC software

To build the JGOFS/GLOBEC software use the following command:

		./build.pl
	
This step builds the software using the build.pl program taking advantage
of the build_env.conf file. Before doing this step verify that the perl
compiler is located where several scripts expect them to be, namely in
/usr/bin/perl. Perl is used by the build-env.pl script and the
../htmlbin/info script, and maybe a few others. Either edit these scripts
to find the Perl compiler where it is located on your system or, if
you have the necessary system privelege, create a symbolic link to
the location of your Perl compiler as

		ln -s your_location_of_perl_compiler /usr/bin/perl

The cgi-lib.pl perl code is provided in the ../htmlbin directory since it
is needed by the info and the perl_utils.pl scripts. You can delete the
cgi-lib.pl file from the ../htmlbin directory if you have your own copy.
If you are not sure, then just leave the one provided in place.

If there are errors during the build or if you have questions, please 
contact info@bco-dmo.org.


	7. If this is a new installation of the JGOFS/GLOBEC software
you will need to make an entry in your httpd.conf file of your httpd
daemon software, such as Apache. The entry defines the "jg" alias.
The command is

	ScriptAlias /jg/  /<data_server_root_directory>/htmlbin/


Testing Your Installation

You can verify that the the JGOFS/GLOBEC software is working as follows:

	$> cd <JGOFS/GLOBEC root directory>

	$> bin/list "defgb(src/data/t0)"

The output should look something like this:

#  wunsch stations 3-5 
#  p<1000 
======================= 
leg,year,month
........................ 
  1,  81,    6
======================= 
station,   lat,   lon
........................ 
      3, 38.28,-73.53
======================= 
  press,   temp,    sal,    o2,  sigth
------------------------ 
  5.000, 18.334, 33.570, 5.970, 24.096
 25.000, 12.848, 34.159, 6.990, 25.773
 49.000, 11.070, 34.523, 6.060, 26.394
 99.000, 11.093, 35.090, 5.340, 26.831
--More--

Enter the letter "q" (without the quotes) and return to end
this test.

The above command tests the list, jdb routines, outer and the
defgb routines. Note that in the above command the "t0" is
the letter "t" followed by a zero, not the letter "o".

In a new installation you can also use the test:

	$> bin/list /test

In an existing installation, this test may not work unless the
data object, test, is appropriately defined.

If you want to test the installation in a web environment, you
will have to edit the "test" data object specification in the 
objects/.object file as follows:

	test=def(<JGOFS/GLOBEC_root>/src/data/t0)

