Project

General

Profile

Actions

Mod ssi » History » Revision 22

« Previous | Revision 22/28 (diff) | Next »
gstrauss, 2016-07-13 04:47


Server-Side Includes

Module: mod_ssi

Description

SSI is a very old and cheap way to generate content dynamically on server-side.

The use of this module is strongly discouraged:
  • the execution of a SSI script is done in the server-core
  • a long-running SSI script blocks the handling of ALL connections
  • as soon as you use #exec the performance gets worse than using CGI scripts directly
You should only use SSI for two reason:
  • content assembling with #include
  • legacy applications

Installation

You have to load the mod_ssi module and set the ssi.extension:

server.modules = ( ..., "mod_ssi", ... ) #Note that if you use mod_compress mod_ssi must come first to function.

Options

ssi.extension

List of file extensions that should be interpreted via mod_ssi.

Example:

ssi.extension = ( ".shtml" )

ssi.content-type

Content type of the pages being served via mod_ssi.
Default value: text/html

ssi.conditional-requests

Enable/disable conditional request handling and generate ETag and Last-Modified response headers.
This should not be enabled unless the SSI requests are known to generate cacheable documents. An SSI page which only includes contents from other static files and/or which uses SSI commands that produce predictable output may be cacheable.
Default value: disable

ssi.exec

Enable/disable #exec cmd="..." execution
Default value: enable

Available Elements


 <!--#echo var="..." -->
 <!--#echo var="DOCUMENT_ROOT"-->
 <!--#include file="..."\|virtual="..." -->
 <!--#flastmod file="..."\|virtual="..." -->
 <!--#fsize file="..."\|virtual="..." -->
 <!--#config timefmt="..." sizefmt="(bytes|abbrev)" -->
 <!--#printenv -->
 <!--#set var="..." value="..." -->
 <!--#if expr="..." -->
 <!--#elif expr="..." -->
 <!--#else -->
 <!--#endif -->
 <!--#exec cmd="..." -->
 <!--#exec cmd="date"-->

Expression Handling

Every "expr" is interpreted:
  • logical: AND, OR, !
  • compare: =, <, <=, >, =>, !=
  • precedence: (, )
  • quoted strings: 'string with a dollar: $FOO'
  • variable substitution: $REMOTE_ADDR
  • unquoted strings: string

Flow Control

if, elif, else and endif can only be used to insert content under special conditions.

Unsupported Features (Not Implemented)

The original SSI module from NCSA and Apache provided some more options which are not supported by this module for various reasons:

Updated by gstrauss over 7 years ago · 22 revisions