Computer Laboratory

Personal web pages

If you have an account on a machine in cl.cam.ac.uk you can export personal files to the World Wide Web.

Static web pages

The HTML pages and any other files you wish to export should be placed in a directory called public_html in your superhome directory. By default this will be set up to be a symbolic link to public_html in your Unix home directory. In other words, Unix users can place files for the web server into

    ~/public_html/

after creating that directory.

If you use Windows, you can access your Unix home directory at

    \\filer\userfiles\your-login-name\unix_home

Alternatively, you may prefer to put the public_html folder directly into the superhome itself.

The files and all directories leading to them must be publicly readable, which implies that you cannot use the default setup if your home directory has been protected against public read access.

You can then publish URLs of the form:

    http://www.cl.cam.ac.uk/~your-login-name/file.html

(or replace '~your-login-name' with 'users/your-login-name') to refer to the file that you call public_html/file.html. Subdirectories will work as expected. A URL of the form

    http://www.cl.cam.ac.uk/~your-login-name/

will automatically pick up a file called index.html, so it is a good idea to have such a file to index your other pages. If no such file exists, then the server will invent an index based on what it finds, but this is unlikely to be as helpful as something you write yourself.

You must be careful about what you export. Anything you place in your public_html directory is quite literally world readable (although there are access controls available). Do not export copyrighted material without permission of the copyright holder. Do not export things which may be considered offensive. Do not expose to world view information which may compromise the security of the Lab's system.

An explicit restriction is that you should not set up links from your public_html area to files that you do not own. For technical reasons we do not enforce this rule at present, but reserve the right to do so in the future.

The personal public_html directory is best reserved for material which is genuinely personal, such as your CV. Do remember that these pages will disappear when you leave the Computer Laboratory (though we will be willing to set up a redirection to your new server).

If you find yourself setting up something relating to a research group, or a more general area of interest, you should think again, and ask pagemaster whether it would be more appropriate to set up an area specifically for that purpose.

If you set up a public_html/index.html file, a link to it will automatically be created in the list of members of the department when the page is next regenerated (usually overnight).

If you do not want to host your home page on your normal Computer Laboratory home directory, but you still want it to be accessable from the people page, then create an empty file public_html/index.html (to cause a link to be created on the people page) and also create a file public_html/.htaccess containing the line Redirect /~your-login-name http://your.home.page.url

When you leave the department and you are about to lose your login, send your preferred Redirect /~your-login-name http://your.new.home.page.url directive to webmaster@cl (and your email forwarding address to postmaster@cl), who will preserve it in a main config file.

Dynamic web pages

For reasons of performance, reliability and security, our main web server www.cl.cam.ac.uk does not execute user-provided code (CGI, PHP, SSI, etc.) on personal pages.

HTTP gateway

If you run a web server on your own machine in the Computer Laboratory, where you can enable dynamic pages, it will usually not be reachable from the outside world, because our firewall blocks most incoming connections by default. It is possible, however, to use our main web server www.cl.cam.ac.uk as a gateway (“reverse proxy”) to your own web server, using a .htaccess file that uses the RewriteRule directive with option P, as explained in the Apache 2.2 mod_rewrite documentation. This allows web pages served by your own web server to be accessed by an outside user with a URL starting with http(s)://www.cl.cam.ac.uk/.

www-dyn service

We operate – currently on an experimental basis – additional departmental web servers that have CGI and PHP execution enabled. To use this facility, create a directory

  /auto/userfiles/$USER/dynamic_html/public_html/

which will then become visible (this may initially take an hour) on the web as

  http://www-dyn.cl.cam.ac.uk/~$USER/

and on the www-dyn servers as

  /home/$USER/public_html/

Any CGI or PHP scripts placed there will be executed on the respective server under the user’s credentials. The script files must be writable only by the owner; in particular having the files group writable will lead to an "internal server error". When running, the scripts have read/write access to the contents of /auto/userfiles/*/dynamic_html/, but they have no access to most of the remaining departmental filespace (because the art of writing secure CGI or PHP is a notoriously rare skill).

Files in /auto/userfiles/$USER/dynamic_html/ other than those in public_html/ will not be directly visible via the web interface, but note that any user can expose them by creating a symbolic link in their dynamic_html home directory to /home/$USER/ so do not assume that they are "secret".

The service is actually provided by a number of hosts with names of the form www-dynN, e.g. www-dyn2.cl.cam.ac.uk. To reduce the chance of systematic failure, the hosts use different operating system version; at the time of writing www-dyn1 is Fedora Core 6 and www-dyn2 and www-dyn3 are Fedora 9, but note that the number of machines, their names and their operating system may change. Please try your code on all servers, and if it does not run correctly on all, please contact webmaster.

Some further technical details and helpful hints will be found on this wiki page.

MySQL service

There is – also on an experimental basis – a departmental MySQL database management system service available that can be used to provide persistant storage to web applications.

The address mysql-serv.cl.cam.ac.uk will access one of the two server replicas mysql-serv0 or mysql-serv1. Ask sys-admin for a database user account of the form "$USER_$APPLICATION" and an associated password).

A comfortable database management user interface is available at: https://www-dyn2.cl.cam.ac.uk/phpMyAdmin/

Other local hosting services

Several other organizations within the University host web pages or applications for any University member, or offer ready-to-use content management systems: