Apache Environment
All existing webserver environment variable are made available
to script writers and programmers in variable with the "cgi->" prefix.
${cgi->forwarded}
|
1
|
${cgi->http_x_real_ip}
|
44.192.254.173
|
${cgi->http_x_forwarded_for}
|
44.192.254.173
|
${cgi->http_host}
|
htdb.org
|
${cgi->http_x_nginx_proxy}
|
true
|
${cgi->http_connection}
|
close
|
${cgi->http_user_agent}
|
CCBot/2.0 (https://commoncrawl.org/faq/)
|
${cgi->http_accept}
|
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
${cgi->http_accept_language}
|
en-US,en;q=0.5
|
${cgi->http_if_modified_since}
|
Thu, 30 Mar 2023 02:37:26 GMT
|
${cgi->http_accept_encoding}
|
br,gzip
|
${cgi->server_signature}
|
|
${cgi->server_software}
|
Apache/2.4.52 (Ubuntu)
|
${cgi->server_name}
|
htdb.org
|
${cgi->server_addr}
|
127.0.0.1
|
${cgi->server_port}
|
80
|
${cgi->remote_addr}
|
127.0.0.1
|
${cgi->document_root}
|
/mnt/data/vhosts/htdb.org/htdocs
|
${cgi->request_scheme}
|
http
|
${cgi->context_prefix}
|
/htdb
|
${cgi->context_document_root}
|
/usr/local/htdb/bin/htdb
|
${cgi->server_admin}
|
del-at-adjective.com
|
${cgi->remote_port}
|
56134
|
${cgi->gateway_interface}
|
CGI/1.1
|
${cgi->server_protocol}
|
HTTP/1.0
|
${cgi->request_method}
|
GET
|
${cgi->query_string}
|
|
${cgi->request_uri}
|
/htdb/docs/scripting/environment.html
|
${cgi->script_name}
|
/htdb
|
HTDB Environment
In addition to the server environment, HTDB adds several variables
to the in-memory store. Yes, all these should be prefixed with something
that makes sense, and eventually will be.
${db} | docs/scripting |
${page} | environment.html |
${pageResource} | docs/scripting_index.html |
${logResource} | docs/scripting/environment.html |
${_session_int} | 0 |
${_db_timestamp} | 1695312955 |
${_timestamp} | 1695312955 |
${_current_date} | 21Sep2023 |
${_current_time} | 4:15 PM |
${_current_year} | 2023 |
${_current_day} | 21 |
${_current_hour} | 16 |
${_current_min} | 15 |
${_current_sec} | 55 |
${_current_weekday} | Thu |
${_current_monthnum} | 09 |
${_current_mon} | Sep |
${_current_month} | September |
${_current_pid} | 2581876 |
${cgi->http_port} | |
${cgi->http_protocol} | http:// |
${_hit_count} | 15179 |
|