Always read the documentation for your server first. This page is intended as a general guide and is not server specific.
SUPPORTS SSI | DOES NOT SUPPORT SSI |
---|---|
NCSA HTTPd | CERN HTTPd |
APACHE | Netscape Enterprise/Suite Spot |
Microsoft IIS | Microsoft Personal Web Server |
SSI must be supported by the server in order to be able to be configured on the server. You must also configure and/or rename your files so that the server knows they contain SSI directives.
APACHE WEB SERVER
http://www.apache.org)- Open httpd.conf (usually in /etc)
- Locate the <DIRECTORY> in httpd.conf where you want to enable SSI.
- Add the following line inside the <DIRECTORY> section:
AddType text/x-server-parsed-html .shtml
- This next bit gets tricky. You have to tell the server where
to expect the SSI's and what SSI's are allowed to do.
a. To enable SSI's to be included in the page use:
Options +Includesb. To enable SSI's to execute external programs on the server use:
Options ExecCGIc. To enable BOTH includes and CGI's, use:
Options Includes ExecCGI - Save httpd.conf file.
- Restart the Apache server.
- Add your SSI directives to one or more files.
- Change the extension of those files from .htm or .html to .shtml.
You should not use .html as the file extension identifier for SSI directives. Server Side Includes take up processing power, so enabling SSI in all web pages is not usually a good idea unless you have computing power to burn.
For the Apache server, there is also the X-Bit hack. See the Apache's Server Side Include page for more information. Since Apache IS the NCSA HTTPd server with 'patches' applied, the configuration methodology is nearly identical to what you do to configure the NCSA HTTPd.
MICROSOFT INTERNET INFORMATION SERVER (IIS)
WARNING: Make certain you are using the latest Windows Service Pack, and the latest patch level for IIS. Note that Microsoft does NOT support a full NCSA compliant HTTPd implmentation, thus, it does NOT support SSI directves fully.
Server Side Includes are already enabled on Microsoft's servers by default, making them less secure than the Apache server in this regard. All you have to do is add the directives to your page and rename them *.shtml.