Server Side Includes (SSI) on UNHINFO:
|
Internet: Server Side IncludesAug 17, 1999, 1:30-3:30 p.m., Hewitt Annex 2.Description: Server Side Includes (SSI) Usage. Shows how to direct the UNHINFO server (Apache) to include information automatically in your Web pages. Common usage is to include headers, footers, URLs, and last-modified dates. Lecture/demo format. Instructor: Jim Cerny.
Prerequisite: Basic HTML authoring.
|
Server Side Includes (SSI) are a way to promote modular design of your documents and to produce simple dynamic documents. Modular design allows you to separate selected content so that a change made in one place (e.g., a header or footer) is applied to all the files in a collection. SSI in combination with Cascading Style Sheets holds the promise for very effective modular design. Dynamic content is the inclusion of information based on the document context at the time it is served (e.g., to include a modification date or to present content based on browser characteristics).
For a Web server that supports SSI, such as Apache with more than 55% of the servers in Internet use, the server sysadmin enables SSI. Then the page author is free to embed SSI directives (commands) in their pages using HTML comments. The Web server scans these HTML files (.html, .htm, .shtml) and parses and acts on any SSI directives before sending the page to the browser.
SSI directives have the basic form of an HTML comment statement containing the command keywords, attribute (argument) keywords, and attribute values:
<!--#command attribute="value" attribute="value" -->Be very careful of the details. HTML comments begin with "<!--" and then without any whitespace there is an "#" and the command name of the directive. There may be one or more attributes, as applicable to the command, and these may be set to values, with the values in quotes. Then there is the end of the comment "-->" and that may be preceded by white space. Several of these comments may be put on one line, as is allowed with HTML.
config, echo, flastmod, fsize, include, printenv, set, if-elif-else-endifOn UNHINFO the "exec" directive is disabled.
The following materials are listed from the more general and introductory to the more specific and advanced. Please consider two things when reading these materials: (1) Some documents include information for the Apache Web server sysadmin as well as information for page authors. (2) Some documents describe features that may not be available on the UNHINFO Web server (e.g., the SSI "exec" directive).