|
UNIX
for Web Designers
- Introduction
- An
Itty-Bitty Background on UNIX
- Why
Bother Knowing Something about UNIX?
- Things
to Remember
- Directory
Structure
- Getting
Started
- Exploring
the Directory Structure
- Shortcuts
- File
Management
- Permissions
- Departmental
Web Sites
- Appendix
A: Web Troubleshooting Flowchart
- Appendix
B: Solutions to Case Studies and Challenge Exercises
- Appendix
C: Cleaning up After Class
Intro
Welcome
to UNIX for Web Designers! This course is designed to provide
an easy, hands-on introduction to using the UNIX operating system
to manage Web sites and troubleshoot common errors you may encounter
in maintaining Web sites.
Upon
successful completion of this course, you will be able to do the following:
-
Navigate within the directory structure of the UNIX environment
-
Implement file management in UNIX
-
View and modify file and directory permissions
-
Implement troubleshooting techniques to solve real world Web problems
The following
is a key to help you understand the formatting. If the text is
in:
Bold
= text to type
CAPS = key on keyboard
Note! = additional note for further
understanding
An
Itty-Bitty Background on UNIX
UNIX
is an operating system that is distinguished for its performance,
reliability, and security in a networked environment. Scientists,
researchers, and engineers commonly use UNIX because of its high-performance
capabilities and its ability to be customized. At the University
of Virginia, UNIX is widely used to access Internet resources, such
as e-mail and file storage
In 1969,
Ken Thompson of AT&T Bell Labs wrote the first version of what
was to be called UNIX. Over the past thirty years UNIX has been modified,
tweaked, and reworked for optimum performance in various environments.
As a result, the term “UNIX” in actuality refers to a family of operating
systems (often referred to as “flavors” of UNIX) that includes AIX,
BSDI, Digital UNIX, FreeBSD, HP-UX, IRIX, Linux, MACH, NetBSD, OpenBSD,
Pyramid, SCO, Solaris, and SunOS.
Perhaps
the most notable feature of the UNIX interface is that it is text-based,
as opposed to such popular Graphical User Interface (GUI) operating
systems as Windows 95/98/NT and Macintosh OS/8. (Note:
Windowing Tools may be used with many flavors of UNIX to achieve a
GUI.) UNIX uses “terse” command statements, such as mv (move) and
chmod (change mode) to accomplish tasks. UNIX also limits the
amount of output to the screen; the feedback that you receive
from the operating system is rarely more than one line of text.
As a result, UNIX can be somewhat daunting at first.
Why
Bother Knowing Something about UNIX?
Many problems
can and will arise in the world of Web publishing. Broken links,
missing pages, and error messages abound when Web sites are not carefully
maintained, supported, and monitored. While UNIX will not fix
every problem you encounter with the Web, knowing a small amount of
UNIX can go a long way in diagnosing and correcting potential problems.
| What
you can use your UNIX skills to solve |
What
you can’t fix with UNIX |
| Files
in the wrong place (URL Not Found pages) |
Layout
or alignment problems |
| Permissions
problems (Access forbidden pages) |
Poor
image quality |
| Images
not displaying at all (broken image icons) |
Hunger,
world peace |
Things
to Remember
- Turn
off the CAPSLOCK key on your computer before you log in.
All UNIX commands are case sensitive. A command in lowercase
is different from one in capital letters. Additionally, the
password you use to log into your UNIX account is case sensitive.
-
End each command that you type with a carriage return (i.e. – the
ENTER or RETURN key on your keyboard).
The computer doesn't know you are trying to tell it to do something
until it sees a carriage return. If the computer seems to be
ignoring you, press the carriage return.
-
All commands must be entered correctly in order for them to work.
For ease of use in this documentation, single spaces appear as double
spaces. In actuality, a command will contain single spaces to
separate the elements of the command.
Directory
Structure
The directory
structure of UNIX is in many ways similar to that of the Windows and
MacIntosh operating systems. The two major components of the organizational
scheme are files, such as text documents, images, and executable scripts,
and directories, which are used to store files (much like folders in
other operating systems).
The
directory structure is organized in a tree model, with the root (represented
by a forward slash) as the starting point. Directories and files
branch out from the root. At the University of Virginia, directories
you will find under the root include bin, usr, tmp, home, uva, lib,
dev, and etc.
File
and directory paths are generally represented as starting with the
root and measuring down the tree structure. For example, the
“passwd” file may be found at /etc/passwd (in other words, inside
of a directory called etc, which is under the root).
Each
person who has an account on the blue cluster has what is commonly
referred to as a “Home Directory”; if user mst3k has an account
on blue, his her personal space may be found at /home/mst3k.
You will find various items under your home directory, including:
-
Dot files, such as .profile and .ksh. You should not remove
dot files – they contain information essential to your account,
and your account may not work properly if you remove or delete these
files.
-
Files or directories that you have saved using Home Directory Service.
-
Your Web files (located in public_html).
Note! Files that are stored
in your public_html directory may be viewed on the Web by navigating
to http://www.people.virginia.edu/~YourComputingID. If you do not
store your files under your public_html directory (or a subdirectory
of public_html), they will not be visible on the Web.
Getting
Started
In order to
work with your UNIX account, you will need to use terminal emulation software.
ITC recommends SecureCRT for Windows systems, and Nifty Telnet
for Macintosh Systems. Both are available for download from Software
Central.
Exercise:
Logging In and Installing Exercise Files
| Action
Steps: |
Comments: |
| 1.
Use SecureCRT or Nifty Telnet to connect to blue.unix.virginia.edu |
|
2.
When prompted for your username,
type your University computing id (e.g. – mst3k) and press ENTER. |
|
| 3.
When prompted, supply your password, and then press ENTER. |
|
4.
If you see the following prompt:
Enter terminal type [default is vt100]
press ENTER to select the default. |
  |
