9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server can access it ● Test data access ● Build a File Server using FreeForm ● Total time: two hours
9/21/04 James Gallagher Assumptions ● Instructions are specific to Apache httpd ● You have root access privileges ● You are working on a Linux (or Unix) machine ● You understand basic Unix system tasks and commands
9/21/04 James Gallagher Edit Apache's Configuration ● Open the Apache web server configuration file in an editor ● You will likely need root access privileges to modify the file
9/21/04 James Gallagher Edit Apache's Configuration, cont. ● Add an entry for a ScriptAlias directory – this will hold the programs which make up the server ● You can use an existing ScriptAlias directory (e.g., cgi-bin) but adding a new directory keeps the OPeNDAP server separate from other CGI programs
9/21/04 James Gallagher Edit Apache's Configuration, cont. ● Add a Directory block for the ScriptAlias directory you previously added ● If you're using an existing directory, make sure the Options and access controls are set appropriately
9/21/04 James Gallagher Edit Apache's Configuration, cont. ● Make sure that the FollowSymLinks option is turned on ● This provides a simple way to 'link' data into the web server's document tree ● Alternative: Copy the data directly into the DocumentRoot tree
9/21/04 James Gallagher Edit Apache's Configuration, cont. ● Restart the web server – there are several ways to do this, all require root access ● Check the web server's 'error_log' to confirm that the server restarted correctly ● If there's a problem with the configuration file, error messages will appear in the log
9/21/04 James Gallagher Unpack the OPeNDAP Server ● Expand/unpack the server- tools and hdf-server binary distribution files ● This will create a tree rooted in a directory named 'DODS'
9/21/04 James Gallagher Unpack the OPeNDAP Server, cont. ● Change into the 'DODS/etc' directory and run the installServers script ● It's a good idea to run this as root, although it's not required if you're careful about directory access controls
9/21/04 James Gallagher Unpack the OPeNDAP Server, cont. ● The script prompts for some information: – Enter the name of the ScriptAlias you defined when asked where to install the server – The script also asks about registering your server and about providing access to usage information
9/21/04 James Gallagher Unpack the OPeNDAP Server, cont. ● Registering your server sends an notice to OPeNDAP that tells us the machine name and software version number.
9/21/04 James Gallagher Unpack the OPeNDAP Server, cont. ● Providing access to usage information enables OPeNDAP to remotely examine the DAP access made to your server. ● Both of the registration and remote usage access options are disabled by default.
9/21/04 James Gallagher Verify Basic Server Operation ● Access the server's version number in a web browser ● For the server we've just installed, the version information is accessed using: dods/version dods/version ● This does not access data, but does verify proper configuration of the web server and operation of the OPeNDAP server
9/21/04 James Gallagher Verify Basic Server Operation, cont. ● Expand/unpack the Pathfinder data
9/21/04 James Gallagher Verify Basic Server Operation, cont. ● Go to the web server's DocumentRoot directory (look in the httpd.conf file if you don't know where this is) ● Create a symbolic link from inside the DocumentRoot to the 'pathfinder_data' directory ● You'll need to be root to create the link
9/21/04 James Gallagher Test Data Access ● Use a web browser to look at the server's directory information for the pathfinder data ● The URL is: dods/path/ dods/path/
9/21/04 James Gallagher Test Data Access, cont. ● Click on one of the datafiles to see the server's HTML form interface for data
9/21/04 James Gallagher Test Data Access, cont. ● To see the values of a specific variable in the data set: – Click the checkbox to the left of the variable's name. – Edit the constraint info which appears below the variable's name. – Click the 'Get ASCII' button near the top of the form.
9/21/04 James Gallagher Test Data Access, cont. ● Data values are returned as text to the browser – hardly the best way to use data, but great for verifying proper operation of the server ● Use the constraints to examine specific locations in the data set and make sure they match with your expectations
9/21/04 James Gallagher Test Data Access, cont. ● A web browser can be used to look at more than the service responses (we've seen the version, directory, HTML form and ASCII responses) ● Remove the '.html' suffix from the URL in the browser and append '.dds' in its place – you'll see the DDS object appear in the browser's window
9/21/04 James Gallagher Testing with the ODC ● Enter the URL ● Click 'Add to List' ● Provide a name
9/21/04 James Gallagher Testing with the ODC, cont. ● Select 'dsp_band_1' ● Click 'Output to'
9/21/04 James Gallagher Testing with the ODC, cont. ● Select 'dso_band_1' ● Click 'Plot to'
9/21/04 James Gallagher Testing with the ODC, cont. ● It's easy to see more plots
9/21/04 James Gallagher Configure the FreeForm Server ● Expand/unpack the FreeForm server ● Install the server
9/21/04 James Gallagher Configure the FreeForm Server,... ●... make sure to specify the correct destination directory for the server ● There's no need to install a second copy of the common code or to register the server again
9/21/04 James Gallagher Create a File Server Data Set ● Make a directory to hold the File Server data ● Create a listing of the files in the Pathfinder data set and put that listing in that directory
9/21/04 James Gallagher Create a File Server Data Set, cont. ● Here's what the file looks like so far...
9/21/04 James Gallagher Create a File Server Data Set, cont. ● Change the file names to URLs ● In this tutorial, the host is called 'localhost' but in a File Server that is to be accessed by other machines that should be replaced with the fully qualified domain name of the computer
9/21/04 James Gallagher Create a File Server Data Set, cont. ● In addition to the URLs for each of the Pathfinder data files, we'll need to add columns for the data and time ● Date and time are encoded into the filenames...
9/21/04 James Gallagher Create a File Server Data Set, cont. ● I used an emacs macro to edit each line. ● For large inventories, you'll need to write a sed, perl, et c., script to edit the file. ● What's important: We have a new data set with six columns of text data: five which hold date and time information and one with the matching URL.
9/21/04 James Gallagher Create a File Server Data Set, cont. ● As before with the pathfinder data, create a link from the web server's DocumentRoot directory back to the File Server data
9/21/04 James Gallagher Write a Format File for the File Server Data ● We need to tell the FreeForm server how to read the data ● The FreeForm server reads text and binary data organized in columns ● It uses a format file to determine what variables are present in the file, their data type and location
9/21/04 James Gallagher Test the FreeForm Server ● Use the browser to test the new data set ● It's easy to ask for a URLs which match a specific day number using the form to give a constraint.
9/21/04 James Gallagher Test the FreeForm Server, cont. ● Here's the response ● Problem: most people don't think in terms of 'day number' ● A year/month/day or month/day/year interface would be more natural for many people.
9/21/04 James Gallagher Using an Ancillary Attribute File ● Create an ancillary attribute file to further configure the File Server ● The file must be named '.das'
9/21/04 James Gallagher ● Using a text editor, create the attribute containers 'DODS_Time' and 'DODS_Date' ● Assign the hours_variable, etc., attributes of these containers to the matching variables in the data set Using an Ancillary Attribute File,...
9/21/04 James Gallagher Using an Ancillary Attribute File,... ● Use the HTML form interface to verify the presence of the new attributes
9/21/04 James Gallagher Using an Ancillary Attribute File,... ● Access the file server using 'date()' constraint function ● date() takes a double- quoted string of the form year/month/day or month/day/year ● Note the constraint requests only the URL be returned ● You must type this constraint in by hand
9/21/04 James Gallagher Using an Ancillary Attribute File,... ● The URLs returned look the same but the constraint is far more natural ● The 'date()' function accepts several different date formats including ISO8660 date-time strings
9/21/04 James Gallagher Testing with the ODC ● Enter the URL ● Click 'Add to List' ● Provide a name
9/21/04 James Gallagher Testing with the ODC, cont. ● Select 'dsp_band_1' ● Click 'Output to'
9/21/04 James Gallagher Testing with the ODC, cont. ● Select 'dso_band_1' ● Click 'Plot to'
9/21/04 James Gallagher Testing with the ODC, cont. ● It's easy to see more plots