Hosting your course's web page at the CDF

As a course instructor, you have several options for hosting your course's web page:

  1. In your home directory
  2. In the course's home directory
  3. In the auxiliary account's home directory
The following table summarises the difference in these three methods.

  Your home directory Course home directory Auxiliary account
Static content Yes Yes Yes
SSI (Server Side Includes), file inclusion By request Yes Yes
CGI scripts By request No Yes
Need to edit files as different user No No Yes
 

1. Hosting in your home directory

Every CDF user can host static contents in his home directory. Any files and directories, created in the directory public_html will be served by the CDF's main web server. So, for example, if an instructor whose CDF login name is bob creates a directory ~/public_html/csc555h, it will be available at the following URL: http://www.cdf.toronto.edu/~bob/csc555h/.

This is the simplest way of hosting your course's web page. You don't need to leave your home directory or to manage the files. SSI (Server Side Includes) can be enabled for the instructor on request (only for file inclusion, but not command execution). CGI scripts can also be enabled for this method. If you want SSI or CGI enabled for your CDF account, please contact admin@cdf.toronto.edu.

 

2. Hosting in the course's home directory

Each course has a home directory at the CDF. Among various functions of the course home directories is web space for hosting the course's web page. Inside each course's home directory, are three sub-directories: fall, winter, and summer (named after the official term names at the UofT). In each of these directories, there is a directory named public_html, which can be used for publishing the web page. So, given a course CSC555H, the files for the winter term can be published by placing them in the directory ~csc555h/winter/public_html, and they will be served from the following URL: http://www.cdf.toronto.edu/~csc555h/winter/.

Publishing the course web page in this way allows for URLs that do not contain the instructor's CDF user name. This method allows for easy collaboration on the published contents between the instructors and the TAs, since the public_html directory is writable to all current course instructors and the TAs. SSI are enabled for this method by default (for files inclusion only).

 

3. Hosting in the auxiliary account's home directory

The CDF is currently testing and finalising an alternative method of hosting the web page, using the so-called auxiliary accounts. This method allows for serving both static contents, as well ass SSI and CGI; collaboration between several instructors and TAs is also possible by means of shell access to an special account. Since this method is currently a work in progress, it will be documented later. If you are interested in helping us test this method, please email admin@cdf.toronto.edu.

File and Directory Permissions

One of the most common problems with setting up a web page is getting the file and directory permissions right. The important thing to understand is that the directories should be browsable, and the files should be readable to the web server process, which runs as another user. This means that the directories should have minimal permission of execute for the world (i.e. o+x), and the files --- read for the world (i.e. o+r). This includes your home directory itself.

For example, to publish a web page in your own home directory, go through the following steps.

  cd ~
  mkdir public_html
  chmod o+x . public_html
  echo Test > public_html/index.html
  chmod o+r public_html/index.html
Now you should be able to access your newly created web site. Enter the following in your browser's Location field: http://www.cdf.toronto.edu/~username/, substituting username for your CDF user name. You should see a blank page with the word Test at the top.

How to make a link for your course web page

There is a page with links to the current course web pages. Follow this link to see it. The links on that page are updated using this page.

If You Run Into Problems

If you are having problems setting your course's web page at the CDF, don't hesitate to email admin@cdf.toronto.edu and one of the system administrators will give you a hand.