Servertec | Common Gateway Interface (CGI)

Content Introduction Release Notes Features FAQs Requirements Installation Add-ons How To Change Log Future Plans Knowledge Base Documentation Conventions Users Reference iServer API Servlet API CGI SSI Servlets Config Files Log Files Classes Directory Tree 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_USER | The username entered for client authentication.
CERT_* | Certificate specific variables. Not implemented.
CONTENT_ENCODING | The type of encoding used by the client on the data sent.
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. Not available in SSI only in CGI.
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_ENCODING | A comma delimited list of the types of 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_AUTHORIZATION | Contains Base-64 encoded username, password, scheme and realm sent by the client.
HTTP_CONNECTION | The type of HTTP connection. Normally Keep-Alive.
HTTP_COOKIE | The cookie data sent by the client.
HTTP_HOST | The name of the host server the request was sent to.
HTTP_IF_MATCH | The client requests that data be sent if the any of the entity tags match.
HTTP_IF_MODIFIED _SINCE | The clients requests that data be sent if the file date is later than the date in Greenwich Mean Time (GMT).
HTTP_IF_NONE_MATCH | The client requests that data be sent if the none of the entity tags match.
HTTP_IF_RANGE | The client requests that a range of data be sent if available.
HTTP_IF_UNMODIFIED_SINCE | The clients requests that data be sent if the file date is the same as the date in Greenwich Mean Time (GMT).
HTTP_RANGE | The client requests that a range of data be sent.
HTTP_REFERER | The URL from which the request was made.
HTTP_USER_AGENT | The name of the client browser making the request.
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.
LAST_MODIFIED | The date that the current document was last modified. Not available in CGI only in SSI.
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.
REMOTE_USER | The username entered for client authentication.
REQUEST_METHOD | The request method being made. Normally [ GET | POST ].
REQUEST_URI | The Universal Resource Identifier (URI) requested by the client.
ROOT | The base directory for requested documents. Not available in CGI only in SSI.
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 Access 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 the following parameters exec - the shell command to use when using CGI. bindir - the base path where CGI executables are physically located.
top of page
| Copyright © 1997-2000 Servertec. All rights reserved. Last Modified: Sun Jan 09 19:34:12 EST 2000