Unless otherwise stated the values of environment variables are not case sensitive.
Also, the following variables are available only to server-parsed HTML documents:
AUTH_TYPE
AUTH_TYPE is set to the value of the Auth-Scheme token in the request for the CGI script or .shtml file. If no access authentication is required, AUTH_TYPE is null (""). CONTENT_LENGTH
If there is data attached to the request, CONTENT_LENGTH is set to the number of octets in the data. If no data is attached, it is null. The value is the same as the HTTP Content-Length header.CONTENT_TYPE
CONTENT_TYPE is set to the Internet Media Type of the attached entity, using the same syntax as the HTTP Content-Type header. If there is no Content-Type information in the header, the variable is set to null.GATEWAY_INTERFACE
GATEWAY_INTERFACE holds a string representing the version of the CGI specification to which SWS complies (currently CGI/1.1).HTTP_*
Environment variables that begin with HTTP_ contain header information read from the client request; for example, HTTP_HOST will hold the value of the Host header in the client's request.PATH_INFO
PATH_INFO holds the name of a URI path to be interpreted by the CGI script. The path info is passed to the CGI script by using a "/" after the script name. The "/" is not part of the path, and the path is treated as a URI on the current host. PATH_TRANSLATED holds the actual filesystem path name to the resource named by PATH_INFO.PATH_TRANSLATED
PATH_TRANSLATED holds a string representing the actual filesystem path for the URI represented by PATH_INFO. See the PATH_INFO entry for details on how the path is determined from the request.QUERY_STRING
QUERY_STRING is an encoded string that can hold arbitrary parameters to be passed as arguments to the CGI script. In the script URL, everything after a "?" is stored in QUERY_STRING and passed to the script as the first argument.REMOTE_ADDR
REMOTE_ADDR holds the IP address of the agent that sent the request to the server (client or client proxy, for example). The address is four numbers separated by dots ("129.146.73.110"). REMOTE_ADDR is never null.REMOTE_HOST
If cgi_dns_enable is set to "yes" in the server configuration file, then the fully qualified domain name of the agent sending the request to the server is stored in REMOTE_HOST. If cgi_dns_enable is off, then REMOTE_HOST is null.REMOTE_USER
If AUTH_TYPE is "Basic", then REMOTE_USER stores the user ID sent by the client, otherwise it is null. No authentication information is stored in REMOTE_USER. The user ID may contain other information in addition to just the user name.REQUEST_METHOD
REQUEST_METHOD stores the HTTP method used by the request (GET or POST, for example).
For example, if the CGI script test-cgi is accessed in the following way:
http://hostname/cgi-bin/test-cgi
the value of SCRIPT_NAME would be "/cgi-bin/test-cgi".
SCRIPT_NAME = ""
or
SCRIPT_NAME = <URI path to CGI script>
For example, if HTTP "404 Not Found" errors are redirected to a CGI shell script, you could include the following to create a link to e-mail the server administrator:
#!/bin/sh echo 'Content-Type: text/html' echo '<HTML>' echo 'Questions and comments should be directed to' echo '<A HREF="mailto:'$SERVER_NAME'">' echo 'the server administrator.</A>' echo '</HTML>' |
SERVER_ADMIN = <value of server_admin in conf file>
SERVER_NAME
SERVER_NAME is the server host name from the URL of the request, which may be a partial or fully-qualified domain name, or an IP address.SERVER_PORT
SERVER_PORT holds the port on which the request was received.SERVER_PROTOCOL
SERVER_PROTOCOL indicates the name and version of the protocol used by the server. For SWS 1.0, SERVER_PROTOCOL is always "HTTP/1.0".SERVER_SOFTWARE
SERVER_SOFTWARE is a string indicating the name and version of the server. For SWS, SERVER_SOFTWARE is always "SWS-1.0".DATE_GMT
DATE_GMT is available only to .shtml files when ssi_enable is enabled.
DATE_GMT = <date/time in Greenwich Mean Time>
DATE_LOCAL
DATE_LOCAL is available only to .shtml files when ssi_enable is enabled.
DATE_LOCAL = <date/time in local time zone>
DOCUMENT_NAME
DOCUMENT_NAME is available only to .shtml files when ssi_enable is enabled. DOCUMENT_URI
DOCUMENT_URI is available only to .shtml files when ssi_enable is enabled. LAST_MODIFIED
LAST_MODIFIED is available only to .shtml files when ssi_enable is enabled.
LAST_MODIFIED = <filesystem time stamp of current file>
QUERY_STRING_UNESCAPED
QUERY_STRING_UNESCAPED is available only to .shtml files when ssi_enable is enabled.