Adventures with SSI

File testssi.shtm

Lets see the default errmsg; it may end with a linefeed!
<!--#include file="nofile0" --> [an error occurred while processing this directive]
<!--#flastmod file="testssi.shtm" --> <!--#fsize file="testssi.shtm" -->
testssi.shtm Wednesday, 16-Feb-2011 11:52:41 EST size 10881 ←See default timefmt and sizefmt.

<!--#config errmsg="Unable to parse <b>SSI-1</b>" --> ←Change errmsg.
<!--#config timefmt="%Y-%m-%d %H:%M:%S" --> ←Set date format--use dashes.
<!--#set var="pagedate" value="${LAST_MODIFIED}"--> ←Set server variable of testssi.shtm date.
<script type="text/javascript"> var jspagedate = '<!--#echo var="LAST_MODIFIED"-->';</script> ←Set javascript variable of testssi.shtm date.
<!--#echo var="LAST_MODIFIED" --> 2011-02-16 11:52:41 ←See date with dashes.
<!--#include file="nofile1" --> Unable to parse SSI-1 ←Check and compare errmsg.
<!--#include file="testssi.htm" -->

File testssi.htm

<!--#config errmsg="Unable to parse <b>SSI-2</b>" --> ←Change errmsg.
<!--#config timefmt="%Y/%m/%d   %H:%M:%S" --> ←Change date format--use slashes.
<!--#echo var="SERVER_SOFTWARE" --> ←Note which server software is running.
<!--#exec cmd="date" --> ←Check if #exec works.
<!--#echo var="LAST_MODIFIED" --> ←See date with slashes. Is it date of include file or requested file?
<!--#include file="nofile" --> ←See new errmsg.
Pagedate javascript:
Pagedate server var: ←If Unable err then #set does not work.

File testssi.shtm

<!--#include file="nofile2" --> Unable to parse SSI-1 ←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi.xls" -->
File testssi.xls
<!--#config errmsg="Unable to parse <b>SSI-X</b>" --> <!--#config errmsg="Unable to parse SSI-X" --> ←Change errmsg.
<!--#config timefmt="%Y:%m:%d   %H:%M:%S" --> ←Change date format--use colons.
<!--#echo var="SERVER_SOFTWARE" --> ←Note which server software is running.
<!--#exec cmd="date" --> ←Check if #exec works.
<!--#echo var="LAST_MODIFIED" --> ←See date with colons. Is it date of include file or requested file?
<!--#include file="nofile" --> ←See new errmsg.
Pagedate javascript:
Pagedate server var: ←If Unable err then #set does not work.

File testssi.shtm

<!--#include file="nofile2" --> Unable to parse SSI-1 ←Did errmsg remain changed "-2" or restored "-1".
<!--#include file="testssi2.shtm"-->

File testssi2.shtm

<!--#echo var="novar" --> ←Check the inherited errmsg.
<!--#config errmsg="Unable to parse <b>SSI-3</b>" --> ←Change errmsg.
<!--#config timefmt="%Y_%m_%d   %H:%M:%S" --> ←Change date format--use underscores.
<!--#echo var="SERVER_SOFTWARE" --> LiteSpeed ←Note which server software is running.
<!--#exec cmd="date" --> Wed Oct 30 20:46:56 EDT 2024 ←Check if #exec works.
<!--#echo var="LAST_MODIFIED" --> 2011_02_15 &nbsp; 13:02:36 ←See date with underscores. Is it date of include file or requested file?
<!--#include file="nofile" --> Unable to parse SSI-3 ←See new errmsg.
Pagedate javascript:
Pagedate server var: 2011-02-16 11:52:41 ←If Unable err then #set does not work.

File testssi.shtm

<!--#include file="nofile3" --> Unable to parse SSI-3 ←Did errmsg remain changed "-3" or restored.

<!--#config sizefmt="bytes" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm 10881

<!--#config sizefmt="abbrev" -->
<!--#fsize file="testssi.shtm" --> size of testssi.shtm 10881