| 5.
At this point you will see either the Command Line (i.e. node14:
/home/mst3k $) or the Umenu system. If you do see Umenus, type
9 and press ENTER to get to the Command Line. |
Umenu
is a menu system that allows you to issue simple UNIX commands through
menu choices. For the purposes of this class, you will work
directly with UNIX.
Note:
There are many nodes on the blue cluster, so you may see a different
node number each time you log in.
|
6.
To copy the class files to your personal account, enter the following
text at the command line:
/home/trn-web/uwdsetup.pl |
If
the command is successful, you will se multiple lines similar
to the following:
Installing /home/…/uwdclass/case2.html |
Exploring
the Directory Structure
Notice
that when you first log in to your UNIX account, the command line reflects
that you are in your “home directory” (e.g. - /home/mst3k). The
following UNIX commands will allow you to move around in the directory
structure to view files and directory contents. Note!
You may not always be able to view file or directory contents
due to permission restrictions.
| Action
to Perform |
Command
to Use |
Notes |
| Change
directory |
cd
directoryname |
You
may use paths that are relative to your current directory,
or you may use an absolute path (a path that measures from
the root).
Relative Path (relative to the current directory):
cd public_html/images
Absolute Path (measures from the root):
cd /usr/bin |
| List
the contents of the current directory |
ls |
ls
lists the contents of the current directory.
Note! On the blue.unix cluster,
the default setting is to show the ls -F listing, which
marks each directory with a trailing slash, each executable with an
asterisk, and each symbolic link with an @.
Ex. Directory: images/
Ex. Executable: mail.pl*
Ex. Symbolic Link: mst3k@
If you enter ls and you do not see any of the symbols referenced
above, try entering ls -F |
| View
the contents of a file |
more
filename |
You
can view the contents of a file one screenful at a time by using
more. If the contents are more than one screenful, press
the SPACEBAR to advance to the next screenful. |
In order
to familiarize yourself with the UNIX environment, you should try
navigating within the directory structure. If you get lost,
you can always enter cd ~ to return to your home directory.
Exercise:
Navigating the Directory Structure
| Action
Steps: |
Comments: |
1.
Enter the following text at the command line:
ls |
ls
will display the contents of your home directory. |
2.
Enter the following text at the command line:
cd public_html |
Notice
that the command line changes to reflect that you are in your
public_html directory. |
| 3.
Enter ls to view the contents of your public_html directory. |
  |
