Apache Environment Variables


AUTH_TYPE
The type of authentication used to validate the user.
CONTENT_LENGTH
The size of the body of the request (bytes).
CONTENT_TYPE
Content type of the request
DOCUMENT_ROOT
Path to the folder that contains web documents
GATEWAY_INTERFACE
CGI version supported by the web server
HOSTNAME
Name of user's workstation
HTTP_ACCEPT
File types accepted by the web browser
HTTP_REFERER
URL of the previous document viewed by the user
HTTP_USER_AGENT
Type of browser used to access the web page
PATH_INFO
Extra path info appended to the URL
PATH_TRANSLATED
Extra path info appended to the document root
QUERY_STRING
Query information appended to the end of the URL (after the ?) in a "GET" request
REMOTE_ADDR
IP address of the client computer (may be replaced by a NAT or proxy address)
REMOTE_HOST
Hostname of the client computer
REMOTE_PORT
Port used by the client host to connect to the web server
REQUEST_METHOD
POST, GET or HEAD
REQUEST_URI
Path and document name of the document requested by the client, relative to the web root (ie., /cgi-bin/somescript.pl).
SCRIPT_FILENAME
Full path and document name of the document requested by the client (relative to the root of the filesystem, ie., /var/www/htdocs/index.html).
SCRIPT_NAME
Path and document name of the document requested by the client, relative to the web root (ie., /cgi-bin/somescript.pl).
SERVER_NAME
The web server's hostname or IP address
SERVER_PORT
SERVER_SOFTWARE
Name and version number of the web server software


Click here for example output from these variables.