Configuring your server to permit SSI
To permit SSI on your server, you must have the following directive either in your
httpd.conffile, or in a
This tells Apache that you want to permit files to be parsed for SSI directives. Note that most configurations contain multiple
Optionsdirectives that can override each other. You will probably need to apply the
Optionsto the specific directory where you want SSI enabled in order to assure that it gets evaluated last.
Not just any file is parsed for SSI directives. You have to tell Apache which files should be parsed. There are two ways to do this. You can tell Apache to parse any file with a particular file extension, such as
.shtml, with the following directives:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to change the name of that page, and all links to that page, in order to give it a
.shtmlextension, so that those directives would be executed.
The other method is to use the
XBitHacktells Apache to parse files for SSI directives if they have the execute bit set. So, to add SSI directives to an existing page, rather than having to change the file name, you would just need to make the file executable using
chmod +x pagename.html