Mod ssi » History » Revision 15
Revision 14 (Anonymous, 2008-08-31 19:36) → Revision 15/28 (stbuehler, 2009-02-17 10:48)
h1. Module mod_ssi - [[TracNav(DocsToc)]] <pre> #!rst ==================== Server-Side Includes ==================== {{>toc}} --------------- Module: mod_ssi --------------- h2. .. contents:: Table of Contents 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 h2. Configuration ------------- You have to load the mod_ssi module and set the ssi-extension: <pre> :: server.modules = ( ..., "mod_ssi", ... ) ssi.extension = ( ".shtml" ) </pre> h2. Supported Options ----------------- * <!--#echo - ``<!--#echo var="..." --> -->`` :: <!--#echo var="DOCUMENT_ROOT"--> * <!--#include - ``<!--#include (file="..."\|virtual="...") --> -->`` * <!--#flastmod - ``<!--#flastmod (file="..."\|virtual="...") --> -->`` * <!--#fsize - ``<!--#fsize (file="..."\|virtual="...") --> -->`` * <!--#config - ``<!--#config timefmt="..." sizefmt="(bytes|abbrev)" --> -->`` * <!--#printenv --> - ``<!--#printenv -->`` * <!--#set - ``<!--#set var="..." value="..." --> -->`` * <!--#if - ``<!--#if expr="..." --> -->`` * <!--#elif - ``<!--#elif expr="..." --> -->`` * <!--#else --> - ``<!--#else -->`` * <!--#endif --> - ``<!--#endif -->`` * <!--#exec - ``<!--#exec cmd="..." --> -->`` :: <!--#exec cmd="date"--> h2. Expression Handling ------------------- Every "expr" ''expr'' is interpreted: * - logical: AND, OR, ! * - compare: =, <, <=, >, =>, != * - precedence: (, ) * - quoted strings: 'string with a dollar: $FOO' * - variable substitution: $REMOTE_ADDR * - unquoted strings: string h2. Flow Control ------------ if, elif, else and endif can only be used to insert content under special conditions. h2. Unsupported Features -------------------- The original SSI module from NCSA and Apache provided some more options which are not supported by this module for various reasons: * - nested requests with `include virtual`: use exec to execute scripts or apply the patch at http://trac.lighttpd.net/trac/ticket/536 * - `echo var` for SSI variables: it only works for environment variables if you don't apply patch at http://trac.lighttpd.net/trac/ticket/795 * - config.errmsg * - echo.encoding </pre>