vhttpd CGI Environment Variables

The following environment variables are set by the Texis Web Server (vhttpd) when running CGI programs and Vortex scripts. These can be added, deleted or modified with the config file settings SetEnv, UnsetEnv and PassEnv.

PATH Set to "/usr/local/bin:/usr/ucb:/bin:/usr/bin".

GATEWAY_INTERFACE The CGI interface supported by the server, "CGI/1.1".

SERVER_SOFTWARE The version/release of the server software.

SERVER_NAME The local hostname, or the value given by the ServerName config command.

SERVER_PROTOCOL The HTTP protocol used by the client to communicate with the server. Typically "HTTP/1.0".

SERVER_PORT The TCP port the server is running on, given by the Port config command or -p command line option. Usually 80.

SERVER_ROOT The root filesystem directory where the server is based from. Given by the ServerRoot config command or the -d command-line option.

DOCUMENT_ROOT The root filesystem directory where documents are served from. Given by the DocumentRoot config command or the -doc command line option.

REQUEST_METHOD The HTTP method of the client's request. Typically "GET" or "POST".

REQUEST_PATH The URL-decoded value of the request URL, without the query string. This is a non-standard variable.

REQUEST_URI The original (non-decoded) request URL path and query string. This is a non-standard variable. Added in version 3.01.963872250 20000717.

PATH_INFO The URL-decoded value of the remainder of the request URL, if anything is left after any prefix was mapped to a CGI program or VortexPath. Does not include the query string. PATH_INFO can vary from the actual URL if VortexPath aliases to a specific script.

PATH_TRANSLATED Same as PATH_INFO, but translated to the filesystem, i.e. with DocumentRoot prepended.

SCRIPT_NAME The decoded URL prefix path to the current CGI program or VortexPath.

QUERY_STRING The request URL, not decoded, after the first question-mark ("?").

REMOTE_ADDR The dotted-decimal IP address of the client.

REMOTE_HOST Same as REMOTE_ADDR. (Client addresses are not currently reversed into hostnames to save load and network traffic.)

CONTENT_TYPE The value of the Content-Type header, if any, given by the client.

CONTENT_LENGTH The value of the Content-Length header, if any, given by the client.

In addition, any headers sent by the client are passed as an environment variable of the same name, in all upper case, with non-alphabetic characters mapped to underscore, and HTTP_ prefixed. Typical examples include:

HTTP_REFERER The value of the Referer header, if any.

HTTP_USER_AGENT The value of the User-Agent header, if any.

HTTP_HOST The value of the Host header, if any.

HTTP_ACCEPT The value of the Accept header, if any.

HTTP_ACCEPT_ENCODING The value of the Accept-Encoding header, if any.

HTTP_COOKIE The value of the Cookie header, if any.

HTTP_CONNECTION The value of the Connection header, if any.

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.