SDDAS is able to make use of a web daemon for server sites. This document will go through the process of setting up a server site for SDDAS, using a web server such as Apache.
Knowledge of a scripting language and system administration of a web server are assumed. We use PERL and Apache which work well.
You must have a machine outside a firewall which can serve the web port 80. It does not have to serve web pages, but it must be able to run CGI-BIN programs. Furthermore, you must designate a directory to hold CGI programs which are to be run via the alias "sddas". In the past, this was hardcoded as the "ServerCmds" directory.
Being a server site requires administration on the server end. You must tailor the scripts included (or write your own) to handle the requests sent by clients.
The scripts provided are merely examples and WILL NOT WORK!!!
We have included csh scripts, but you made need a stronger scripting language like PERL or Tcl/Tk to really do the stuff you need to do.
Currently, these commands are required to serve data:
For now, simply write some text describing the server and the type of data served out to standard output.
FileGet.cgi will receive commands in this format :
<type> <P> <S> <E> <I> <V> <Year> <Day> <Millisecond> <Pre-Processing Flag> <Post-Processing Flag> <Label>
The next three fields are the begin time of the range requested. This must then be converted to a filename.
With this information (and only this information from the client), FileGet.cgi needs to know enough of your own system of where to get the data from. This can be as simple as going to a directory on the hard disk and then "cat"ting the file to stdout. For some of our servers, the file is kept on mag-optical disks and the server determines which mag-optical the file is on and retrieves it from there.
Before sending the file, you must tell the web client that the file being sent is a binary file and the file size of that file. To do that, simply print:
Content-type: binary
Content-length: <filesize>
<blank line>
before sending the file.
EntriesGet.cgi will receive commands in this format :
<P> <S> <E> <I> <V> <Start Time> <Stop Time>
ShareProjects is used by the ProjCfg program to promote new projects into local databases. This is possibly the simplest command of all since all it has to do is list the projects it holds in the same format as the PROJECTS.cfg file. This can be done by just "cat"ting the PROJECTS.cfg file to stdout.
Apache is very easy to set up for CGI-BIN scripting. This is done through the ScriptAlias directive. Simply add a line into the httpd.conf file in the ScriptAlias section that says:
ScriptAlias /sddas/ <scripts directory>
After you have the web server setup, and the script directory pointing to the right place, you need to change your scripts. Every CGI program has to send out a header telling the web server what type of file you are about to send. For the FileGet, its a binary file, so add the lines as described above. All other scripts send plain text, so add the line:
Content-type: text/plain
before executing the rest of the script.
I believe that's it!