4.
Select a file under your public_html directory and enter the following:
more filename |
The
file will appear on the screen one screenful at a time.
You can press the SPACEBAR to advance screen by screen.
If the file is really long, you may press CTRL-C to exit
more. |
| 5.
Return to you home directory. |
You
can return to your home directory by entering:
cd /home/mst3k
where mst3k is your computing ID
or
cd ~ |
| 6.
Navigate to the home directory of the person sitting next to you
and see if you can view his or her directory contents. Try
navigating to his or her public_html directory and see if you
can view the contents. When you are finished, navigate back
to your own home directory. |
Note!
You may not be able to view the contents of other people’s directories
depending on how their file and directory permissions are arranged.
Permissions will be covered later in this course. |
|
Case
Study 1:
You
just uploaded a Web page to the following directory on your UNIX
account (or so you think): /home/mst3k/public_html/uwdclass
where mst3k is your computing id. The name of the file is
case1.html. However, when you go to view the page on the Web at
http://www.people.virginia.edu/~trn-web/mst3k/case1.html, you
get the following error message: An Error Has Occurred; URL Not
Found.
Why isn’t this Web page displaying? __________________________________________
When you are done, return to your home directory. |
Shortcuts
One of
the key features of working in the UNIX environment is that a minimal
amount of typing is required to accomplish tasks. Although you
may always use longer versions of file and directory names, sometimes
using shortcuts is more efficient. Some shortcuts you may find
useful when working in the UNIX environment include:
| Shortcut |
What
it Means |
Example |
| ..
(two periods) |
Shortcut
for the “parent directory”. |
If
you were at /home/mst3k/public_html and wanted to go to /home/mst3k,
you could enter:
cd .. |
| .
(one period) |
Shortcut
for the “current directory”. |
 
|
| ~
(tilde) |
Shortcut
for your “home directory”. |
To
quickly change to your home directory, enter:
cd ~ |
Exercise:
Using Shortcuts
| Action
Steps: |
Comments: |
1.
Verify that you are at your home directory, and then enter:
cd public_html/images |
  |
2.
Navigate back to your public_html directory by entering:
cd .. |
cd
.. will take you to /home/mst3k/public_html |
3.
Navigate back to your home directory by entering:
cd ~ |
cd
~ will take you to
/home/mst3k |
4.
Navigate to the home directory of the person sitting next to you
by entering:
cd ../mst3k
where mst3k is that person’s computing id. |
cd
../mst3k will take you to
/home/mst3k |
5.
Navigate back to your home directory by entering:
cd ~ |
cd
~ will take you to
/home/mst3k |
File
Management
File management
is a systematic approach to organizing your files and directories so
that you can locate and manage your files quickly and easily.
At the most basic level, file management involves creating a logical
structure of directories, placing files in those directories, and deleting
out of date files. In a Windows or Macintosh environment, file
management is usually accomplished by using the mouse to drag and drop
files. Since UNIX has a text-based interface, file management
within UNIX occurs at the command line (Note!
If you use Home Directory Service to manage your files and directories,
you may accomplish many UNIX file management commands using a GUI.)
. The ls and cd commands you explored in the previous exercises
allow you to view the current directory structure.
The
table on the following page outlines some of the most common file
management commands.
| Action
to Perform |
Command
to Use |
Example |
| Create
a new directory |
mkdir
directoryname |
If
you wanted to create a subdirectory of public_html called “pictures”,
you would enter the following commands:
cd /home/mst3k/public_html
(or a shortcut equivalency)
mkdir pictures |
| Copy
a file |
cp
filename newplace |
If
you wanted to copy the file “bob.html” from you home directory
to your public_html directory, you would enter the following commands:
cd ~
(or its equivalent)
cp bob.html public_html |
| Move
a file |
mv
filename newplace |
If
you wanted to move the file “ed.html” from you home directory
to your public_html directory, you would enter the following commands:
cd ~
(or its equivalent)
mv ed.html public_html |
| Rename
a file |
mv
filename newname |
If
you wanted to rename the file (under the current directory) called
mary.html as cary.html, you would enter the following commands:
mv mary.html cary.html |
| Delete
a file |
rm
filename |
If
you wanted to remove a file called junk.html (under the current
directory), you would enter:
rm junk.html
You may be prompted to enter y or n to verify your
actions. |
| Delete
a directory |
rmdir
directoryname |
If
you wanted to remove a directory called stuff, you would enter:
rmdir stuff
Note! By default, you will
not be able to remove a directory unless it is empty. This
is to protect you from inadvertently deleting important files. |
| Edit
an existing file or create a new file with the editor “pico” |
pico
filename |
If
you wanted to edit the contents of a file called hi.html file
(under the current directory), you would enter:
pico hi.html |
Exercise:
Creating a New Directory, Moving a File, and Renaming a File
| Action
Steps: |
Comments: |
1.
Navigate to the uwdclass directory, which is located at:
/home/mst3k/public_html/uwdclass
where mst3k is your computing id. |
 
