7. WWW Issues

7.1. How to do I setup a WWW page?

A directory called public_html was created in your home directory when your EngSoc account was created. Any files in this directory will be accessible via the web at: http://www.engsoc.org/~username/filename.extension

So, to start, you should edit the index.shtml file that is in your public_html directory by default.

It is a good idea to put a file called index.html (or .shtml) in each directory as the main page. That page will be the one loaded by default if no filename is specified. For example, http://www.engsoc.org/~username will call up ~username/public_html/index.html.

To upload files to your home directory you need to use SCP. WinSCP is an easy to use Windows program for SCP and there are links to download it from here. If you use the Cygwin package, it includes a command-line SCP client.

7.2. What is a WWW proxy, and how do I use EngSoc's? How about an FTP proxy?

A WWW proxy is a machine configured to forward HTTP requests for web documents and retrieve them from the internet on behalf of your web browser.

Using a WWW proxy will often improve the performance of your web browser, as frequently accessed web pages will be cached (i.e. stored on the proxy server) and can be sent to you without having to be fetched from the internet. Using a WWW proxy will also increase your security and privacy, as it prevents web servers from obtaining your real IP address or identity.

The instructions below describe how to configure your browser to use a web proxy, however neither Carleton nor EngSoc currently operate a proxy for you to use. For Netscape Navigator 2.0x/3.0x:

  • Go to Options->Network Preferences->Proxies->Manual Proxy Configuration.
  • Click "View" and enter the same data as above.
For Netscape Navigator 4.0 (a.k.a. Netscape Communicator):
  • Go to Edit->Preferences->Advanced->Proxies->Manual Proxy Configuration
  • Click "View" and enter the same data as above.
For Mozilla Firefox:
  • Go to Tools->Options and under the General section, click the Connection Settings button
  • Click on the 'Manual proxy configuration' radio button
  • Enter the hostname and port for your HTTP proxy in the space provided
  • Click OK in the 'Connection Settings' dialog and OK again in the 'Options' dialog
For Microsoft Internet Explorer 3.0x:
  • Go to View->Options->Connection
  • Check the box named "Connect to the Internet through a proxy server"
  • Click on "Change proxy settings" and enter the data as above.
For Microsoft Internet Explorer 5.x:
  • Go to Tools->Internet Options...
  • Click the Connections tab
  • Click LAN Settings...
  • Check the checkbox "Use a proxy server..."
  • Enter the address and port

You can use http-proxy.carleton.ca:8080 as an FTP proxy as well.

7.3. What is CGI? How do I use it on EngSoc? How do I write CGIs?

CGI stands for Common Gateway Interface. It's a way for programs to send and receive data over the web. CGIs are programs that run on a web server, used to provide dynamic content or process user feedback. Access counters, bulletin boards, feedback forms, and search engines are all examples of applications which can be implemented on the web using CGI.

On EngSoc, any file in your public_html directory with a .cgi extension will be executed by the web server when accessed. Even if it is a Perl script, it must be .cgi. You must also make it executable for yourself, since web scripts are run under the UID of the owner. "chmod 755 filename" will do this.

The following is an example CGI written in perl:


  print "Content-type: text/plain\n\n";

  print "<b>Hello</b> World!\n"

  my $true = 1;


To run this script, save it in a file that ends in .cgi, like 'foo.cgi' and make sure that file is in your public_html directory. Then make the file executable:

  chmod +x foo.cgi

Notice that the first thing that the script does is print what's called a MIME type for the page. All that does is tell your browser to display the rest of the output as plain text.

CGIs can be written in any programming language that will work on EngSoc's web server. Currently perl, python, tcl and shell scripts are known to work. Documentation for the Common Gateway Interface (CGI) is available on the web at http://hoohoo.ncsa.uiuc.edu/ and is beyond the scope of this FAQ.

7.4. How do I put a counter on my webpage?

There are many ways to implement a counter for a particular webpage. The easiest way works with Server-Side Includes which means your page must have the filename extension '.shtml'.

In your .shtml file, insert a URL-path to the counter.pl CGI script as an SSI exec statement. It will look something like this:

  <!--#exec cgi="../cgi/counter.pl" -->
You may have to add in some more dots to that URL depending on where your page sits relative to http://www.engsoc.org/cgi. If the above doesn't work, try:
  <!--#exec cgi="../../cgi/counter.pl" -->

7.5. What are Server Side Includes?

Server Side Includes (SSI) are a way to include dynamically generated information in your web pages. This is a feature of Apache, the webserver software we use, and to take advantage of SSI your pages must end in the .shtml extension.

If you create a file with a .shtml extension and add a line in it that looks like:

   This page last modified: <!--#echo var="LAST_MODIFIED"-->
You should see something like:
   This page last modified: Monday, 26-Apr-2004 15:05:48 EDT

This is only a very simple example of what you can do with SSI. For more information see http://httpd.apache.org/docs/mod/mod_include.html

7.6. What is PHP?

PHP is a popular web site scripting language. It is used to generate dynamic web pages, process forms, access databases and all sorts of other things. It can replace CGI scripts written in perl and pages that use SSI.

To display when a file was last modified, as in the SSI example above, using PHP, you would use the following code in your page:

   print("This page last modified: ");
   print(date("l, j-M-Y H:i:s T",filemtime("7.php")));

The brackets and question marks are required and tell the webserver where the PHP functions start and the plain HTML end. This doesn't even scratch the surface of what you can do with PHP. For more information see http://www.php.net.