Decommissioning AFS-based websites

Tags Web

There are some units — centers, departments, institutes, and programs — that have old AFS-based web sites. While technically not the responsibility of either the LSA Web Services Team or LSA IT, we've put together some instructions to help them decommission their old sites (for example, once they've transitioned to one of the LSA-supported web services). (Instructions on decommissioning webapps-based websites are also available.)

Identifying who can make changes

We usually don't have administrative access rights to the unit's AFS space. To identify who does, perform the following steps:

  1. Log into the login.itd.umich.edu login servers, or another AFS-capable Unix/Linux box.
  2. Change to the unit's HTML directory: cd ~unit/Public/html
    where unit is their URI component. For example, for IPCAA, the unit is ipcaa and the command would be cd ~ipcaa/Public/html.
  3. Determine what users or groups have permissions: fs la .
  4. In the resulting output, identify any users or groups with full permissions, rlidwka. See the OpenAFS documentation for details on what each permission letter stands for if you're so inclined.
  5. For each group identified in Step 4, determine its membership: pts mem groupname

One of the users — either with direct permissions from Step 4 or via a group from Step 5 — needs to be the one to make the changes. Alternatively, someone with administrative privileges (the "a" bit) can add you to a group with the pts adduser -user uniqname -group groupname command and then you can do the work.

Backing up the existing site

Before you make any changes, take a backup of the existing site by performing the following steps:

  1. Log into the login.itd.umich.edu login servers, or another AFS-capable Unix/Linux box.
  2. Change to the unit's Public directory: cd ~unit/Public
    where unit is their URI component.
  3. Back up the html directory: tar cf - html | gzip > html.yyyymmdd.tgz

You have backed up the html directory to a gzipped tar archive named html.yyyymmdd.tgz. If they have SSL-protected content, repeat this process for the ~unit/Private/html directory as well.

Determining what changes to make

The specifics of what to do becomes a political question, as it's a business decision: how much time and effort to take should be weighed against the benefits, costs, and risks of taking (or not taking) action. Advantages and disadvantages are in Table 1.

Table 1
Advantages and disadvantages

Action Advantages Disadvantages
Move the html directory aside. Trivial to do.
Takes no time.
Breaks all old search engine results and users' bookmarks.
Redirect the home page. Easy to do.
Takes little time.
Home page continues to work.
Breaks all old search engine results and users' bookmarks that aren't to the home page.
Redirect every page to the home page. Hard to do.
Takes some time.
Home page continues to work.
Other pages get redirected to home page.
Old search engine results and users' bookmarks get the home page instead of the expected page.
Redirect every page. Hardest to do.
Takes a lot of time.
All pages continue to work.
Old search engine results and users' bookmarks still work; users need to take no action.

Each option is discussed in the following sections.

Move the html directory aside

The most-trivial path for administrators, this provides the most inconvenience to the end users: All old search engine results and users' bookmarks will cease to function; users will receive 404/Not found errors. To move the html directory aside, perform the following steps:

  1. Log into the login.itd.umich.edu login servers, or another AFS-capable Unix/Linux box.
  2. Change to the unit's Public directory: cd ~unit/Public
    where unit is their URI component.
  3. Move the html directory aside: mv html html.old

You have moved the html directory aside.

Redirect the home page

The next most-trivial path for administrators, redirecting only the home page, is quick and easy and provides most users access without having to mess with search engine results or users' bookmarks. The drawback is that the old content for any and all other pages on the site remain available. To redirect the home page only, perform the following steps:

  1. Log into the login.itd.umich.edu login servers, or another AFS-capable Unix/Linux box.
  2. Change to the unit's html directory: cd ~unit/Public/html
    where unit is their URI component.
  3. Back up the old index.html file: mv index.html index.html.old
    It may be named index.htm or default.htm; if so, adjust the command in Step 4 similarly. If the index file is named something else (such as index.php), contact your programming staff.
  4. Replace the contents of index.html:
    cat > index.html <<EOF
    <HTML>
    <HEAD>
      <TITLE>unit Has Moved!</TITLE>
      <META HTTP-EQUIV="Refresh" CONTENT="time, URL=url">
    </HEAD>
    <BODY>
    <H1>unit Has Moved!</H1>
    <P>unit has moved. We are now at <a href="url">url</a>; please update your bookmarks.
    You will be automatically redirected there in the next time seconds.</P>
    </BODY>
    EOF
    

    where:

    time
    The number of seconds to wait before implementing the redirect. Use 0 for immediate. It appears twice: Once in the META tag and once in the P tag.
    unit
    The unit name. It appears 3 times: Once each in the TITLE tag, the H1 tag, and the P tag. Note that the version in the P tag might be spelled out, such as "The Interdepartmental Program in Classical Art and Archaeology" instead of "IPCAA."
    url
    The new URL. It appears 3 times: Once in the TITLE tag and twice in the P tag (one inside the anchor href and one as the anchor link text).

    In the first and last lines, the EOF are the literal three characters E, O, and F.

