home  UNIX SPECIFIC  : Using Common Gateway Interface CGI 

Using the Common Gateway Interface (CGI)

The NCSA defines the Common Gateway Interface (CGI) as:

"...a standard for interfacing external applications with information servers, such as HTTP or Web servers."

Basically, the CGI allows you to call server-side scripts from HTML documents in order to provide dynamic content. Some examples of scripts that use the CGI include:

CGI scripts can be written in a number of languages, including, but not limited to: C, C++, and Perl.

By default, scripts should be placed in your cgi-bin directory but they can exist and function anywhere in your webshare (public_html) or sub-directories.

Locations of System Binaries

Scripts utilizing the CGI will often need to make use of certain system binaries. The two most commonly needed of these are Perl which is located at /usr/bin/perl and Sendmail which resides at /usr/lib/sendmail. If you need to know the location of any other items on your server you can easily find them using whereis. For example, typing whereis -b perl (the "-b" switch tells whereis to ignore all but binary files)at the shell prompt would get you the following results:

perl: /bin/perl /usr/bin/perl5.00503 /usr/bin/perl5.005 /usr/bin/perl /usr/bin/perl5.005_03 /usr/local/bin/perl

CGI Troubleshooting

The CGI Troubleshooter

If you write your own CGI scripts or make use of third-party scripts, this tool will come in extremely handy. The CGI Troubleshooter is designed to detect, and in most instances, correct errors in a CGI script's programming, installation, and configuration settings.

Troublesome CGI scripts often suffer from one of these common errors:

Related Items

Email and Web Hosting by Internet Connection 2004-2007 ©
Contact IC Support via AIM!  Our SN is ICSupportDesk