Creating a WWW directory
Introduction
If you've got a SUNet
ID and Stanford Unix account then you've probably got a pre-configured,
ready to use WWW directory in your home directory. But you might need to create
a different WWW directory outside your home directory, may have accidentally
deleted your WWW directory ... stuff happens. This page will provide you with
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. The Logging
in to Unix document tells you how to get there. If you're a little
Unix-phobic, relax ... these instructions presume no advanced knowledge
of Unix, and you can always refer to the Unix
Command Summary if you have questions. Here's what to do:
- Go to the directory that will hold your WWW directory
- Prepare the directory that will hold your WWW directory
- Prepare your WWW directory
- Protect your web pages?
Go to the directory that will hold your WWW directory
-
If you want to build a new WWW directory inside your home directory then you're right where you need to be because, 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. Unfamiliar with the "cd" command? Don't know how to move around AFS to find the directory you want? The Navigating AFS document gives you a hand.
Prepare the directory that will hold your WWW directory
-
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. The Are you allowed to set permissions? document tells you how to find out. If you don't have the necessary administrative permissions in your target directory you won't be allowed to make a WWW directory inside.
-
Affirm the directory's list permissions Make sure the directory you want has "list" permission. This lets the www.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:administrators rlidwka
system:anyuser l
yoursunetid rlidwkaIf "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, take a look at this quick review of file permissions.
-
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
-
Enter your WWW directory To get inside your WWW directory, type:
cd WWW
-
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:administrators rlidwka
system:anyuser l
yoursunetid rlidwkaYour 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:administrators rlidwka
system:www-servers rl
yoursunetid rlidwkaIf you have problems setting file permissions, or want to learn more about them, take a look at this quick Review of AFS file permissions. Otherwise, your WWW directory is ready for your web files. If you place files in your WWW directory but they don't seem to show up on the web, review these instructions (of course) or submit a HelpSU ticket.
Protect your pages?
Most people create web pages knowing they can be seen by anyone anywhere
on the world wide web. This is a good thing. On the other hand, 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 employ.


