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" -->
    Thursday, 22-Aug-2019 17:01:35 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" -->
    Thursday, 22-Aug-2019 17:01:35 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" -->
      Thursday, 22-Aug-2019 17:01:35 ADT
    2. <!--#echo var="Date_GMT" -->
      Thursday, 22-Aug-2019 20:01:35 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.226.251.81
  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 = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
      PATH_INFO = 
      PATH_TRANSLATED = 
      SCRIPT_NAME = /~maxwell/cgi-bin/test-cgi.cgi
      QUERY_STRING = 
      REMOTE_HOST =
      REMOTE_ADDR = 3.226.251.81
      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),1080(vpnusers),1088(cshelp),1091(officestaffdrive),1092(deansofficedrive),1094(kvmvdi),1104(kvmvdi_csci2133_admin),1105(kvmvdi_csci2133),5008(dscompsci),5012(dstech),6010(malnis) context=system_u:system_r:httpd_suexec_t:s0
      
      
      Environment: 
      SERVER_SIGNATURE=
      SSL_TLS_SNI=web.cs.dal.ca
      UNIQUE_ID=XV70n5ohfu68qhv7LOevTwAAAoo
      HTTP_USER_AGENT=CCBot/2.0 (https://commoncrawl.org/faq/)
      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
      HTTP_CONNECTION=Keep-Alive
      REMOTE_PORT=32988
      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
      HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.5
      DATE_GMT=
      HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
      DOCUMENT_URI=/~jamie/course/CS/4173/examples/SSI/test1.shtml
      DATE_LOCAL=
      REMOTE_ADDR=3.226.251.81
      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
      HTTP_ACCEPT_ENCODING=gzip
      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!