Serving up a WEB page.

So we have a page. What do we need to display it?

You need an account on a machine that runs a WEB server.

To be able to offer your text to the world consider this analogy.

You've written a paper, and a Cuban academic wants to get it. What do they have to do?

  1. They have to know of the papers existence.
  2. They have to know your address, so they can write you and request the paper.
  3. They need to know the name of the paper.
  4. There needs to be a request mechanism so that their request gets to you.
  5. There needs to be a answering mechanism so that you can serve the paper to them.

1. Existence is tricky, but your paper might be indexed somewhere, like the Science Citation Index.

2 and 3. Your address and the paper's name are included in the URL; think of it as three parts.

Part A is the http. This describes the protocol that will send the request and deliver the paper. This is the analog of whether you want the document delivered by FedEx, surface mail, faxing etc.

Part B is the which is the address of the machine on which the document resides.

Part C is the paper1.html which names the actual paper itself.

4 and 5. The sending of the request and answer is handled by the HTTP protocol.

Now we have the document that we want to make available there are certain actions that need to be taken. I'll describe the method for doing that on our unix machine, www-stat, on which you all need to have an account.

Every user account has a directory called public_html. When a request comes into the server, the server knows to go and look in the users public_html directory for the document (that's why you don't need to include ``public_html'' in the URL; it's included by the server by default).

To try and stay organized we'll create a sub-directory within the public_html directory.

Within the public_html directory we type

mkdir Stat540s99

Within this directory we create the HTML document. It's a good idea to have the document extension end in html or htm.

On a Unix system, who has access to which files, is governed by what are called the ``file permissions''. For an outside user to reach the file, the directory in which it resides must be executable by the world. To do this you use the command

chmod a+x Stat540s99.

Similarly the file must be readable by the world, which is accomplished by the command chmod a+r myfile.html.

Our system has been configured up to set these permissions by default. But if you create a file in a non-standard way (like via a program) you might well find that you have to set the permissions yourself.

That's it, we are now in a position to allow universal access to our document.

One thing to note. most WEB servers are configured to look for a default file within a directory, if no specific file is requested. For our server this file is called index.html. So if you create an index.html file you can access it by having the URL point to the directory which contains the file - you do not need to include the file name.

Richard Waterman
Thu Jan 14 23:42:10 EST 1999