| SSI(8) | System Manager's Manual (smm) | SSI(8) |
ssi —
Server-Side-Includes CGI program
ssi |
This is an external CGI program that provides the same functionality as the built-in server-side-includes feature in many HTTP daemons. It is written for use with thttpd(8) and merecat(8), but should be easy to adapt to other systems.
There are two ways to use this; the modern way of using a
.shtml pattern in merecat.conf(5)
to trigger the SSI script, which requires enabling the SSI module. Then
there is the traditional thttpd(8) approach. We start with
the relevant settings needed in merecat.conf:
ssi {
enabled = true
pattern = "**.shtml" # default
cgi-path = "cgi-bin/ssi" # default, web server root is used
}
The traditional thttpd way runs ssi as a
simple CGI script, which requires placing the ssi binary in the web server
CGI area, and enabling CGI. Then set up URLs with the path to the document
to parse as the "pathinfo". That's the part of the URL that comes
after the CGI program name. For example, if the URL to this program is:
http://www.acme.com/cgi-bin/ssi
http://www.acme.com/users/wecoyote/doc.html
http://www.acme.com/cgi-bin/ssi/users/wecoyote/doc.html
The format description below is adapted from ⟨http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html⟩.
All directives are formatted as SGML comments within the document. This is in case the document should ever find itself in the client's hands unparsed. Each directive has the following format:
<!--#command tag1="value1" tag2="value2" -->
Each command takes different arguments, most only accept one tag at a time. Here is a breakdown of the commands and their associated tags:
configtimefmtsizefmterrmsgincludeechofsizeflastmodA number of variables are made available to parsed documents. In addition to the CGI variable set, the following variables are made available:
DOCUMENT_NAMEDOCUMENT_URIQUERY_STRING_UNESCAPEDDATE_LOCALDATE_GMTDATE_LOCAL but in Greenwich mean time
(GMT).LAST_MODIFIEDJef Poskanzer
⟨jef@mail.acme.com⟩ wrote the original for use with
thttpd.
Joachim Wiberg ⟨troglobit@gmail.com⟩
added minor features and a trigger in merecat for
.shtml pages.
Does not implement all "modern" SSI directives are
supported. E.g., exec cgi and exec
cmd or any control directives like if, elif, else,
endif, etc. Patches and pull-requests are welcome :)
| August 3, 2019 | merecat (2.32) |