# CGI executing

The cgi handler executes CGI programs.

## Parameters

This module accepts three parameters

- Scriptalias path: It defines a kind of execution interpreter
- Env variable "value": Set an environment variable for the cgi program
- ErrorHandler [on | off]: Use CGI output as error message
- ChangeUser [on | off]: It interprets each CGI as it owner user

## Examples

This is a pretty common example. It defines a directory called cgi which points to a path out of the Sever root directory where are located the CGI programs.

    Directory /cgi {
       DocumentRoot /usr/lib/cgi-bin/
       Handler cgi
    }

This example shows how to use the script alias parameter. When /example is visited, it will run /usr/lib/cgi-bin/example.cgi

    Directory /example {
       Handler cgi {
          Scriptalias /usr/lib/cgi-bin/example.cgi
       }
    }