Making and maintaining a web page

Here are instructions on how to set up a web page (aka home page) on cattell. Once you have followed these instrunctions, you can have a link set from the Psychology web page to your web page, if you want, by sending an email to Jon Baron (username 'baron').

Where the page goes

Your main webpage is a file called "index.html". You need to make this, if you haven't already. It needs to be in the subdirectory "public_html" of your home directory and to be accessible by everyone

At the cattell prompt, use

cd
to make sure you're in your home directory. Next, enter
mkdir public_html
to create the subdirectory (if it doesn't exist yet), and then use
chmod u+rwx public_html
chmod a+rx public_html
to make it accessible to everyone and writable by you.

If you are not sure that your home directory is also accessible, say:

cd ..
chmod o+x ~username
cd
where "username" is your username. This will allow people to read files in your home directory that are unprotected, if they know the names of these files. (The first command assumes that you are in your home directory. The third gets you back to it.)

Making the page

If you don't yet have index.html, go to the subdirectory "public_html" using
cd public_html
and with your editor create the file index.html and put it in it the various html commands you want. Here is a good introduction.

However, most people find it easier to modify someone else's home page file. To do this, first use your browser to find a home page you like, save it somewhere using "File/Save_As", then move it to your /public_html/ directory. To do this, you will have to upload it unless it is already on cattell.

Note that "index.html" and any other files in public_html that you want people to access must be world readable. This can be ensured by using

chmod a+r filename
with "filename" replaced by actual file names, from your public_html directory. The second section of /pkg/psych/etc/httpd/htdocs/Readme contains more information about web file permissions which you may find useful. You can access this file by using
more /pkg/psych/etc/httpd/htdocs/Readme
at the cattell prompt.

You can put html files in a subdirectory of public_html. If you do so, the directory needs to be accessible to everyone, just as public_html, and the reference to these files need to include the subdirectory name. For example,

<a href = "http://www.psych.upenn.edu/~username/file1.html"></a>

with "username" replaced by your username, references file1.html in the sudirectory dir1 of public_html, whereas

<a href = "http://www.psych.upenn.edu/~username/dir1/file1.html"></a>

references file1.html in your public_html directory.

Controlling access

You can control access to an html directory by creating a file .htaccess in the directory and putting appropriate instructions in it. The instructions can be used to specify a file with the names of authorized users, and the kind of authorization to use. They can also be used to specify site or domain names to authorize or deny access from. There is a tutorial at http://hoohoo.ncsa.uiuc.edu/docs/tutorials/ that provides instructions and examples on this. You can put the directory with restricted access as a subdirectory of your public_html. Make the subdirectory and all other files in the subdirectory world accessible (otherwise the web server won't be able to access them). That is cd to the directory and type:
chmod 644 *

In particular, to set up passwords, you need to create a file called ".htaccess" in the directory containing the html file for the restricted page. Note that all files in this directory will be protected. So, if you only want to protect one html file, put it in its own directory.

One simple way to set up password access for anyone from Penn (i.e., anyone with a PennNet password) is to put a single word in the .htaccess file: AuthPennNet. For example, you could do this with the single command:

echo "AuthPennNet" > .htaccess

while you are in the directory you want to protect. This will allow anyone who can provide a valid pennkey and pennkey password to access pages in that directory. If you would like to restrict the page to particular pennkeys, add the line:

AuthZPennNetUsersFile .auth_file

and then create a .auth_file with one pennkey per line.

To allow anyone from upenn.edu to access the site (with outsiders still having to log in), add the line:
AuthPennNetDomainOverride .upenn.edu

More generally, and for more details, see this page.

Of course, these files must be readable, so you could say something like chmod 644 .htaccess to make sure.

For other ways of setting up passwords, you will need to enter some information in the .htaccess file and use the 'htpasswd' command to encrypt the password. This is described for mail.sas in http://www.sas.upenn.edu/computing/help/WWW/htaccess.html. To apply these directions on Cattell, note that your html directory will be something like /home/username/public_html/ rather than /home3/u/user/html. Step 4 is chmod 644 *.

Controlling access to BlackBoard pages

It is a good idea to make a subset of your course material available to anyone, so that prospective students can find out about your course. Here is how:

1. Log into your course web site at https://courseweb.library.upenn.edu.

2. Go to the Control Panel for your course and click on Manage Tools and then Enable Blackboard tools. On the page that comes up check the "Allow Guest" box for those areas of the course that you want to make accessible. The appropriate ones are "Content Area" and "Staff Information". Once you have done this click submit at the bottom of the page.

3. Now return to the Course Control Panel and click on the Manage Course Menu. Click the "modify" button next to the "Course Information" page. Once on that page, put check marks in the boxes next to "Allow Guest Access" and "Allow Observer Access". Repeat this process for the "Staff Information" page and any other areas that you want to give access to. DO NOT do this for those areas of the site that contain copyrighted materials.

4. Return to the Course Control Panel and under "Course Options", you will see an alternative called "Settings" Click on that. Then click on "Guest Access" and make sure the "allow guest" box is checked. Later in the list you will find "Observer Access". Click on that and make sure that the "allow observers" box is checked. Be sure to click submit after doing each of these.

Once this is done, you do not need to redo it each time you reteach the course. If you copy the course site for use in a subsequent term, these settings will be preserved.


Comments to baron@psych.upenn.edu