Using Server Side Includes with Your Folder
This document is not intended to be a tutorial on Server Side Includes. For information on how to write and use SSI, please, visit the the Apache2 SSI documentation pages at http://httpd.apache.org/docs/2.0/howto/ssi.html for a brief tutorial and links to other reference material.
Server Side Includes are script commands that can be included as part of the content of a web page, that will be interpreted and executed by the web server software and from which visual output can be sent to the client (Web Browser) as part of the page. Some simple examples of things that can be done with SSI include displaying the current date and time on a web page, displaying the users IP Address on a web page and incrementing a page hit counter. Use of SSI requires that you be somewhat familiar with Nix shell scripting. I do not recommend attempting to use SSI unless you are a second year Computer Science student or are already familiar with and have access to a version of Linux or Unix.
Server Side Includes as implemented on the area42 web server are using the xBitHack activation mechanism. Before a page using SSI can be tested or properly viewed from the server it must have its execute bit for others set. To do this you must start a remote console session with the server using ssh. (The Nix Secure Socket Layer Remote Terminal program) After connecting to your account on the server you should change directories to the folder containing your page that needs to be made executable. Then enter the command: chmod 755 ssiPage.htm where ssiPage.htm is the name of your page. Realize, the chmod command supports globing if you need to change permissions of multiple files. Note: SSH is now blocked from off campus due to firewall changes. Your file permission changes must be made from on campus!
If you decide to use the provided SSI capability, you will find it useful to know what environment variables are available to you. To discover this information create a web page containing the following lines in its body:
<pre>
<!--#exec cmd="set" -->
</pre>
This will present you with a list of all available environment variables and their current contents. You also have access to a large number of bash commands intended for use by normal user accounts. Testing in a similar fashion will help you determine what commands are available.
Note: The execute bits of a file do not need to be reset after it has been overwritten via FTP.
Hope this is enough to get you started,
JimD
|