|
Apache HTTP Server Version 1.3
Dynamic Content with CGI
The CGI (Common Gateway Interface) defines a way for a web server to interact with external
content-generating programs, which are often referred to as CGI programs or CGI scripts. It is
the simplest, and most common, way to put dynamic content on your web site. This document will
be an introduction to setting up CGI on your Apache web server, and getting started writing
CGI programs.
When you write CGI programs, you should consider using a code library, or module, to do
most of the grunt work for you. This leads to fewer errors, and faster development.
If you're writing CGI programs in Perl, modules are available on
CPAN. The most popular module for this purpose is CGI.pm. You
might also consider CGI::Lite, which implements a minimal set of functionality, which is all
you need in most programs.
If you're writing CGI programs in C, there are a variety of options. One of these is the
CGIC library, from http://www.boutell.com/cgic/
There are a large number of CGI resources on the web. You can discuss CGI problems with
other users on the Usenet group comp.infosystems.www.authoring.cgi. And the -servers mailing
list from the HTML Writers Guild is a great source of answers to your questions. You can find
out more at http://www.hwg.org/lists/hwg-servers/
And, of course, you should probably read the CGI specification, which has all the details
on the operation of CGI programs. You can find the original version at the
NCSA and there is an updated draft
at the Common Gateway Interface RFC project.
When you post a question about a CGI problem that you're having, whether to a mailing list,
or to a newsgroup, make sure you provide enough information about what happened, what you
expected to happen, and how what actually happened was different, what server you're running,
what language your CGI program was in, and, if possible, the offending code. This will make
finding your problem much simpler.
Note that questions about CGI problems should never be posted to the
Apache bug database unless you are sure you have found a problem in the Apache source code.
Apache HTTP Server Version 1.3
|