5

I've found information on the web, but it just doesn't make sense to me. I'd like to know exactly what files I should go into, and precisely where and how I should modify them.

4 Answers 4

4

This has to be enabled (or the equivalent for your OS):

LoadModule include_module libexec/apache22/mod_include.so

And these added for the standard method:

AddType text/html .shtml
AddHandler server-parsed .shtml

#This one goes in the <Directory> directive you want them enabled for (ie "/")
Options +Includes 

OR the --x bit hack:

XBitHack on

This last one allows you to keep the normal html name, but chmod o+x file.html and enable SSI just for that file(s).

Everyone else pointed to the old version of the documentation: Apache mod_include Docs

1

When having

SSILastModified on 
XBitHack full

The setting "SSILastModified On" is a silent misconfiguration, because whether "SSILastModified" is on or not, it does not change any program behavior.

By tracking back to the source code of Apache, we can see the root cause of this misconfiguration is that the semantics enabled by "Xbithack Full" implicitly overwrite the semantics enabled by "SSILastModified On".

if (conf->lastmodified > 0) {
  ... {
   ap_update_mtime(r, r->finfo.mtime);
   ap_set_last_modified(r);}}

else if (((conf->xbithack == XBITHACK_FULL ||
         (conf->xbithack == XBITHACK_UNSET &&
                DEFAULT_XBITHACK == XBITHACK_FULL))
        ...)) {
        ap_update_mtime(r, r->finfo.mtime);
        ap_set_last_modified(r);
}

Similarlly, having "Xbithack full" will also overwrite "Xbithack on" Herein, one possible solution is to check whether "SSILastModified on" or "Xbithack on" is in your configuration file. If yes, please change it to "Xbithack Full".

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

Taken From: http://httpd.apache.org/docs/1.3/misc/FAQ.html#ssi-part-i

3
  • Yea, I saw this, but I'm still confused. How do I make sure my server config has an options directive that permits includes? Where do I add the AddHandler directive?
    – Justin Meltzer
    Sep 12, 2010 at 18:03
  • +1: where do you add the AddHandler directive?
    – AP257
    Sep 13, 2010 at 23:44
  • The AddHandler directive goes in your main Apache configuration file (e.g. /etc/apache2/apache2.conf, /etc/apache2/httpd/conf, or elsewhere depending upon your distribution). Oct 30, 2010 at 1:43
0

http://httpd.apache.org/docs/1.3/misc/FAQ.html#ssi-part-i

For more information, see http://www.apacheweek.com/features/ssi

Keep in mind that if your host has decided to diable SSI, there is no way around that.

You must log in to answer this question.