You have redirected the home page and only the home page. Unless you take other actions, all other pages remain accessible via the old URLs.

Redirect every page to the home page

Probably the most-balanced case, where every old page is redirected to the new home page, provides the benefit of all search engine results and users' bookmarks still getting to the new site and effectively blocking access to the old site, without a lot of administrative effort. Absent other information about the unit-specific IT or web staff, this is probably the best course of action. To redirect every page to the home page, perform the following steps:

  1. Log into the login.itd.umich.edu login servers, or another AFS-capable Unix/Linux box.
  2. Change to the unit's html directory: cd ~unit/Public/html
    where unit is their URI component.
  3. Back up the old index.html file: mv index.html index.html.old
    It may be named index.htm or default.htm; if so, adjust the command in Step 4 similarly. If the index file is named something else (such as index.php), contact your programming staff.
  4. Create a new temporary file with the desired HTML contents:
    cat > tempfile <<EOF
    <HTML>
    <HEAD>
      <TITLE>unit Has Moved!</TITLE>
      <META HTTP-EQUIV="Refresh" CONTENT="time, URL=url">
    </HEAD>
    <BODY>
    <H1>unit Has Moved!</H1>
    <P>unit has moved. We are now at <a href="url">url</a>; please update your bookmarks.
    You will be automatically redirected there in the next time seconds.</P>
    </BODY>
    EOF
    

    where:

    time
    The number of seconds to wait before implementing the redirect. Use 0 for immediate. It appears twice: Once in the META tag and once in the P tag.
    unit
    The unit name. It appears 3 times: Once each in the TITLE tag, the H1 tag, and the P tag. Note that the version in the P tag might be spelled out, such as "The Interdepartmental Program in Classical Art and Archaeology" instead of "IPCAA."
    url
    The new URL. It appears 3 times: Once in the TITLE tag and twice in the P tag (one inside the anchor href and one as the anchor link text).

    In the first and last lines, the EOF are the literal three characters E, O, and F.

    This is the same HTML content as in the "Redirect the Home Page" section.

  5. Find all files with an .html or .htm suffix and replace them: find . -name \*.html -o -name \*.htm -exec cp -p tempfile {} \;
  6. Remove the temporary file: rm tempfile

You have redirected every file with an .html or .htm suffix to the new home page. Note that files with other suffixes, such as .cgi or .php, are not affected.

Redirect every page to its unique page

The best case from the user's standpoint, where every old page is redirected to the corresponding new page, provides the benefit of all search engine results and users' bookmarks still getting to the new site, at the expense of a lot of administrative overhead. To redirect every old page to its corresponding new page, perform the following steps:

  1. Perform the procedure to redirect every page to the home page.
  2. Edit all of the HTML files: find . -name \*.html -o -name \*.htm -exec vi {} \;
    You can use your editor of choice instead of vi.
  3. In the editor, replace the URL, url, with the corresponding new page's URL, in all three places.
  4. Save your changes and exit the editor.
  5. Repeat Step 3 and Step 4 for all remaining HTML files from Step 2.

You have updated all of the old web pages to redirect them to their corresponding new pages. Note that files with other suffixes, such as .cgi or .php, are not affected.

Details

Article ID: 1723
Created
Wed 5/27/20 10:34 AM
Modified
Wed 8/12/20 6:16 AM