<!--#flastmod file="testssi.htm" --> testssi.htm 2011_02_15   11:19:01 ←Note which date format is being used.
<!--#flastmod file="testssi.shtm" --> testssi.shtm 2011_02_16   11:52:41
<!--#config timefmt="%Y--%m--%d %H:%M:%S" --> ←Set date format--use double dashes.
<!--#flastmod file="testssi2.shtm" --> testssi2.shtm> 2011--02--15 13:02:36
<!--#printenv --> GATEWAY_INTERFACE=CGI/1.1 PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin SERVER_PROTOCOL=HTTP/1.1 SERVER_SOFTWARE=LiteSpeed REQUEST_METHOD=GET SCRIPT_FILENAME=/home/kkraryym/public_html/testssi.shtm QUERY_STRING= SCRIPT_NAME=/testssi.shtm DOCUMENT_ROOT=/home/kkraryym/public_html REMOTE_ADDR=3.145.204.38 REMOTE_PORT=59010 SERVER_ADDR=162.0.215.44 SERVER_NAME=3kranger.com SERVER_ADMIN=webmaster@3kranger.com SERVER_PORT=80 REQUEST_SCHEME=http REQUEST_URI=/testssi.shtm PROXY_REMOTE_ADDR=162.0.215.44 ssipagedate=2011-02-16 11:52:41 DATE_GMT=2024--10--31 00:46:56 DATE_LOCAL=2024--10--30 20:46:56 DOCUMENT_NAME=testssi.shtm DOCUMENT_URI=/testssi.shtm LAST_MODIFIED=2011--02--16 11:52:41 QUERY_STRING_UNESCAPED= HTTP_ACCEPT=*/* HTTP_ACCEPT_ENCODING=gzip, br, zstd, deflate HTTP_HOST=3kranger.com HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) HTTP_X_FORWARDED_FOR=3.145.204.38 DATE_GMT=2024--10--31 00:46:56 DATE_LOCAL=2024--10--30 20:46:56 DOCUMENT_NAME=testssi.shtm DOCUMENT_URI=/testssi.shtm LAST_MODIFIED=2011--02--16 11:52:41 QUERY_STRING_UNESCAPED=

<!--#echo var="AUTH_TYPE" --> Basic
<!--#echo var="CONTENT_LENGTH" -->
<!--#echo var="CONTENT_TYPE" -->
<!--#echo var="DATE_GMT" --> 2024--10--31 00:46:56
<!--#echo var="DATE_LOCAL" --> 2024--10--30 20:46:56
<!--#echo var="DOCUMENT_NAME" --> testssi.shtm
<!--#echo var="DOCUMENT_PATH_INFO" -->
<!--#echo var="DOCUMENT_ROOT" --> /home/kkraryym/public_html
<!--#echo var="DOCUMENT_URI" --> /testssi.shtm
<!--#echo var="GATEWAY_INTERFACE" -->
<!--#echo var="HTTP_CACHE_CONTROL" -->
<!--#echo var="HTTP_CONNECTION" -->
<!--#echo var="HTTP_COOKIE" -->
<!--#echo var="HTTP_HOST" --> 3kranger.com
<!--#echo var="HTTP_REFERRER" -->
<!--#echo var="HTTP_USER_AGENT" --> Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
<!--#echo var="HTTPS" --> off
<!--#echo var="INSTANCE_ID" -->
<!--#echo var="INSTANCE_META_PATH" -->
<!--#echo var="LAST_MODIFIED" --> 2011--02--16 11:52:41
<!--#echo var="LOCOL_ADDR" -->
<!--#echo var="LOGON_USER" -->
<!--#echo var="PATH" -->
<!--#echo var="PATH_INFO" -->
<!--#echo var="PATH_TRANSLATED" -->
<!--#echo var="QUERY_STRING" -->
<!--#echo var="QUERY_STRING_UNESCAPED" -->
<!--#echo var="REMOTE_ADDR" --> 3.145.204.38
<!--#echo var="REMOTE_HOST" --> 3.145.204.38
<!--#echo var="REMOTE_IDENT" -->
<!--#echo var="REMOTE_PORT" --> 59010
<!--#echo var="REQUEST_METHOD" --> GET
<!--#echo var="REMOTE_USER" -->
<!--#echo var="REQUEST_URI" --> /testssi.shtm
<!--#echo var="SCRIPT_FILENAME" --> /home/kkraryym/public_html/testssi.shtm
<!--#echo var="SCRIPT_NAME" --> /testssi.shtm
<!--#echo var="SERVER_ADDR" --> 162.0.215.44
<!--#echo var="SERVER_ADMIN" --> webmaster@3kranger.com
<!--#echo var="SERVER_NAME" --> 3kranger.com
<!--#echo var="SERVER_PORT" --> 80
<!--#echo var="SERVER_PROTOCOL" --> HTTP/1.1
<!--#echo var="SERVER_SIGNATURE" -->
<!--#echo var="SERVER_SOFTWARE" --> LiteSpeed
<!--#echo var="TZ" -->
<!--#echo var="UNIQUE_ID" --> 4pih09KZBTq3pLFcF3Ic1dw3
<!--#echo var="USER_NAME" -->
<!--#include file="testssiv.shtm" --> ←Check variable values from include.

