Server Side Include

This web page has been accessed  times since 3/9/98.

Server Side Include

Enable the inclusion of variables such as the last modified date, automatically.
Enable the consistent look and feel of web pages.
There is processing overhead. Use sparingly.

Apache Configuration File

User webuser
Group webgroup
ServerName viva.uccs.edu
DocumentRoot /home/chow/site.ssi/htdocs
AccessConfig /dev/null
ResourceConfig /dev/null
AddHandler server-parsed shtml
TransferLog /home/chow/site.ssi/logs/access_log
Port 8888

Home Pages with Server Side Include

echo.shtml
Echoing the Document_URI <!--#echo var="DOCUMENT_URI"-->
Echoing the DATE_GMT <!--#echo var="DATE_GMT"-->

Here is the result of accessing echo.shtml
Echoing the Document_URI /echo.shtml
Echoing the DATE_GMT Monday, 09-Mar-1998 19:34:09 MST

exec.shtml

<!--#config errmsg="Bungled again!"-->
We're now going to execute the file 'do_this':
<< <!--#exec cmd="rubbish/do_this"--> >>
and now /home/chow/cgi-bin/mycgi.ok:
<< <!--#exec cmd="/home/chow/cgi-bin/mycgi.ok"--> >>
That  was it.

Here is the results of accessing viva:8888/exec.shtml:
We're now going to execute the file 'do_this':

<<  >>

and now /home/chow/cgi-bin/mycgi.ok:

<< Content-type: text/html

HTTP_ACCEPT_LANGUAGE=en
DOCUMENT_NAME=exec.shtml
SCRIPT_FILENAME=/home/chow/site.ssi/htdocs/exec.shtml
HTTP_ACCEPT_CHARSET=iso-8859-1,*,utf-8
HTTP_PRAGMA=no-cache
SERVER_NAME=viva.uccs.edu
HTTP_CONNECTION=Keep-Alive
DOCUMENT_URI=/exec.shtml
REMOTE_ADDR=128.198.9.108
REQUEST_URI=/exec.shtml
TERM=dumb
HOSTTYPE=i386
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/mh:/home/guest/bin:/usr/sbin:/sbin
HTTP_HOST=viva:8888
REMOTE_PORT=1234
REQUEST_METHOD=GET
SHELL=/bin/bash
GATEWAY_INTERFACE=CGI/1.1
QUERY_STRING=
SERVER_SOFTWARE=Apache/1.2.5
DATE_GMT=Monday, 09-Mar-1998 20:24:02 MST
SERVER_PROTOCOL=HTTP/1.0
USER_NAME=root
REMOTE_HOST=chow.uccs.edu
LAST_MODIFIED=Monday, 09-Mar-1998 13:23:59 MST
SERVER_PORT=8888
DATE_LOCAL=Monday, 09-Mar-1998 13:24:02 MST
DOCUMENT_ROOT=/home/chow/site.ssi/htdocs
OSTYPE=Linux
HTTP_USER_AGENT=Mozilla/4.04 [en] (Win95; I)
HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
SCRIPT_NAME=/exec.shtml
DOCUMENT_PATH_INFO=
SHLVL=2
SERVER_ADMIN=[no address given]
_=/usr/bin/env
 >>

That was it.

include.shtml

<!--#config errmsg="Bungled again!"-->
This is a some text in which we want to include text from another file:

<< <!--#include virtual="another_file"--> >>

That was it.

Here is the result of accessing include.shtml:
This is a some text in which we want to include text from another file:

<< This the stuff in 'another_file'.

 >>

That was it.

time.shtml

<!--#config errmsg="Bungled again!"-->
<!--#config timefmt="%A %B %C, the %jth day of the year, %s seconds since the Ep
och"-->
The mod time of this file is <!--#flastmod virtual="size.shtml"-->
The mod time of another_file is <!--#flastmod virtual="another_file"-->  

Here is the reults of accessing time.shtml:

The mod time of this file is Monday March 19, the 068th day of the year,  seconds since the Epoch
The mod time of another_file is Monday March 19, the 068th day of the year,  seconds since the Epoch

size.html

<!--#config errmsg="Bungled again!"-->
<!--#config sizefmt="bytes"-->
The size of this file is <!--#fsize file="size.shtml"--> bytes.
The size of another_file is <!--#fsize file="another_file"--> bytes.

Here is the result of accessing size.shtml:
The size of this file is 206 bytes. 
The size of another_file is 36 bytes.