Project

General

Profile

Mod ssi » History » Revision 12

Revision 11 (Anonymous, 2008-08-31 16:51) → Revision 12/28 (Anonymous, 2008-08-31 17:24)

[[TracNav(DocsToc)]] 
 {{{ 
 #!rst 

 ==================== 
 Server-Side Includes 
 ==================== 

 --------------- 
 Module: mod_ssi 
 --------------- 

 .. 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 

 Configuration 
 ------------- 

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

 :: 

   server.modules = ( ..., "mod_ssi", ... ) 
   ssi.extension = ( ".shtml" ) 

 Supported Options 
 ----------------- 

 - ``<!--#echo var="..." -->`` :: 

   <!--#echo var="DOCUMENT_ROOT"--> 

   For now it works only for environment variables, not user specified SSI variables. 

 - ``<!--#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 
 -------------------- 

 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 - use exec to execute scripts or apply the patch at #536 
 - config.errmsg 
 - echo.encoding 


 }}}