Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Sep 14 '10 at 3:22

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

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

share|improve this answer
add comment
  • 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

share|improve this answer
    
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 '10 at 18:03
    
+1: where do you add the AddHandler directive? –  AP257 Sep 13 '10 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). –  KayakJim Oct 30 '10 at 1:43
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.