indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : ServerSide
This Article...
Print Version
Add Comment
View Comments
ServerSide
Apache on Linux
Apache User Directory Configuration
PostgreSQL Configuration
CGI: What and How?
PHP Jump Start Guide
Arrays in PHP
PHP and HTML Forms
Variable Passing in PHP
PHP 'include'
Drop-down Menu Navigation in PHP
Edit Your Site Online Using PHP
PHP MySQL Polling System
Dynamic, Search Engine Friendly Pages
Quot Ticker Using SSI
Regular Expressions Reference
PHP File Browser
PHP DB Deletion/Approval Script
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

CGI: What & How?

CGI (Common Gateway Interface) is a specification which tells how a web server should communicate with other programs residing in the server.

CGI == Perl?

Nope! Perl is just another language which is used to create CGI applications. Almost every language ever invented can be used to write CGI programs (provided your server supports it!).

What is CGI-BIN?

This is a special directory where CGI programs reside. Some web servers require that CGI programs reside only in this directory. Other webservers execute applications residing in normal html directory with extension .cgi.

The CGI-BIN directory is generally resides outside the html directory. But when accessing a program in that directory through a web browser, you specify the URL as if the CGI-BIN directory is within the html directory. This seemingly unwanted complication is a necessity because of security concerns.

CGI & Security

Running CGI application in your server is like letting anyone (just about anyone!) to run program in your server. Suppose your CGI application deletes some specified records in your database, there are chances that a cracker, by passing some wrong argument to your CGI program deletes all your records. Security should be given high priority when developing CGI applications.

Disadvantages

  • Each request to the CGI application spawns a new process. The overhead of creating a new process is high. Languages like PHP, ASP and Cold Fusion do not spawn new process for each request. They create in-process threads.

  • Security risks are many when executing a CGI application. CGI applications do not run in a procted environment like Java Servlets.

  • CGI applications do not support concepts like connection pooling when developing database applications. This again creates unwanted overhead for the database server.

  • Languages designed specifically for the web like PHP are easier to learn and implement.

Inspite of the disadvantages discussed above, CGI programs are widely used, generally for the raw power it provides.

-Subhash.
Sep.'02


User Comments

Add Comment

[Quick Stats: Number of main threads: 1, Number of sub-threads: 0]


Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.