|
2.
View the contents of the uwdclass directory by entering:
ls |
Note
the file called “joe.gif” |
3.
Create a new directory by entering:
mkdir food |
  |
4.
View the contents of the uwdclass directory by entering:
ls |
Note
the directory “food” |
5.
Move the joe.gif file from uwdclass to uwdclass/food by entering:
mv joe.gif food |
  |
6.
View the contents of the uwdclass directory by entering:
ls |
Note
that “joe.gif” is no longer there |
7.
Navigate to the food directory by entering:
cd food |
  |
8.
View the contents of the food directory by entering:
ls |
Note
that “joe.gif” is now in the food directory. |
9.
Return to the uwdclass directory by entering:
cd .. |
  |
10.
View the contents of the uwdclass directory by entering:
ls |
Note
the “george.html” file. |
11.
Rename george.html to ringo.html by entering:
mv george.html ringo.html |
  |
12.
View the contents of the uwdclass directory by entering:
ls |
Note
that “george.html” has been renamed to “ringo.html”. |
|
Case
Study 2:
Open
a Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/uwdclass
where mst3k is your computing id. The “Index” listing that
you see is due to the fact that the uwdclass directory does not
contain a file called home.htm(l) or index.htm(l). This
is generally considered to be an undesirable effect.
Correct this problem by renaming the “nothome.html” file to “home.html”
in the /home/mst3k/public_html/uwdclass directory (where mst3k
is your computing id).
When you are done, refresh the page in your browser to view the
effects. |
Permissions
Files and
directories in UNIX exist on a shared server. As the owner of
the files and directories that you have created, you may determine the
access permissions of other people to your files and directories.
The
basic permissions that may be granted are read, write, and execute.
Each of these permissions has a slightly different meaning when applied
to either a file or a directory.
| Permission |
File |
Directory |
| Read |
view
the contents of a file |
list
the contents of the directory (i.e. - do an ls on the directory) |
| Write |
write
to a file, edit a file |
create
a new file in the directory |
| Execute |
run
the file if it is an executable file (e.g. - a cgi script) |
navigate
through that directory level to subdirectories |
Usually
you will have what are called “full” permissions for yourself.
In other words, as the creator and owner of a file or directory, you
have read, write, and execute permissions.
You
may also decide to assign file and directory permissions for other
people. The three types of people you can assign permissions
to are user (yourself), group (a predefined set of people), and other
(everybody else).
| People
who may be granted permissions |
Description |
| User |
The
person who created the file or directory. Sometimes called "owner". |
| Group |
A
group of users. By default, most people are already a member of
the “usr” group, of which everyone with an account on blue.unix
is a member. You can make a request to consult@virginia.edu to
have a group created if you have need for multiple people to maintain
the same files and directories. |
| Other |
Everybody
else |
Fully
displayed, permissions appear as follows:
rwxrwxrwx
-
The first section of rwx is for the user
-
The second section of rwx if for the group
-
The third section of rwx is for other (everyone else)
Each individual read, write, and execute permission can be turned
on or off. If a permission is “on”, it means "this permission
has been granted". This is denoted by a r w or x entry.
If a permission is off, it means "this permission has not been granted".
This is denoted by a - (i.e. - dash)
| Example |
Description |
| rwxr--r-- |
User
has full permissions. Group and other have only read permissions |
| rwxr-xr-x |
User
has full permissions. Group and other have read and execute
permissions |
| rwxrwxrwx |
User,
group, and other have full permissions. |
Permission
errors are probably the most common cause of Web pages not displaying
correctly. If you navigate to a Web page and receive the error
message “Access Denied”, there is probably an underlying permission
error.
At a
minimum, html and image files must be readable by other
in order to appear appropriately, and the directories that contain
the files must be executable by other. Any cgi
scripts or other executable files must be executable by other.
Many
people choose to set all of the files in their public_html directory
to be both readable and executable by other.
That way, the files will display properly and permission errors will
be unlikely. The downside of this approach is that people who
have access to the server will be able to get a listing of all the
files in your public_html directory (because the directory is readable).
Another
issue to be aware of is that Windows (be it 95, 98, NT, or 2000) takes
a different view of file permissions than UNIX. Since Home Directory
Service is a Windows utility that allows you to perform UNIX operations,
it will often “break” UNIX file permissions. The result is that
if you publish a page using Home Directory Service, the permissions
may need to be modified in order for the page to display properly.
Viewing
permissions is a simple modification on the ls command, and looks
like the following:
ls
-l
Exercise:
Viewing File Permissions
| Action
Steps: |
Comments: |
1.
Navigate to your home directory by entering:
cd ~ |
  |
