Grok-Pedia

mod_cgi

mod_cgi

mod_cgi is a module for the Apache HTTP Server, which allows the server to handle Common Gateway Interface (CGI) scripts. CGI is a standard for interfacing external applications with web servers, enabling the creation of dynamic web content.

History and Development

The concept of CGI was developed in the early 1990s as a way to generate dynamic content on the web. Here's a brief timeline:

Functionality

mod_cgi works by:

Usage and Configuration

To enable CGI with mod_cgi, you would typically:

  1. Ensure mod_cgi is enabled in Apache's configuration file (httpd.conf or apache2.conf).
  2. Set up a directory or directories where CGI scripts are allowed to execute, often using the ScriptAlias directive to map a URL to a filesystem location.
  3. Configure the server to recognize CGI files by file extension or script alias.

ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options +ExecCGI
    AddHandler cgi-script .cgi .pl
    Require all granted
</Directory>

Advantages and Limitations

External Links

Related Topics

Recently Created Pages