This illustrates a complete list of environment variables.
You can get a block of reported environment variables with the directive.
While informative, this would probably just be confusing if used on a consumer-oriented Web page:
SCRIPT_URL=/NIS/Courses/SSI/environ-vars.html SCRIPT_URI=http://www.unh.edu/NIS/Courses/SSI/environ-vars.html HTTP_USER_AGENT=Opera/9.64 (Windows NT 5.1; U; Edition IBIS; zh-cn) Presto/2.1.1 HTTP_HOST=www.unh.edu HTTP_ACCEPT=text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 HTTP_ACCEPT_LANGUAGE=zh-CN,zh;q=0.9,en;q=0.8 HTTP_ACCEPT_CHARSET=iso-8859-1, utf-8, utf-16, *;q=0.1 HTTP_ACCEPT_ENCODING=deflate, gzip, x-gzip, identity, *;q=0 HTTP_REFERER=http://www.google.com/search?hl=en&client=opera&rls=zh-cn&hs=iSF&newwindow=1&q=ssi+environment+variables&btnG=Search&aq=f&oq=&aqi= HTTP_CONNECTION=Keep-Alive PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin SERVER_SIGNATURE=Apache/2.0.52 (Red Hat) Server at www.unh.edu Port 80
SERVER_SOFTWARE=Apache/2.0.52 (Red Hat) SERVER_NAME=www.unh.edu SERVER_ADDR=188.8.131.52 SERVER_PORT=80 REMOTE_ADDR=184.108.40.206 DOCUMENT_ROOT=/usr/local/web/data SERVER_ADMINemail@example.com SCRIPT_FILENAME=/usr/local/web/data/NIS/Courses/SSI/environ-vars.html REMOTE_PORT=2903 GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 REQUEST_METHOD=GET QUERY_STRING= REQUEST_URI=/NIS/Courses/SSI/environ-vars.html SCRIPT_NAME=/NIS/Courses/SSI/environ-vars.html DATE_LOCAL=July 14, 2009 DATE_GMT=July 15, 2009 LAST_MODIFIED=August 17, 1999 DOCUMENT_URI=/NIS/Courses/SSI/environ-vars.html USER_NAME=unhinfo DOCUMENT_NAME=environ-vars.html
Instead you would probably use one or a few environment variables selectively, integrated in your overall page design. One way is just for annotation to automatically include date, URL, or other information on your pages, probably in the headers or footers. Another way is in some simple kinds of flow control (see source in flow-auth.txt) to customize the material presented.
This alphabetic list of SSI environment variables is assembled from an NCSA CGI list, plus the Apache extensions as documented and inferred from the “printenv” directive (see above). When reading any discussions of SSI, remember that while many servers support many variables, the specific list is dependent on the server and its release version. Remember, too, that these variables were developed for a programming environment and we’ve disabled the SSI “exec” directive for calling scripts. Detailed discussion of that kind of environment is available in books such as CGI Programming by Shishir Gundavaram.
If the server supports user authentication, and the script is protected, this is the protocol-specific authetnication method used to validate the user.
Length of the content as given by the client.
For queries which have attached information (e.g., POST and PUT), this is the content type of the data.
The current date in Greenwich Mean Time.
July 15, 2009
The current date in the local time zone.
July 14, 2009
The filename (excl. directories) of requested document.
Directory on the server in which Web documents are located or “rooted”.
The URL path of the requested document. Affected by nesting of SSIs.
Revision of the CGI specification to which the server complies.
The MIME types which the client will accept.
text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
deflate, gzip, x-gzip, identity, *;q=0
Language setting for the browser.
The URL of the document that the client points to before accessing this page or script.
The browser identification string.
Opera/9.64 (Windows NT 5.1; U; Edition IBIS; zh-cn) Presto/2.1.1
Last modification date of the requested document.
August 17, 1999
Extra path information, as given by the client, for decoding by the server before passing to a CGI script.
The PATH_INFO after the server does any virtual to physical mapping of it.
Information which follows the “?” in the URL referencing a script.
The IP adddress of the remote host making the request.
Host name making the request to the server.
If the HTTP server supports RFC 931 identification then this variable will be set to the remote user name retrieved from the server.
If the server supports user authentication, and the script is protected, this is the username they have authenticated as.
The file identifier requested.
Method of request, which for HTTP is GET, HEAD, or POST.
Virtual path to the script being executed, used for self-referencing URLs.
E-mail address of the server sysadmin.
Server’s hostname, DNS alias, or IP address as appearing in self-referencing URLs.
Server port for Web traffic (default=80).
Name and revision of the information protocol this request came in with.
Name and version of the server software.
Apache/2.0.52 (Red Hat)
Process uname nder which the server software runs.