2.
View the file permissions for the contents of your home directory
by entering:
ls -l
|
If
the directory listing is longer than what will appear in one screenful,
enter the following command:
ls -l | more
Note! The | character is called
a “pipe”, and it is usually located next to the BACKSPACE key
or above the ENTER or RETURN key on the keyboard. |
3.
Navigate to your public_html directory by entering:
cd public_html |
  |
4.
View the file permissions for the contents of your home directory
by entering:
ls -l |
Note
how your file permissions are set. |
Permissions
may be modified by the use of the chmod (change mode) command.
The syntax for chmod is as follows:
chmod
mode filename
where
mode is the set of permissions you want to grant and filename is the
name of the file or directory for which you want to grant the permissions.
Some examples are as follows:
| Example |
What
it means |
| chmod
go+r stuff.html |
Grant
group and other read permissions for the
file stuff.html |
| chmod
go+rx images |
Grant
group and other read and execute permissions
for the directory images |
| chmod
go-rwx private.html |
Remove
read, write, and execute permissions from
the file private.html |
Exercise:
Changing File Permissions
| Action
Steps: |
Comments: |
1.
Switch to your Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/uwdclass/perm.html
where mst3k is your computing id. |
Note
the error message – this is what happens when file permissions
are not properly set. |
| 2.
Switch back over to UNIX. Navigate to the uwdclass directory. |
  |
3.
View file permissions for the uwdclass directory by entering:
ls -l |
Note
that the file perm.html does not have read permissions for group
and other. |
4.
Enter the following command:
chmod go+r perm.html |
  |
