1ssi(8) System Manager's Manual ssi(8)
2
3
4
6 ssi - server-side-includes CGI program
7
9 ssi
10
12 This is an external CGI program that gives you the same functionality
13 as the built-in server-side-includes feature in some HTTP daemons. It
14 is written for use with thttpd(8), but should be easy to adapt to other
15 systems.
16
17 To use this program, first make sure it is installed in your server's
18 CGI area, and that CGI is enabled. Then set up your URLs with the path
19 to the document you want parsed as the "pathinfo". That's the part of
20 the URL that comes after the CGI program name. For example, if the URL
21 to this program is:
22 http://www.acme.com/cgi-bin/ssi
23 and the url for your document is:
24 http://www.acme.com/users/wecoyote/doc.html
25 then the compound URL that gives you the document filtered through the
26 program would be:
27 http://www.acme.com/cgi-bin/ssi/users/wecoyote/doc.html
28
29 The format description below is adapted from
30 http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html
31
33 All directives are formatted as SGML comments within the document.
34 This is in case the document should ever find itself in the client's
35 hands unparsed. Each directive has the following format:
36 <!--#command tag1="value1" tag2="value2" -->
37 Each command takes different arguments, most only accept one tag at a
38 time. Here is a breakdown of the commands and their associated tags:
39
40 * config: The config directive controls various aspects of the file
41 parsing. There are two valid tags:
42
43 o timefmt: gives the server a new format to use when providing
44 dates. This is a string compatible with the strftime library
45 call.
46
47 o sizefmt: determines the formatting to be used when displaying
48 the size of a file. Valid choices are bytes, for a formatted
49 byte count (formatted as 1,234,567), or abbrev for an abbrevi‐
50 ated version displaying the number of kilobytes or megabytes
51 the file occupies.
52
53 * include: Inserts the text of another document into the parsed docu‐
54 ment. The inserted file is parsed recursively, so it can contain
55 server-side-include directives too. This command accepts two tags:
56
57 o virtual: Gives a virtual path to a document on the server.
58
59 o file: Gives a pathname relative to the current directory. ../
60 cannot be used in this pathname, nor can absolute paths be
61 used.
62
63 * echo: Prints the value of one of the include variables (defined
64 below). Any dates are printed subject to the currently configured
65 timefmt. The only valid tag to this command is var, whose value is
66 the name of the variable you wish to echo.
67
68 * fsize: prints the size of the specified file, subject to the
69 sizefmt parameter to the config command. Valid tags are the same
70 as with the include command.
71
72 * flastmod: prints the last modification date of the specified file,
73 subject to the formatting preference given by the timefmt parameter
74 to config. Valid tags are the same as with the include command.
75
77 A number of variables are made available to parsed documents. In addi‐
78 tion to the CGI variable set, the following variables are made avail‐
79 able:
80
81 * DOCUMENT_NAME: The current filename.
82
83 * DOCUMENT_URI: The virtual path to this document (such as
84 /~robm/foo.shtml).
85
86 * QUERY_STRING_UNESCAPED: The unescaped version of any search query
87 the client sent.
88
89 * DATE_LOCAL: The current date, local time zone. Subject to the
90 timefmt parameter to the config command.
91
92 * DATE_GMT: Same as DATE_LOCAL but in Greenwich mean time.
93
94 * LAST_MODIFIED: The last modification date of the current document.
95 Subject to timefmt like the others.
96
98 Does not implement the "exec" directive. Actually, I consider this
99 neither a bug nor a deficiency, but some may.
100
102 thttpd(8), strftime(3)
103
105 Copyright © 1995 by Jef Poskanzer <jef@acme.com>. All rights reserved.
106
107
108
109 18 October 1995 ssi(8)