Module mod_actions

Module mod_actions contains directives for the IBM® HTTP Server for i Web server.

Summary

The module mod_actions provides for executing CGI scripts based on media type or request method.

Directives

Action

Module: mod_actions
Syntax: Action action-type cgi-script
Default: none
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Origin: Apache
Example: Action application/x-www-form-urlencoded /cgi-bin/file.pgm

The Action directive adds an action, which will activate CGI script when action-type is triggered by the request.

Example: MIME type

# Requests for files of a particular MIME content type:
Action image/gif /cgi-bin/images.pgm

In this example, requests for files with a MIME content type of image/gif will be handled by the specified cgi script /cgi-bin/images.pgm.

Example: File extension

# Files of a particular file extension
AddHandler my-file-type .xyz
Action my-file-type /cgi-bin/program.pgm

In this example, requests for files with a file extension of .xyz are handled by the specified cgi script /cgi-bin/program.pgm.

Parameter One: action-type
  • The action-type can be either a handler or a MIME content type. It sends the URL and file path of the requested document using the standard CGI PATH_INFO and PATH_TRANSLATED environment variables. The handler used for the particular request is passed using the REDIRECT_HANDLER variable.
Parameter Two: CGI-script
  • The cgi-script is the URL-path to a resource that has been designated as a CGI script using ScriptAlias or AddHandler.

Script

Module: mod_actions
Syntax: Script method CGI-script
Default: none
Context: server config, virtual host, directory
Override: none
Origin: Apache
Example: Script PUT /cgi-bin/bob.pgm

The Script directive adds an action, which will activate CGI-script when a file is requested using the method of method. It sends the URL and file path of the requested document using the standard CGI PATH_INFO and PATH_TRANSLATED environment variables. Method names are case-sensitive, so Script PUT and Script put have two entirely different effects.

Parameter One: method
  • The method names listed can be one or more of the following: GET, POST, PUT, DELETE, CONNECT, OPTIONS, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK and UNLOCK. User defined method names can also be used. The method name is case-sensitive. If GET is used it will also handle HEAD requests.
Parameter Two: CGI-script
  • The CGI-script can be any valid CGI script or other resource that is capable of handling the requested method.
Note: The CGI-script command defines default actions only. If a CGI script is called, or some other resource that is capable of handling the requested method internally, it will do so. Also note that CGI script with a method of GET will only be called if there are query arguments present (for example, bob.html?hi). Otherwise, the request will proceed normally.