5.
View the file permissions for the uwdclass directory by entering:
ls -l |
Note
that the file perm.html now has read permissions for group and
other. |
| 6.
Switch back to your Web browser and reload the page. |
Your
page should now be visible on the Web. |
|
Case
Study 3:
Open
a Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/uwdclass/case3.html
where mst3k is your computing id. You will receive an “Access
Denied” error message. Diagnose the cause of the problem
and then take the appropriate actions to correct the situation. |
|
Challenge
Exercises:
If
you have extra time or would like further practice after class,
diagnose and correct the problems you find at the following Web
pages (for each, substitute your computing id for mst3k).
http://www.people.virginia.edu/~mst3k/uwdclass/pics.html
http://www.people.virginia.edu/~mst3k/uwdclass/challenge.html
http://www.people.virginia.edu/~mst3k/uwdclass/freeforall.html
(note: this file will display correctly, but in its current
state anybody else can modify it).
For help, use the Flowchart included in Appendix A. For
possible correct solutions, consult the back of this booklet (but
there is more than one way to fix each problem). |
Departmental
Web Sites
Publishing
Web pages at the University of Virginia involves uploading files to
a particular directory. As you have already witnessed, most personal
Web pages are stored in a person’s public_html directory. In other
words, if you wanted to upload html files, you would need to save them
in:
/home/mst3k/public_html
where mst3k is your computing id.
The files would then be accessible by going to:
http://www.people.virginia.edu/~mst3k/filename.html
Most
departmental Web sites are not stored on blue.unix, but on various
servers such as “minerva”, “jm”, or “avery”. Departmental Web
sites on minerva are structured in one of two ways:
1. With
a public_html directory
2. Under /www/doc
The
login process, the URL for finding the site, and the file path for
saving files on minerva differs greatly depending on which way the
site is structured. The following sections describe the two
basic structures and the ramifications of each. If you are in
doubt about which method your department uses, you should check with
your departmental computing support person.
With a public_html
Directory (the old method)
If your
department’s Web site is directly under www.virginia.edu and has a tilde
~ in its URL, the site is structured much like a personal Web site on
www.people.
Example:
The Web site for the Classics Department at the University of Virginia
may found at:
http://www.virginia.edu/~classics
-
If you were the maintainer of this site, you would log into minerva
with the username “classics” and whatever the password is for classics.
-
After logging in, you would be at the home directory for the Classics
department:
/home/classics
-
You would then cd to the public_html directory:
/home/classics/public_html
in order to view, modify, or adjust file settings.
This public_html
directory arrangement is very common in the University environment,
but it presents three major drawbacks:
1. The
URLs for this type of site have a tilde ~ in them, which can make
them more difficult to remember.
2. The names for tilde accounts are limited to eight characters.
3. It is nearly impossible to tell who is making modifications to
the pages. If there were a group of four people working on the
site, they would all log in as “classics” (in this scenario).
Under /www/doc
(the new method)
If your
department’s Web site is directly under www.virginia.edu and does not
have a tilde ~ in its URL, the site’s files are stored under /www/doc.
Example:
The Web site for the Center for National Security Law may found at:
http://www.virginia.edu/cnsl
-
If you were the maintainer of this site, you would log into minerva
with your own user name and the same password you would use on blue.unix.
-
After logging in, you would navigate to /www/doc/cnsl in order to
view, modify, or adjust file settings.
This site
arrangement offers several strengths over the public_html directory
setup:
1. The
URLs for this type of site do not have a tilde ~ in them.
2. Account names are not limited to eight characters.
3. Since files and directories are created by a people logged in as
themselves, it is easier to track who created the individual files
and directories.
4. If a site maintainer leaves the University, his or her account
will be deleted (but not the files). This effectively blocks
former staff members from accessing files after they have left the
University.
One
issue that must be dealt with when using the /www/doc site arrangement
is the creation and maintenance of groups (especially if you have
many people maintaining the Web site). Since the site maintainers
are logging in using their own computing ids (and not a generic account),
groups must be created and members added to the groups in order to
allow multiple people to access the files.
Appendix
A: Web Troubleshooting Flowchart
Appendix
B: Solutions to Case Studies and Challenge Exercises
|
Case
Study 1:
You
just uploaded a Web page to the following directory on your UNIX
account (or so you think): /home/mst3k/public_html/uwdclass
where mst3k is your computing id. The name of the file is
case1.html. However, when you go to view the page on the Web at
http://www.people.virginia.edu/~trn-web/mst3k/case1.html, you
get the following error message: An Error Has Occurred; URL Not
Found.
Why isn’t this Web page displaying? __________________________________________
When you are done, return to your home directory. |
In order
to solve this case, you will need to explore the directory structure
by using the cd and ls commands.
| Action
Steps: |
Comments: |
1.
Navigate to the uwdclass directory by entering:
cd /home/mst3k/public_html/uwdclass |
 
