[Previous] [Next] [Up] [Top] [Search] [Index]

Appendix E: Creating a Homepage -- a Document for Users


This document is for the ordinary user, not the system "webmaster". It is intended as a short description of how to use the WN Web server to set up your home page (and related documents if you wish). It is not a primer on writing HTML, there are many of those -- some are listed below. Instead it deals with what to do with a homepage document after it is created to put it "on the Web." We assume that your system administrator has already set up the WN server in such a way that users are permitted to have homepages in their own directories. If that isn't the case you will have to persuade your local administrator to do so or read the full WN User's Guide to learn how to do it yourself.

But let's be optimistic and suppose everything is set up and working properly. If you haven't created a home page here is a bare bones one you can copy to expand on later:

<head>
<title>John Doe's Homepage</title>
</head>
<body>
<h1>John Doe's Homepage</h1>

This is the story of my life and manifold accomplishments...

</body>
[Note: To find out more about composing HTML documents consult A Beginner's Guide to HTML (at http://www.ncsa.uiuc.edu/demoweb/html-primer.html) or see Creating Net Sites (at http://home.netscape.com/home/how-to-create-web-services.html).]

Your home page and any other files you want to serve must be located in a particular subdirectory of your home directory (your home directory is where you are when you first login) on the UNIX system which is running the WN server. Usually this subdirectory is called public_html, but your system webmaster may have chosen something different. We'll assume the name is public_html.

It probably doesn't yet exist in your home directory. If not create it with the command

mkdir public_html<ret>

The public_html directory also must have the correct "permissions" so that the server can look inside it. For security reasons the WN server isn't very powerful and it can only access files and directories which are not heavily protected. Just to make sure the server won't have trouble accessing your homepage run the command

chmod 755 public_html<ret>

You must place a copy of your homepage in this directory and give it the name index.html. One way to do this is enter the public_html directory and use an editor to create the homepage file there with the name index.html. Alternatively, you could create it elsewhere and copy it to the public_html directory. If you need to rename it the proper UNIX command is "mv oldname newname".

Of course the server must also be able to read your homepage in order to serve it. If documents you create are automatically protected from viewing by others you will have to change that for your homepage. The command

chmod 644 index.html<ret>
gives anyone (including the server) permission to read but not change your homepage.

There is one more step before your homepage is available to the world. The WN server is very security conscious. It is much more careful about refusing to serve documents which users did not intend to be served. This means that in addition to serving only documents in designated directories (such as your "public_html") it will only serve documents which have been explicitly designated for serving in some way. Here are two different ways to grant the server permission to serve your homepage. You only need to do one of these.

A Lazy Way
Create a file in the public_html directory named index which contains the line
Attribute=serveall
Then execute the command
wndex
which will create the file "index.cache". It grants the server permission to serve anything in this directory. If you put documents to be served in subdirectories of public_html, copy the file index to them also and rerun wndex in these subdirectories to grant permission to serve anything from them (actually the file "index" itself is excluded from being served as are files beginning with the '.' character).

A Better Way
Create a file in the public_html directory named index which contains the line
File=index.html
If you have other files you want to serve add additional lines like "File=foo.html" where foo.html is the name of the file you want to serve. Then execute the command
wndex
Files which are HTML files should have names which end with the suffix ".html". Files which are ASCII text files should end with ".txt" and GIF image files should end with ".gif". Executing the "wndex" (pronounced "windex") command will create the file "index.cache" as before, but now the server will only have permission to serve those files whose names are listed explicitly in your index file.

If you put documents to be served in subdirectories of public_html, you must create an index file in each of them also which lists the files which can be served.

The "better way", in addition to providing better security, also enables many of the advanced features of the WN server, such as searching capabilities. In the long run if you serve multiple documents you will probably want to use it. The trade off is that the "lazy" way is easier since it only needs to be done once, while the "better" way requires that you edit the index file and rerun "wndex" each time you add a new file to public_html to be served.

What's your URL?

So once your homepage is functional, how do you access it? Well, your webpage address (called a URL which stands for "Uniform Resource Locator") is made up from the name of your host and your user name. For example, if your user name is jdoe and the computer on which the server is running is named www.school.edu then the URL for your homepage is probably
http://www.school.edu/~jdoe/
The "probably" refers to the fact that there are many possible variations which may have been chosen by your webmaster. For example, some people don't like the '~' character in URL's so they might use http://www.school.edu/homepages/jdoe/. In any case there are a couple of things to notice about your URL.

First it has a synonym

http://www.school.edu/~jdoe/index.html
This is because whenever a URL ends in '/' the server knows it is referring to a directory (in this case your public_html directory) and looks for the default file "index.html" in that directory. Thus if you want to put some files in subdirectories of public_html that is fine. But keep in mind that if you create the directory "mydir" in public_html then http://www.school.edu/~jdoe/mydir/ will really refer to http://www.school.edu/~jdoe/mydir/index.html and to refer to a file "foo.gif" in mydir you should use http://www.school.edu/~jdoe/mydir/foo.gif. You should not use the URL http://www.school.edu/~jdoe/mydir referring to a directory but with no '/' at the end.

Advanced Features

There are many advanced features you can use with the WN server. To learn to use them you will need to read parts of the manual designed for system administrators. A good place to start is the overview chapter of this manual. It will give you a good idea of some of the things the server can do. Then you will likely also want to consult the chapter on index files. Neither of these chapters is too long.


John Franks <john@math.nwu.edu>
[Previous] [Next] [Up] [Top] [Search] [Index]