$Id: README,v 1.3 1997/07/30 01:10:22 mathews Exp mathews $ ---------------------------------------------------------------- *** Using IDL on the Web *** idl-www Version 1.3 http://ssdoo.gsfc.nasa.gov/idl/ Jason Mathews NASA/Goddard Space Flight Center, Code 633 National Space Science Data Center Greenbelt, Maryland 20771 USA e-mail: mathews@nssdc.gsfc.nasa.gov ------------------------------------------------------------------- Sample perl scripts and HTML forms to demonstrate the use of IDL as a graphics engine to generate on-the-fly GIF images on the World Wide Web. A CGI script is executed with a user's query from which IDL is called in batch mode (or as a RPC client) with a sample IDL program. IDL is set to the Z-buffer pseudo device, and the graphics output is written to a GIF file that is displayed through a WWW client browser (e.g., Netscape or Internet Explorer). Note that if you want to create an inline GIF file via a dynamically created HTML document then there must be a reference to the GIF file in the HTML document root (defined by the httpd server). For example, if we want to create a temporary GIF file called test.gif in the directory "/usr/local/etc/httpd/htdocs/idl" and the document root is "/usr/local/etc/httpd/htdocs" then the IDL program must write to the physical file location /usr/local/etc/httpd/htdocs/idl/test.gif and the HTML document (relative URL) refers to for an inline image. The path /idl/test.gif is relative to the document root directory. This approach has been applied to three NASA data systems that use IDL as a graphics engine to generate dynamic IDL output from scientific data on the WWW. For more information see the CDAWEB, OMNIWeb and COHOWeb data systems via the following URLs: http://cdaweb.gsfc.nasa.gov/cdaweb/ http://nssdc.gsfc.nasa.gov/omniweb/ow.html http://nssdc.gsfc.nasa.gov/cohoweb/cw.html Also see the paper presented at the WWW'95 Conference listed below. ------------------------------------------------------------------- Contents: * idl-www.cgi CGI script that both creates the form and processes it input. * idl-cmd.cgi CGI script accepts IDL program via WWW form, executes the program, and displays the output (text and/or graphics). * idl-cmd5.cgi CGI script (same function as above) that uses Perl 5 and CGI.pm instead of cgi-lib.pl * idl-cmd.html HTML form that calls the idl-cmd.cgi script. * idl-form.cgi CGI script that handles form input. * idl-form.html HTML form that calls the idl-form.cgi script. * cgi-lib.pl Steven Brenner's routines used to manipulate CGI input. Get the latest version at http://www.bio.cam.ac.uk/web/ These CGI scripts were tested on DEC ALPHA/OSF and SGI/IRIX 5.3 UNIX platforms with NCSA httpd 1.3, NCSA httpd 1.5, and Apache 1.2 web servers, IDL v3.6.1 and IDL v4.0, Perl 4.0p36, Perl 5.003, and several WWW browsers (IE,Netscape,etc.). For installation: 1) Copy the *.cgi files and cgi-lib.pl in a place where your http server knows to execute it as a cgi-script; i.e. in "/cgi-bin/". You may need to get the server administrator to do this for you. Alternatively, you can place them in your public_html area and setup an .htaccess file to allow .cgi files from any directory if the server configuration allows it. == Sample .htaccess file === Options FollowSymLinks ExecCGI AddType application/x-httpd-cgi .cgi 2) Edit the top first line of *.cgi files so that it gives the path to the actual location of the perl executable, which is /usr/local/bin/perl on my machine. 3) Edit the location of the IDL top-level directory, which is defined as the following line: $idl_dir = '/usr/local/lib/idl'; in the .cgi files. Also, if the location of your IDL license file is in a different location than the top-level directory then you must add the following to the .cgi scripts in the setup IDL environment section: $idl_lm = "/usr/local/licenses/license.dat"; $ENV{'LM_LICENSE_FILE'} = $idl_lm; otherwise IDL cannot find the license and enters into the DEMO mode. 4) Make the CGI scripts readable and executable with the following: chmod 755 *.cgi 5) Copy the .html files into a document root subdirectory that is viewable via a public WWW browser (e.g., /usr/local/etc/httpd/htdocs/idl). You must edit these files if the location of the .cgi scripts is *NOT* "/cgi-bin/" and add this location to the ACTION field of the form, otherwise the HTML forms cannot find the correct script to run. 6) Create a symbolic link from the WWW/IDL directory to /tmp for creating the GIF files there and accessing them via a WWW browser. ln -s /tmp /usr/local/etc/httpd/htdocs/idl/tmp This assumes that the web server has write-permission into the /tmp directory. Note that some web server are run in a restricted environment. Likewise you can create a new sub-directory tmp under idl that is writable by the web server, but you should create a cron job process to cleanup the temporary files if your script is to be run on a daily basis. 7) Finally, you can load the HTML forms or CGI scripts into your WWW browser with the appropriate URL (e.g., http://localhost/idl/idl-form.html) ------------------------------------------------------------------- Full permission is granted to use and modify these programs so long as the copyright is maintained, modifications are documented, and credit is given for any use of these programs. ------------------------------------------------------------------- Related Resources: Berners-Lee, T., and Connolly, D., HyperText Markup Language (HTML) Specifications - 2.0, MIT/W3C, May 1995. URL: http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html Mathews, G.J., Towheed, S.S., WWW-Based Data Systems for Interactive Manipulation of Science Data, Proceedings of the Science Information Systems Interoperability Conference, University of Maryland, November 1995. URL: http://nssdc.gsfc.nasa.gov/cohoweb/misc/papers/sisic/ Mathews, G.J., Towheed, S.S., "OMNIWeb: The First Space Physics WWW-Based Data Browsing and Retrieval System," Computer Networks and ISDN Systems, Proceedings of the Third International WWW Conference, Vol. 27, No. 6, April 1995, pp. 801-808. URL: http://nssdc.gsfc.nasa.gov/omniweb/misc/papers/www95.html NCSA httpd Development Team, The Common Gateway Interface (CGI), URL: http://hoohoo.ncsa.uiuc.edu/cgi/ Yahoo Internet & WWW Index URL: http://www.yahoo.com/Computers/World_Wide_Web/ --