oreilly.comSafari Books Online.Conferences.

Apache FAQ
Linux FAQ

Log in to particpate

   Apache FAQ > F. Dynamic Content (CGI and SSI)
Question:  How do I enable SSI (parsed HTML)?

SSI (an acronym for Server-Side Include) directives allow static HTML documents to be enhanced at run-time (e.g., when delivered to a client by Apache). The format of SSI directives is covered in the mod_include manual; suffice it to say that Apache supports not only SSI but xSSI (eXtended SSI) directives.

Processing a document at run-time is called parsing it; hence the term "parsed HTML" sometimes used for documents that contain SSI instructions. Parsing tends to be resource-consumptive compared to serving static files, and is not enabled by default. It can also interfere with the cachability of your documents, which can put a further load on your server. (See the next question for more information about this.)

To enable SSI processing, you need to

  • Build your server with the mod_include module. This is normally compiled in by default.
  • Make sure your server configuration files have an Options directive which permits Includes.
  • Make sure that the directory where you want the SSI documents to live is covered by the "server-parsed" content handler, either explicitly or in some ancestral location. That can be done with the following AddHandler directive:
    AddHandler server-parsed .shtml

    This indicates that all files ending in ".shtml" in that location (or its descendants) should be parsed. Note that using ".html" will cause all normal HTML files to be parsed, which may put an inordinate load on your server.

For additional information, see the Apache Week article on Using Server Side Includes.

This FAQ is from Apache Server Frequently Asked Questions

Sponsored by: