Module mod_include

Module mod_include supports directives for the IBM® HTTP Server for i Web server.

Summary

The module mod_include provides for server-parsed html documents.

Note: A configuration change is required in order for mod_include to work correctly. Previously, mod_include was a handler, and the config file had a AddHandler server-parsed .htmls directive in order to define mod_include as a handler for extensions of .htmls. mod_include is now a filter. Thus, the AddHandler directive no longer applies. Directive AddOutputFilter must be used and associated with a file extension, much like directive AddHandler. For example:
AddOutputFilter INCLUDES .shtml

Enabling Server-Side Includes

Server-Side Includes (SSI) are implemented by the INCLUDES filter. If documents containing SSI directives are given the extension .shtml, the following directives makes the HTTP Server parse and assign the resulting documents as MIME type text/html. For example:

AddType text/html .shtml
AddOutputFilter INCLUDE .sthml

The following directive must be given for the directories containing the shtml files (typically in a <Directory> section, but this directive is also valid .htaccess files if AllowOverride Options is set). For example:

Options +Includes

See the Options directive for more information.

Note: The IBM i system does not support XBitHack to enable server-side includes.

Directives

SSIETag

Module: mod_include
Syntax: SSIETag on|off
Default: SSIETag off
Context: directory, .htaccess
Override: none
Origin: Apache
Example: SSIETag on

The SSIETag directive controls whether an ETags header are generated by the server.

Under normal circumstances, a file filtered by mod_include may contain elements that are either dynamically generated, or that may have changed independently of the original file. As a result, by default the server is asked not to generate an ETag header for the response by adding no-etag to the request notes.

The SSIETag directive suppresses this behaviour, and allows the server to generate an ETag header. This can be used to enable caching of the output. Note that a backend server or dynamic content generator may generate an ETag of its own, ignoring no-etag, and this ETag will be passed by mod_include regardless of the value of this setting.

Parameter: on | off
  • The on parameter represents the existing ETags will be respected, and ETags generated by the server will be passed on in the response.
  • The off parameter represents no-etag will be added to the request notes, and the server is asked not to generate an ETag. Where a server ignores the value of no-etag and generates an ETag anyway, the ETag will be respected.

SSIEndTag

Module: mod_include
Syntax: SSIEndTag string
Default: SSIEndTag "-->"
Context: server config, virtual host
Override: none
Origin: Apache
Example: SSIEndTag "-->"

The SSIEndTag directive changes the string that mod_include looks for to mark the end of a include command.

Parameter: string
  • The string parameter represents the string that mod_include looks for to mark the end of a include command.

SSIErrorMsg

Module: mod_include
Syntax: SSIErrorMsg string
Default: SSIErrorMsg "[an error occurred while processing this directive]"
Context: server config, virtual host, directory, .htaccess
Override: none
Origin: Apache
Example: SSIErrorMsg "This is the default error message"

This SSIErrorMsg directive defines the default error message that is used when an error is encountered while processing SSI tags in a file. This configuration directive can be used instead of the config errmsg SSI tag.

Parameter: string
  • The string parameter defines the default error message that is used when an error is encountered while processing SSI tags in a file. For example:
    SSIErrorMsg "This is the default error message"

SSILastModified

Module: mod_include
Syntax: SSILastModified on|off
Default: SSILastModified off
Context: directory, .htaccess
Override: none
Origin: Apache
Example: SSILastModified on

The SSILastModified directive controls whether Last-Modified headers are generated by the server.

Under normal circumstances, a file filtered by mod_include may contain elements that are either dynamically generated, or that may have changed independently of the original file. As a result, by default the Last-Modified header is stripped from the response.

The SSILastModified directive overrides this behaviour, and allows the Last-Modified header to be respected if already present, or set if the header is not already present. This can be used to enable caching of the output.

Parameter: on | off
  • The on parameter represents the Last-Modified header will be respected if already present in a response, and added to the response if the response is a file and the header is missing.
  • The off parameter represents the Last-Modified header will be stripped from responses.

SSILegacyExprParser

Module: mod_include
Syntax: SSILegacyExprParser on|off
Default: SSILegacyExprParser off
Context: directory, .htaccess
Override: none
Origin: Apache
Example: SSILegacyExprParser on

mod_include has been switched to the new ap_expr syntax for conditional expressions in #if flow control elements. The SSILegacyExprParser directive allows to switch to the old syntax which is compatible with HTTP server version 2.2.x and earlier.

Parameter: on | off
  • The on parameter represents the old syntax conditional expressions is used.
  • The off parameter represents the new ap_expr syntax conditional expressions is used (default behavior).

SSIStartTag

Module: mod_include
Syntax: SSIStartTag string
Default: SSIStartTab "<!--#"
Context: server config, virtual host
Override: none
Origin: Apache
Example: SSIStartTab "<!--#"

The SSIEndTag directive changes the string that mod_include looks for to mark an include element to process. You may want to use this option if you have 2 servers parsing the output of a file (each processing different commands, possibly at different times).

Parameter: string
  • The string parameter represents the string that mod_include looks for to mark an include element to process.
Example 1
SSIStartTag "*!ENTITY!*%"
SSIEndTag "%>" 

The example above, which specifies a matching SSIEndTag, allows you to use SSI directives as shown in the example below:

Example 2: SSI directives with alternate start and end tags
*!ENTITY!*%printenv %> 

SSITimeFormat

Module: mod_include
Syntax: SSITimeFormat strftime string
Default: SSITimeFormat "%A, %d-%b-%Y %H:%M:%S %Z"
Context: server config, virtual host, directory, .htaccess
Override: none
Origin: Apache
Example: SSITimeFormat "%H:%M:%S %m-%d-%y"

The SSITimeFormat directive defines the default dates/times format that are returned to the browser while processing SSI tags. This configuration directive can be used instead of the config timefmt SSI tag.

Parameter: strftime string
  • The strftime string parameter defines the default dates/times format that are returned to the browser while processing SSI tags. For example,
    SSITimeFormat "%H:%M:%S %m-%d-%y"

See Server-side include commands for HTTP Server for a list of supported server-side include directives.

Note: HTTP Server does not support the %Z (time zone) format.

SSIUndefinedEcho

Module: mod_include
Syntax: SSIUndefinedEcho string
Default: SSIUndefinedEcho "(none)"
Context: server config, virtual host
Override: none
Origin: Apache
Example: SSIUndefinedEcho "The value on an SSI Echo request is not defined"

The SSIUndefinedEcho directive is used to define the default message that is used when an "echo" SSI tag is requesting a variable whose value has not been set.

Parameter: string
  • The string parameter defines the default message that is used when an "echo" SSI tag is requesting a variable whose value has not been set.