|
2.
View the files in the uwdclass directory by entering:
ls |
Note
that the file “case1.html” is not in this directory. What
other directories are available under uwdclass? (Remember that
all directories are marked with a trailing slash) |
3.
Navigate to the images directory by entering:
cd images |
 
|
4.
View the files in the images directory by entering:
ls |
Note
that the file “case1.html” is in the images directory. |
|
Summary:
The
Web page isn’t displaying at:
http://www.people.virginia.edu/~mst3k/uwdclass/case1.html
because the case1.html file isn’t stored in the uwdclass directory;
it is stored in the images subdirectory of uwdclass, /home/mst3k/public_html/uwdclass/images/case1.html. |
|
Case
Study 2:
Open
a Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/uwdclass
where mst3k is your computing id. The “Index” listing that
you see is due to the fact that the uwdclass directory does not
contain a file called home.htm(l) or index.htm(l). This
is generally considered to be an undesirable effect.
Correct this problem by renaming the “nothome.html” file to “home.html”
in the /home/mst3k/public_html/uwdclass directory (where mst3k
is your computing id).
When you are done, refresh the page in your browser to view the
effects. |
| Action
Steps: |
Comments: |
1.
Open a Web browser and go to the following URL:
http://www.people.virginia.edu/~mst3k/
uwdclass |
Note
the “index” listing that appears. |
2.
In UNIX, navigate to the uwdclass directory by entering:
cd /home/mst3k/public_html/uwdclass |
  |
3.
View the files in the uwdclass directory by entering:
ls |
Note
the file “nothome.html” exists, and that there is no “home.html”
file. |
4.
Rename the nothome.html file to home.html by entering:
mv nothome.html home.html |
  |
5.
Verify that the change took place by entering:
ls |
Note
that “nothome.html” is now gone and “home.html” appears. |
| 6.
Switch to your Web browser and reload the page to view the effects. |
  |
|
Summary:
Your
public_html directory and all of its subdirectories should have
a file called home.htm, home.html, index.htm, or index.html in
order to avoid having an index listing appear when someone navigates
to that directory. In the case study above, you corrected
the problem by renaming a file to home.html. |
|
Case
Study 3:
Open
a Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/uwdclass/case3.html
where mst3k is your computing id. You will receive an “Access
Denied” error message. Diagnose the cause of the problem
and then take the appropriate actions to correct the situation. |
| Action
Steps: |
Comments: |
1.
Open a Web browser and navigate to the following URL:
http://www.people.virginia.edu/~mst3k/
uwdclass/case3.html |
Note
that you get an “Access Forbidden” error message. |
2.
Switch back to UNIX and navigate to the uwdclass directory by
entering:
cd /home/mst3k/public_html/uwdclass |
  |
3.
View the permissions for this directory by entering:
ls -l |
Note
that “case3.html” does not have read permissions for group or
other. |
4.
Change the permissions for case3.html by entering:
chmod go+r case3.html |
  |
5.
Verify that the permissions have changed by entering:
ls -l |
Note
that “case3.html” is now readable by group and other. |
| 6.
Switch back to your Web browser and refresh the page. |
  |