File testssiv.shtm


<!--#echo var="AUTH_TYPE" --> Basic
<!--#echo var="CONTENT_LENGTH" -->
<!--#echo var="CONTENT_TYPE" -->
<!--#echo var="DATE_GMT" --> 2024--10--31 00:46:56
<!--#echo var="DATE_LOCAL" --> 2024--10--30 20:46:56
<!--#echo var="DOCUMENT_NAME" --> testssiv.shtm
<!--#echo var="DOCUMENT_PATH_INFO" -->
<!--#echo var="DOCUMENT_ROOT" --> /home/kkraryym/public_html
<!--#echo var="DOCUMENT_URI" --> /testssiv.shtm
<!--#echo var="GATEWAY_INTERFACE" -->
<!--#echo var="HTTP_CACHE_CONTROL" -->
<!--#echo var="HTTP_CONNECTION" -->
<!--#echo var="HTTP_COOKIE" -->
<!--#echo var="HTTP_HOST" --> 3kranger.com
<!--#echo var="HTTP_REFERRER" -->
<!--#echo var="HTTP_USER_AGENT" --> Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
<!--#echo var="HTTPS" --> off
<!--#echo var="INSTANCE_ID" -->
<!--#echo var="INSTANCE_META_PATH" -->
<!--#echo var="LAST_MODIFIED" --> 2011--02--16 11:49:13
<!--#echo var="LOCOL_ADDR" -->
<!--#echo var="LOGON_USER" -->
<!--#echo var="PATH" -->
<!--#echo var="PATH_INFO" -->
<!--#echo var="PATH_TRANSLATED" -->
<!--#echo var="QUERY_STRING" -->
<!--#echo var="QUERY_STRING_UNESCAPED" -->
<!--#echo var="REMOTE_ADDR" --> 3.145.204.38
<!--#echo var="REMOTE_HOST" --> 3.145.204.38
<!--#echo var="REMOTE_IDENT" -->
<!--#echo var="REMOTE_PORT" --> 59010
<!--#echo var="REQUEST_METHOD" --> GET
<!--#echo var="REMOTE_USER" -->
<!--#echo var="REQUEST_URI" --> /testssiv.shtm
<!--#echo var="SCRIPT_FILENAME" --> /home/kkraryym/public_html/testssiv.shtm
<!--#echo var="SCRIPT_NAME" --> /testssiv.shtm
<!--#echo var="SERVER_ADDR" --> 162.0.215.44
<!--#echo var="SERVER_ADMIN" --> webmaster@3kranger.com
<!--#echo var="SERVER_NAME" --> 3kranger.com
<!--#echo var="SERVER_PORT" --> 80
<!--#echo var="SERVER_PROTOCOL" --> HTTP/1.1
<!--#echo var="SERVER_SIGNATURE" -->
<!--#echo var="SERVER_SOFTWARE" --> LiteSpeed
<!--#echo var="TZ" -->
<!--#echo var="UNIQUE_ID" --> 4pih09KZBTq3pLFcF3Ic1dw3
<!--#echo var="USER_NAME" -->

Discoveries of using SSI with Apache 1.3 on MPE and Microsoft-IIS/6.0

  1. Apache - Default errmsg: [an error occurred while processing this directive]
    MS IIS - Default errmsg: Error processing SSI file
    (linefeed included)

  2. Apache - Default timefmt: "%A %B %d %Y"
    MS IIS - same.

  3. Apache - Default sizefmt: abbrev
    MS IIS - same.

  4. Apache - supports SSI elements: #printenv #set
    MS IIS - DOES NOT support SSI elements: #printenv #set

  5. Apache - ONLY files with SSI extensions (shtm) are processed for SSI commands.
    MS IIS - ALL included files are processed for SSI commands.

  6. Apache - errmsg is a local setting for each included file.
    MS IIS - errmsg is a global setting for all included files.

  7. Apache - sizefmt=abbrev includes unit letter: k m
    MS IIS - sizefmt=abbrev has NO unit letter

  8. Apache - timefmt is a local setting for each included file.
    MS IIS - same.

  9. Apache - var LAST_MODIFIED in an included file is of the requested page.
    MS IIS - var LAST_MODIFIED in an included file is of the included file.

These default and differing functionalities may be server configurable.
With the use of javascript, you may be able to code around the unsupported features.
The above example uses javascript variable jspagedate to get the LAST_MODIFIED
date of the requested page to use in an include file.

SSI also has #if #elif #else #endif for making dynamic decisions in page rendering.
But I have not yet tested them.
2011/02/16 Keven Miller