Updating ESPL and LVS Web Pages


by David Harding and Brian Evans


This document contains important information to help get you started in modifying ESPL and LVS Web pages. This document is organized into three sections:

  1. The http documents directory structure.
  2. Changing your files under RCS.
  3. Adding to your web page: Examples

The first section describes how files are layed out in our directory that contains the master copy of the Web pages:

The first section will provide a better understanding of what you might need to change to get your pages to look the way you want them to. It will also help clarify the makefiles that install pages from the working copy to the web server's directory.

The second section gives a step-by-step guide to editing a text file under RCS. It also includes the contents of a couple of script files that I use to save keystrokes when I'm editing under RCS. This stuff was hard for me to get used to, but once you see how it works a couple of times it's certainly not difficult.

The third section describes the process for making modifications to your Web pages and installing those modifications. It contains two examples: changing the link from the ESPL/LVS page to your main page. For LVS users, it also includes information on adding a subdirectory under your user directory. Adding a subdirectory is probably the most complicated thing you might want to do, and probably isn't necessary for most people. However, if you plan on having a really elaborate web presence, then you might need subdirectories to keep everything organized.



[ Top | Directory Structure | RCS | Examples ]





The HTTP Documents Directory Structure



As mentioned above, the http documents for the labs are kept in

In this directory you will find the top level Makefile, the index.html file, which is the entry point to the lab's web pages, and install.mk, which is a make include file.

In addition to these files, the LVS directory structure contains the following subdirectories:

If you take a look at the Makefile for both ESPL and LVS, you will see that it contains four important things: a target directory to install into, a list of subdirectories to recursively install, a list of files in this directory to install, and the line that includes the install.mk file. The install.mk file contains the rules for installing documents to the target directory, and it will never need to be edited. The Makefile, on the other hand, will need to be updated any time a new file or subdirectory is added to the directory in which it exists.

Since the members directory is the one that most everyone in LVS will be concerned with, and because it is the most complex, we will consider its structure next. In the members directory, everyone has a subdirectory where their pages will reside. The only file in this directory is the Makefile. It is very similar in content to the top level Makefile described above. The only differences are that it doesn't list any files to install (since there aren't any), the relative path to install.mk is slightly different, and the target directory is given relative to the directory in the top level Makefile. Since this file already lists everyone's subdirectory, it will not need to be modified until new users are added.

Continuing down the directory tree, we enter a particular user's directory. Each user has a Makefile and an RCS subdirectory in their directory, along with any other files he may need for his web page. The Makefile must list every file that the user wants to be visible from the web. This is because if it's not listed in the Makefile, then it won't be installed in the protected web server directories.

To summarize the installation process, when you type make install in the directory with the top level Makefile in it, the Makefile installs all of the listed files to the target location at the web server directories, then calls the Makefile in each of its listed subdirectories. The Makefile in each subdirectory does the same, and thus, every file that has been changed or added since the last make install will be copied to its correct location.



[ Top | Directory Structure | RCS | Examples ]





Changing Your Files Under RCS



Changing any text file under Revision Control System (RCS) is a four step process:

  1. Check out a copy of the file and place a lock on it. Do this by using

    > co -l filename

  2. Edit the file with your favorite text editor.
  3. Check in the file to record the changes in RCS. Do this with

    > ci filename

  4. Check out a copy of the file so there is a read-only copy in the directory. Do this with

    > co filename


It's best to try to get all your editing done at once, rather than incrementally, since each time you want to edit a file, you have to go through all four steps.

Since the first two steps and the last two steps almost always happen together, I wrote a couple of scripts to speed things up. Here's the script that performs the first two steps:

#! /bin/sh
#
#  ~/bin/covi
#
#  This script is for checking out a copy of a file under RCS and vi'ing it
#
#

if  test -z "$1"
then 
  echo "USAGE:  "
  echo "$0  filename_to_checkout_and_edit"
  exit
else 
  if /usr/local/gnu/bin/co -l $1 
  then 
    vi $1
  else 
    echo co FAILED
  fi
fi


And here is a script that combines the last two steps:

#! /bin/sh
#  
#  ~/bin/cico
#
#  This script is for checking in your copy of a file to RCS and 
#  co'ing a read only copy
#
#

if  test -z "$1"
then 
  echo "USAGE:  "
  echo "$0 file_to_checkin_and_checkout"
  exit
else 
  if /usr/local/gnu/bin/ci $1 
  then 
    /usr/local/gnu/bin/co $1 
  else 
    echo ci FAILED
  fi
fi


If you put these in one of your directories in your path and make sure they're executable, you can save yourself a lot of unnecessary typing.



[ Top | Directory Structure | RCS | Examples ]





Adding to Your Web Page: Examples



This section is just a quick walk-through of two things you might want to do when working on your web page. The first is simply changing the file linked to your name on the ESPL or LVS page. The second is adding a subdirectory under your directory in members. This second example is primarily to illustrate how to set up the makefiles. If you need a subdirectory in your members directory, your page is probably too complicated. This section assumes that you have read the previous sections and you know HTML.


Changing Your Main Page


Suppose you want to change your main page from user_old.html to user.html. There are four things that you have to do:

  1. Ensure that user.html is under RCS by checking it in and back out again.
  2. Add user.html to the documents to be installed in the Makefile in your members/user subdirectory. You should probably remove user_old.html from the list. Remember that the Makefile, along with all the other files you will be editing, is under RCS control.
  3. In the top-level directory, edit index.html so that your link points to members/user/user.html.
  4. Execute make install in the top-level directory to install the changes at the web site.



Adding a Subdirectory to Your Directory


Suppose you need a subdirectory under your members/user directory to keep additional HTML files separate from your main pages. What follows are the steps you would need to take. Remember, any time the step requires you to change a file, you must go through the procedure described in Changing Your Files Under RCS.

  1. Create the subdirectory. Say members/user/sdir.
  2. Make another subdirectory called members/user/sdir/RCS and copy the files you want to sdir.
  3. Use the chmod command to ensure that the RCS directory is writable by the group.
  4. If the text files that are now in sdir were previously in RCS, you can move their associated RCS files to sdir/RCS, otherwise, check all the text files into and back out of RCS.
  5. Copy the makefile down from members/user to sdir, and make the following modifications:
  6. In the makefile for members/user make sure sdir is listed as a subdirectory to be installed.
  7. If you have moved files out of members/user make sure they are not in the members/user/Makefile or members/user/RCS.
  8. Once all your changes are done, contact someone with root access to create an empty directory called members/user/sdir in the actual web server directory.
  9. Execute make install in the top-level directory to install the changes at the web site.



That ought to get you going. If you think about why the above procedures work, you should be able to figure out how to do just about anything you want to do. If you have any questions or suggestions, feel free to email me (dave@vision).



[ Top | Directory Structure | RCS | Examples ]