|
Summary:
Html
files must be readable by other in order to be viewable on the
Web. In this case study, you turned on the read permissions
for case3.html, and then the page was viewable on the Web. |
|
Challenge
Exercises:
If
you have extra time or would like further practice after class,
diagnose and correct the problems you find at the following Web
pages (for each, substitute your computing id for mst3k):
http://www.people.virginia.edu/~mst3k/uwdclass/pics.html
http://www.people.virginia.edu/~mst3k/uwdclass/challenge.html
http://www.people.virginia.edu/~mst3k/uwdclass/freeforall.html
(note: this file will display correctly, but in its current
state anybody else can modify it).
For possible correct solutions, consult the back of this booklet
(but there is more than one way to fix each problem). |
Summary
of Potential Solutions:
http://www.people.virginia.edu/~mst3k/uwdclass/pics.html
| Problem: |
Broken
Image |
| Cause: |
If
you view the html source for pics.html, you will see that the
image tag is looking for “images/bill.gif”. The bill.gif
file is not located under /home/mst3k/public_html/uwdclass/images,
it is located directly under uwdclass. |
| Solution: |
Move
the “bill.gif” file from uwdclass to images by going to the uwdclass
directory and issuing the command mv bill.gif images. |
http://www.people.virginia.edu/~mst3k/uwdclass/challenge.html
| Problem: |
Broken
image |
| Cause
(Part 1): |
If
you view the html source for challenge.html, you will see that
the image tag is looking for “images2/rotunda_sky.jpg”.
The rotunda_sky.jpg file is not located under /home/mst3k/public_html/uwdclass/images2,
it is located directly under uwdclass. |
| Solution
(Part 1): |
Move
the “rotunda_sky.jpg” file from uwdclass to images2 by going to
the uwdclass directory and issuing the command mv rotunda_sky.jpg
images2. When you switch back to the Web browser and
refresh, there will still be a broken image. |
| Cause
(Part 2): |
Switch
back to UNIX and view the file permissions for rotunda_sky.jpg by
going to the images2 directory (cd /home/mst3k/public_html/uwdclass/images2)
and doing an ls -l. The permissions will appear
to be correct. At this point, you should check the permissions
of the images2 directory itself. Go to the uwdclass directory
and do an ls -l , and you will discover that the images2
directory is not executable. |
| Solution
(Part 2): |
Verify
that you are at the uwdclass directory, and then issue the command
chmod go+x images2. If you refresh the Web page again,
the image should appear successfully. |
http://www.people.virginia.edu/~mst3k/uwdclass/freeforall.html
| Problem: |
Anyone
with access to blue.unix can modify this page. |
| Cause: |
Full
permission are turned on for group and other. |
| Solution: |
In
UNIX, navigate to the uwdclass directory. View the permissions
for the directory by entering ls -l. Remove the write
permissions for group and other by entering chmod go-w
freeforall.html. |
Appendix
C: Cleaning up After Class
If you
refer to page 12 of this booklet, you will see the commands for deleting
files and directories:
| Delete
a file |
rm
filename |
If
you wanted to remove a file called junk.html (under the current
directory), you would enter:
rm junk.html
You may be prompted to enter y or n to verify your actions. |
| Delete
a directory |
rmdir
directoryname |
If
you wanted to remove a directory called stuff, you would enter:
rmdir stuff
Note! By default, you will
not be able to remove a directory unless it is empty. This
is to protect you from inadvertently deleting important files. |
Unfortunately,
deleting all of the class exercise files in the method described above
can be a long and laborious process, since you would need to delete
each file, confirm the deletions, and then delete the directories.
If you
would like to take a faster approach to deleting class files, perform
the following actions:
| Action
Steps: |
Comments: |
1.
Navigate to your public_html directory by entering
cd /home/mst3k/public_html
where mst3k is your computing id. |
  |
2.
Enter the following command:
rm -Rf uwdclass
|
Note!
This operation will delete the uwdclass directory, all of its
subdirectories, and all of its files. You will not be able
to undo this action.
Caution! Do not perform this
procedure with your other directories unless you are certain you
want to perform the action. |
If you
would ever like to perform the exercises in this booklet again, you
may reinstall the exercise files according to the instructions in
the Getting Started section of this document.
Web
Development Support | General
Info | Getting Started
| Design & Promotion
Cool Tools | Troubleshooting
| Feedback
If
you need further assistance with Web applications or questions, send
e-mail to web-consult@virginia.edu
or call the ITC Help Desk at 924-3731.
|