13.1 Configuring the Apache Server for SSI

Team-Fly    

 
Webmaster in a Nutshell, 3rd Edition
By Robert Eckstein, Stephen Spainhour
Table of Contents
Chapter 13.  Server Side Includes

13.1 Configuring the Apache Server for SSI

To enable SSI, you must tell Apache what type of files to parse for includes, and enable them in any directory where they exist.

In the appropriate <Directory> sections of the server configuration file httpd.conf (or .htaccess files), include the following directive:

 Options+ Includes 

In the main configuration file, you must specify the parsed file type ( .shtml ) and associate it with the INCLUDES filter, which implements the SSI module mod_include . For example, the following two lines specify that the server should handle documents with the .shtml suffix as HTML documents, and parse them for SSI:

 AddType text/html .shtml AddOutputFilter INCLUDES .shtml 

Prior to Apache 2.0, the server-parsed handler implemented the SSI module with:

 AddHandler server-parsed .shtml 

If you specify the suffix .html here, the server would parse all HTML documents. This would make it easier to modify files without having to worry about changing link and other issues, but it would cause a noticeable performance hit to the server. An alternate method to using the .shtml file extension is to use the XBitHack directive:

 XBitHack on 

This tells Apache to parse for SSI any file that has the executable permission set. You can do this for a file with the following command:

 chmod +x filename.html 

See Chapter 19 for more on configuring the Apache server.


Team-Fly    
Top


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net