Here is a simple shell script which I always use when I first set up a new web server. It prints out some of the CGI environment variables and gives you a warm feeling that everything is working.

CGI/1.0 ENVIRONMENT VARIABLES:

The server sets the following environment variables for a CGI binary:

GATEWAY_INTERFACE = CGI/1.1
- The revision of the CGI specification to which this server complies. Format: CGI/revision
SERVER_SOFTWARE = d-httpd/1.0.0.1
- The name and version of the httpd that started the binary. Format: xs-httpd/version branch/subversion
SERVER_PROTOCOL = HTTP/1.1
- The name and revision of the information protocol this request came in with. Format: protocol/revision
SERVER_NAME = aldimna.com
- The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_PORT = 80
- The port number the request was sent to (usually 80).
REQUEST_METHOD = GET
- The method with which the request was made. For HTTP, this can be 'GET', 'HEAD', 'POST', etc.
REQUEST_URI = /cgi-report.wbs
- The URI part of the original request. That is the URL without protocol and hostname/port specification (but including the QUERY_STRING parameters.
REDIRECT_STATUS = 200
- The return status of the request. This should always be 200 for normal CGI binaries. Some php tools rely on this.
PATH_INFO =
- The extra path information, as given by the client. In other words, scripts can be accessed by their virtual pathname, followed by extra information at the end of this path. The extra information is sent as PATH_INFO. This information is decoded by the server if it comes from a URL before it is passed to the CGI script.
PATH_TRANSLATED =
- The server provides a translated version of PATH_INFO, which takes the path and does any virtual-to-physical mapping to it.
SCRIPT_NAME = /cgi-report.wbs
- A virtual path to the script being executed, used for self-referencing URLs.
QUERY_STRING =
- The information which follows the '?' in the URL which referenced this script. This is the query information. It will not be decoded in any fashion. This variable is always set when there is query information, regardless of command line decoding.
REMOTE_HOST = ec2-18-206-168-65.compute-1.amazonaws.com
- The hostname making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this unset.
REMOTE_ADDR = 18.206.168.65
- The IP address in text of the remote host making the request. See also HTTP_CLIENT_IP and HTTP_VIA.
AUTH_TYPE =
- If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user.
REMOTE_USER =
- If the script is protected, this is the username the remote user has authenticated with.
REMOTE_PASSWORD =
- If the script is protected with basic authentication, this is the password the remote user used.
CONTENT_TYPE =
- For queries which have attached information, such as HTTP POST and PUT requests, this is the content type of the data.
CONTENT_LENGTH = 0
- The length of the content as given by the client.
SSL VARIABLES:

Whenever a connection is made using a secure SSL or TLS transport, the following environment variables will also be made available:

SSL_CIPHER =
- The cipher used for encryption via SSL or TLS.
SSL_CLIENT_S_DN =
- The Distinguished Name of the subject of the client certificate. This variable contains all information available about the user.
SSL_CLIENT_S_DN_CN =
- The Common Name of the subject. This is a part of SSL_CLIENT_S_DN and gives the name that can be used to identify the certificate user. This should always be present in client certificates.
SSL_CLIENT_S_DN_Email =
- The email address of the subject. This is an optional part of SSL_CLIENT_S_DN and may not always be available.
SSL_CLIENT_I_DN =
SSL_CLIENT_I_DN_CN =
SSL_CLIENT_I_DN_Email =
- The Distinguished Name, Common Name and email address respectively of the issuer of the client certificate. These contain information available about the organisation that signed the certificate for this user.
HTTP VARIABLES:

In addition to the aforementioned CGI environment variables a variable of the form HTTP_ header will be generated for each header in the request. Common header generated CGI environment variables include HTTP_REFERER, HTTP_COOKIE, HTTP_HOST and HTTP_ACCEPT.

In the case that the CGI is called as the error CGI, the following environment variables describing the error condition are also set:

ERROR_CODE =
- depending on the error this variable is set to one of the following values:
NOT_FOUND =
- The requested file cannot be found.
NOT_AVAILABLE =
- The (filesystem) permission deny access to the file.
USER_UNKNOWN =
- The specified user is not known.
BAD_REQUEST =
- The client sent a request that cannot be processed by the server.
METHOD_NOT_ALLOWED =
- A POST request was attempted to a non-CGI binary.
PRECONDITION_FAILED =
- The client sent a conditional request (If-...) of which the condition is not met.
ERROR_READABLE =
- This variable contains the text that the server would normally send to the remote client. This can be used in case you do not want to generate your own error message.
ERROR_URL =
- The URL that was requested (without the server name) when the error occurred.
ERROR_URL_EXPANDED =
- The full pathname of the file on disk that is associated with the request.
ERROR_URL_ESCAPED =
- A HTML-escaped representation of the ERROR_URL value. The '<', '>' and '&' are replaced with their SGML entities so the variable can be shown in a HTML page.