Skip to content Skip to site navigation

Restoring a WWW Directory

Introduction

If you have a SUNet ID and a Stanford UNIX account then you probably have a pre-configured, ready to use WWW directory in your home directory. However, you may need to create a different WWW directory outside your home directory or may have accidentally deleted your WWW directory. This page provides step-by-step instructions for building a WWW directory from scratch.

You can do everything you need from the UNIX command line by connecting via SSH to cardinal.stanford.edu. See Logging into Shared UNIX Workstations for instructions. These instructions presume no advanced knowledge of UNIX, and you can always refer to the UNIX Command Summary if you have questions.

To build a WWW directory:

Go to the directory that will hold your WWW directory

  • Log in to Stanford UNIX.
  • If you want to build a new WWW directory inside your home directory, you're right where you need to be. Each time you log in you're automatically placed into your home directory by default.
  • If you want to create a WWW directory outside your home directory, use the "cd" command to move to the directory you want. If you are unfamiliar with the "cd" command or don't know how to move around AFS to find the directory you want, see Navigating AFS.

Prepare the directory that will hold your WWW directory

  1. Affirm your administrative permissions. Once you get to the directory you want, make sure that you actually have the ability to create a WWW subdirectory inside of it. See Are you allowed to set permissions? for more information. If yo u don't have the necessary administrative permissions in your target directory you won't be allowed to make a WWW directory inside.
  2. Affirm the directory's list permissions. Make sure the directory you want has "list" permission. This lets the web.stanford.edu server find whatever web pages you put inside the WWW subdirectory. Type:
    fs listacl .
    Don't forget the space and the period after "listacl". You should see something like the following:
    Access list for . is
    Normal rights:
    system:backup rl
    system:administrators rlidwka
    system:anyuser l
    yoursunetid rlidwka

    If "system:anyuser l" is there (the "l" stands for "list"), your directory is ready to go; proceed to Step 3. If "system:anyuser l" is not there, you must add it by typing:

    fs setacl . system:anyuser l
    Make certain it's there by typing:

    fs listacl .

    again, to see the access list. If you experience problems while setting file permissions, see Setting Permissions.
  3. Make a WWW directory. You're still inside your target directory so, to make the subdirectory that will hold your web pages, type:
    mkdir WWW
    This directory must be called WWW, all in caps.

Prepare your WWW directory

  1. Enter your WWW directory. To get inside your WWW directory, type:

    cd WWW

  2. Set new permissions. Subdirectories inherit the permissions of their parent directory. Check this by typing:

    fs listacl .

    You should see something like the following:

    Access list for . is
    Normal rights:
    system:backup rl
    system:administrators rlidwka
    system:anyuser l
    yoursunetid rlidwka

    Your WWW directory needs new permissions so that your web files can be read only by you and the web server. You must change "system:anyuser l" to "system:www-servers rl". While still within your WWW directory, type:

    fs setacl . system:www-servers rl

    and then type:

    fs setacl . system:anyuser none

    Check your work by typing:

    fs listacl .

    The permissions of your WWW directory should now be:

    Access list for . is
    Normal rights:
    system:backup rl
    system:administrators rlidwka
    system:www-servers rl
    yoursunetid rlidwka

    If you have problems setting file permissions, or want to learn more about them, see Setting Permissions. Otherwise, your WWW directory is ready for your web files. If you place files in your WWW directory but they don't appear on the web, review these instructions or submit a HelpSU request.

Protect your pages

Most people create web pages knowing they can be seen by anyone anywhere on the web. However, it's not uncommon to want only certain people to see certain pages, depending on their content.

There are several ways to restrict access to your web pages. You can set file permissions on the web files in your WWW directories, in order to govern which people can make changes to your web files, but to actually deny or allow access to your pages on the web you'll want to learn about:

WebAuth
To allow only Stanford people (all Stanford people, or just particular Stanford people, etc.) to see your web pages, you'll need to use WebAuth. This is the most often used method for protecting your pages at Stanford.
 
User Authentication
If you want to allow only non-Stanford people (or some combination of Stanford and non-Stanford people) to see your pages, this is the method you'll use.
Last modified April 12, 2023