![]() |
The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers. A plain HTML document that the Web daemon retrieves is static, which means it exists in a constant state: a text file that doesn't change. A CGI program, on the other hand, is executed in real-time, so that it can output dynamic information.The best way to get introduced to CGI is to read over the NCSA page.
See the cgiwrap manpage for detailed setup and usage information. It really is useful. Paco has a series of talks on Advanced Web Techniques. CGI is one of those topics.
The CGIwrap ftp site is ftp://ftp.cc.umr.edu/pub/cgi/cgiwrap/.
The CGI script is the following simple shell script (located in ~helpnet/public_html/cgi-bin), whose standard output is read by the web server and sent to the browser. Note that it should output HTML rather than plain text.
'#!/bin/sh UPTIME=/usr/ucb/uptime echo Content-type: text/plain echo if [ -x $UPTIME ]; then $UPTIME else echo Cannot find uptime command on this system. fi
| | ||
| HelpNet was created by the 1995 incoming graduate class. It is only occasionally updated. | Department of Computer Science School of Engineering, University of Virginia 151 Engineer's Way, P.O. Box 400740 Charlottesville, Virginia 22904-4740 (434) 982-2200 Fax: (434) 982-2214 | Web Comments: webteam@cs.virginia.edu Admissions Inquiries: inquiry@cs.virginia.edu Site directory, Other addresses Server statistics © Created by the CS Web Team |