Servertec   Common Gateway Interface (CGI)
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Change Log
Future Plans
Knowledge Base
Documentation
Conventions
Users
Reference
iServer API
Servlet API
CGI
SSI
Servlets
Logs

Samples
Sales
Legal
Feedback

 

Common Gateway Interface (CGI) is a widely used mechanism for expanding iServer's functionality, generating dynamic Web pages and processing the information gathered by HTML forms. Using iServer's CGI support shell commands, executables and batch files can be executed.

The following environmental variables are available to CGI executables:

    variable Description
    ALL_HTTP All HTTP headers.

    Not implemented.

    ALL_RAW All HTTP headers raw.

    Not implemented.

    AUTH_TYPE The type of authentication used.
    AUTH_PASSWORD The password entered for client authentication.
    AUTH_RIGHTS The access rights allowed.
    AUTH_USER The username entered for client authentication.
    CERT_* Certificate specific variables.

    Not implemented.

    CONTENT_LENGTH The number of bytes sent by the client.
    CONTENT_TYPE The type of content send by the client. Normally mime-type application/x-www-form-urlencoded for forms.
    DOCUMENT_NAME The current file name.

    Not available in CGI only in SSI.

    DOCUMENT_URI The virtual path of the current document.

    Not available in CGI only in SSI.

    DATE_GMT The current date in Greenwich Mean Time (GMT).

    Not available in CGI only in SSI.

    DATE_LOCAL The current date in local time zone.

    Not available in CGI only in SSI.

    GATEWAY_INTERFACE The name and revision of the gateway interface being used. Normally CGI/1.1.
    HTTP_ACCEPT A comma delimited list of mime-types which the client accepts.
    HTTP_ACCEPT_CHARSET A comma delimited list of the character encodings the client accepts
    HTTP_ACCEPT
    _LANGUAGE
    A comma delimited list of the languages which the client accepts. Normally en-us for the United States English.
    HTTP_CONNECTION The type of HTTP connection. Normally Keep-Alive.
    HTTP_HOST The name of the host server the request was sent to.
    HTTP_REFERER The URL from which the request was made.
    HTTPS Returns ON is request is over a secure socket (SSL) or returns OFF if not.

    Not implemented.

    HTTPS_* SSL specific variables.

    Not implemented.

    INSTANCE_ID The current instance id.
    HTTP_USER_AGENT The client making the request.
    LAST_MODIFIED The date that the current document was last modified.
    LOCAL_ADDR The IP address of the server the request was sent to.
    PATH_INFO additional path information sent by the client.
    PATH_TRANSLATED The physical translated path of the request.
    QUERY_STRING Any raw information sent after ? in the HTTP request made by the client.
    QUERY_STRING
    _UNESCAPED
    Any information sent after the ? in the HTTP request made by the client.

    Not available in CGI only in SSI.

    REMOTE_ADDR The IP address of the client making the request.
    REMOTE_HOST The name of the client making the request.
    REQUEST_METHOD The request method being made. Normally [ GET | POST ].
    REQUEST_URI The request made by the client.
    ROOT The base directory for requested documents.
    SCRIPT_NAME The virtual path of the SSI being evaluated.
    SERVER_NAME The name of the server the request was sent to.
    SERVER_PORT The port number the request was sent to. Normally port 80.
    SERVER_PORT_SECURE Whether the request is secure.
    1 if the request is secure.
    0 if the request is not secure.
    SERVER_PROTOCOL The name and revision of the request protocol being used. Normally HTTP/1.1.
    SERVER_SOFTWARE The name and revision of the server software being used.
    URL The base portion of the requested URL.

    Not available in CGI only in SSI.

    Additionally environmental variables are available.

Notes

    CGI is an inherently an inefficient mechanism that requires a separate process be created for each request made. Servlets is a much better alternative, since all servlets run within the same Java VM.

    Before CGI can be used Shell must be enabled in the iServer Administration - Server form.

    Presently iServer has been configured to use CgiServlet for requests made to the /cgi-bin.

    CgiServlet uses exec parameter to specify the shell command to use when using CGI.

    CgiServlet uses bindir parameter to specify the base path where CGI executables are physically located.

 top of page
 Built with iScript Copyright © 1997-1999 Servertec. All rights reserved.
Last Modified: Tue Jan 26 22:59:10 EST 1999