Boulder Community Network Indian Peaks, mountains above Boulder County
  Volunteer!     Feedback
About BCN    Donate
 
Last Update:

Server Side Includes


BCN's web server software (Apache) supports SSIs; which allow you to add dynamic and workgroup features to web pages (Apache's SSI documentation). For example, SSIs can show when a page was last updated or provide common page headers or footers. The SSIs are special HTML comment tags in your source file; when Apache sends a page to a web browser, it replaces the comment tags with the desired results. But SSIs have some limitations:
  • Client-side applications don't see SSIs. Many HTML editors will grab a copy of a page when you type in a URL. The server sends the files with the SSI tags replaced and you loose the advantage of using the SSI. For example, a hit counter SSI will be replaced the current hit count - after the updated page is uploaded back to BCN, the page counter will never change.
  • Even if you do remember to copy the page with FTP, the SSIs will not be displayed correctly when viewed as file:// URLs.
  • A site owner with only DIPP access on BCN can't get a copy of the file with the SSIs intact.
  • SSIs are not part of the HTML (or any other) standard. Although other web server packages support SSIs, they are not interoperable with Apache.
SSIs are then optimal if all the site content owners are editting the files directly on BCN. If you plan to edit the files at home and upload them later, SSIs are a problem.

On BCN, the default configuration is that SSI tags are only processed if the file has a .shtml suffix. If you have telnet/SSH access to BCN, you can force individual .htm(l) files or and entire site to be parsed for SSIs as follows:

  • individual file
    To force a file called whatever.html to be parsed for SSIs, type the following commend at the shell:
    chmod u+x whatever.html

    This approach takes advantage of the fact the the execute bits are not used on .html files. One problem with this approach is that the execute bit may be cleared when a file is uploaded.

  • entire site
    To force all the .html files on a particular site to be parsed for SSIs, create a file called .htaccess in the site's directory. The file will contain:
    AddType text/html .html
    AddHandler server-parsed .html

    You can also specify .htm suffix instead of or in addition to .html
    AddType text/html .html .htm
    AddHandler server-parsed .html .htm


Last Update: , by Paul von Behren
BCN Home Feedback About BCN Donate Search BCN Volunteer!