IBM AS/400E Network Router User Manual


 
Chapter 9. Using Server-Side Includes
This chapter discusses using server-side includes with IBM HTTP Server for
AS/400.
Server-side includes allow you to insert information into CGI programs and HTML
documents that the server sends to the client. This chapter describes the commands
that are required to make server-side includes work in your CGI programs and
HTML documents.
Considerations for using server-side includes
Before using server-side includes on your server, there are a few issues you should
consider. One issue is performance. Performance can be significantly impacted
when the server is processing files while sending them. Another issue is security.
Allowing users to run commands can be a security risk. Care should be taken
when deciding which directives you use server-side includes in and in which
directories you use the exec command. You can minimize the security risk if you
do not enable the exec command.
You should also note that you cannot refer to files recursively. For example, if you
are running file sleepy.html and the program finds
<--!#include file="sleepy.html"--> the server does not detect the error and the
server loops until it abends. However, you can refer to files within files. For
example, file sleepy.html refers to files smiley.html references dopey.html.
Preparing to use server-side includes
To use server-side includes, you must add the AddType directive to your
configuration file. Two examples follow:
Examples:
AddType .shtml text/x-ssi-html 8 bit 1.0
AddType .htmls text/x-ssi-html 8 bit 1.0
Note: If you use file extensions other than .shtml or .htmls, you should check the
AddType directive to see if that extension already exists. See the
configuration file, appendix listing, or the MIME form for a list of existing
AddType directives.
You can also use the imbeds directive to specify whether server-side includes are
used in HTML documents, CGI programs, or both. Examples of this directive
follow:
Examples:
imbeds value
imbeds on
Default: imbeds off
The server does not process your error files for imbeds, regardless of the file
extensions or use of the imbeds directive.
© Copyright IBM Corp. 1997, 2000 131