J. Blustein

Web-centric Computing

Some Example Code

SSI Test Page

This page looks different on

What works (and what doesn't)

  1. <!--#echo var="DATE_LOCAL" -->
    Friday, 29-Mar-2024 09:36:29 ADT
  2. <!--#echo var="document_name" -->
    test1.shtml
  3. <!--#exec cmd="/usr/bin/echo exec works" -->
    [an error occurred while processing this directive]
  4. Include virtual works on torch (see below)

Sometimes small differences matter...

  1. <!--#echo var="DATE_LOCAL" -->
    Friday, 29-Mar-2024 09:36:29 ADT
  2. <!-- #echo var="DATE_LOCAL" -->

    Because of the extra space in the second example, the directive is not recognized

A whole lot of testing goin' on

  1. Date & Time

    1. <!--#echo var="DATE_LOCAL" -->
      Friday, 29-Mar-2024 09:36:29 ADT
    2. <!--#echo var="Date_GMT" -->
      Friday, 29-Mar-2024 12:36:29 GMT
  2. About this document

    1. <!--#echo var="DOCUMENT_NAME" -->
      test1.shtml
    2. <!--#echo var="DOCUMENT_URI" -->
      /~jamie/course/CS/4173/examples/SSI/test1.shtml
    3. <!--#echo var="last_modified" -->
      Wednesday, 05-Jan-2005 17:55:49 AST
  3. About this server

    1. <!--#echo var="server_name" -->
      web.cs.dal.ca
    2. <!--#echo var="server_software" -->
      Apache
  4. About the user/browser

    1. <!--# echo var="HTTP_USER_AGENT" -->
      [an error occurred while processing this directive]
    2. <!--# echo var="GATEWAY_INTERFACE" -->
      [an error occurred while processing this directive]
    3. <!--#echo var="remote_addr" -->
      3.235.145.95
  5. Files on the server (executables and data files)

    1. <!--#exec cmd="/usr/bin/echo exec works" -->
      [an error occurred while processing this directive]
    2. <!--#exec cmd="/usr/bin/id" -->
      [an error occurred while processing this directive]
    3. <!--#exec cmd="/usr/bin/cat /etc/passwd" -->
      [an error occurred while processing this directive]
  6. If

         <pre>
          <!--#if expr="apple=orange" -->
           If is not working
          <!--#else -->
           If *is* working
          <!--#endif -->
         </pre>
         
          [an error occurred while processing this directive]
           If is not working
          
         
  7. CGI executables within SSI

    1. CGI directive
                 <!--#exec cgi="/~maxwell/cgi-bin/test-cgi.cgi" -->
               
                 [an error occurred while processing this directive]
               
    2. Include virtual directive
                 <pre>
      <!--#include virtual="/~maxwell/cgi-bin/test-cgi.cgi" -->
      </pre>
                  CGI/1.0 test script report:
      
      argc is 0. argv is .
      
      SERVER_SOFTWARE = Apache
      SERVER_NAME = web.cs.dal.ca
      GATEWAY_INTERFACE = CGI/1.1
      SERVER_PROTOCOL = INCLUDED
      SERVER_PORT = 443
      REQUEST_METHOD = GET
      HTTP_ACCEPT = */*
      PATH_INFO = 
      PATH_TRANSLATED = 
      SCRIPT_NAME = /~maxwell/cgi-bin/test-cgi.cgi
      QUERY_STRING = 
      REMOTE_HOST =
      REMOTE_ADDR = 3.235.145.95
      REMOTE_USER =
      AUTH_TYPE =
      CONTENT_TYPE =
      CONTENT_LENGTH =
      
      Id : 
      uid=5002(maxwell) gid=1035(csstaff) groups=1035(csstaff),1032(fcsfile),1033(cstech),1036(ember),1043(deepsense),1051(fcsaio),1088(cshelp),1091(officestaffdrive),1092(deansofficedrive),5012(dstech),6010(malnis),17997(awxadmins) context=system_u:system_r:httpd_suexec_t:s0
      
      
      Environment: 
      SERVER_SIGNATURE=
      SSL_TLS_SNI=web.cs.dal.ca
      UNIQUE_ID=Zga1zSC9lHSsM59v0YG4tgABEBU
      HTTP_USER_AGENT=claudebot
      SERVER_PORT=443
      HTTP_HOST=web.cs.dal.ca
      DOCUMENT_ARGS=
      DOCUMENT_ROOT=/local/data/web.cs.dal.ca/web/
      SCRIPT_FILENAME=/users/webhome/maxwell/cgi-bin/test-cgi.cgi
      HTTPS=on
      REQUEST_URI=/~jamie/course/CS/4173/examples/SSI/test1.shtml
      USER_NAME=
      SCRIPT_NAME=/~maxwell/cgi-bin/test-cgi.cgi
      REMOTE_PORT=47728
      PATH=/usr/local/bin:/usr/bin:/bin
      CONTEXT_PREFIX=/~maxwell
      PWD=/users/webhome/maxwell/cgi-bin
      SERVER_ADMIN=cshelp@cs.dal.ca
      REQUEST_SCHEME=https
      DATE_GMT=
      HTTP_REFERER=https://www.cs.dal.ca/~jamie/course/CS/4173/examples/SSI/test1.shtml
      HTTP_ACCEPT=*/*
      DOCUMENT_URI=/~jamie/course/CS/4173/examples/SSI/test1.shtml
      DATE_LOCAL=
      REMOTE_ADDR=3.235.145.95
      SHLVL=1
      SERVER_NAME=web.cs.dal.ca
      LAST_MODIFIED=
      DOCUMENT_NAME=test1.shtml
      SERVER_SOFTWARE=Apache
      QUERY_STRING=
      SERVER_ADDR=129.173.22.11
      GATEWAY_INTERFACE=CGI/1.1
      SERVER_PROTOCOL=INCLUDED
      REQUEST_METHOD=GET
      CONTEXT_DOCUMENT_ROOT=/users/webhome/maxwell
      _=/usr/bin/env
      
      
      Stdin: 
      
      
      ------------ DONE ------------
      
                

Important Notes


http://www.cs.dal.ca/~jamie/course/CS/4173/examples/SSI/test1.shtml
Version:
23 October 2001
Based on
ssitest.shtml from Chris Maxwell
Prof:
J. Blustein <jamie@cs.dal.ca>

Valid XHTML 1.0!