CS 101 - Introduction to Computing, Spring 2008

Lab 1

For this assignment, you are to create a simple web page on your CS account. You will need to have an account on the CS Department machines and be familiar with a few UNIX commands:

You may also wish to read the ACCC's Web Publishing for Beginners; however, you will find there are a few items that are different between the ACCC's computers and the CS Department's computers. The ACCC is the University Computer Center.

The main page regarding the CS Department Computers is found at: http://www.cs.uic.edu/~consult/.

When using the CS Department Computers, you are required to follow the CS Department COmputing Policy.

Using Your CS UNIX Account

The CS Department has two remote servers and 72 workstations. To use the workstations goto SEL 2250 or SEL 2260 (these workstation are actually running Linux and not UNIX). The remote servers are

Every CS student and every student taking a CS course is given a can have an account on the CS machines. Your account name is provided on the lists posted in the CS Computer Lab or outside the CS Support Office in 927 SEO. You can also find out an Initially, your password will be your UIN which you should change as soon as possible.

From a Windows Machine, you should log onto the CS machines using SSH which stands for Secure SHell. The ACCC has some web page support for SSH. An alternative program to SSH is PuTTY. The added security of these programs is a level of encryption that the traditional telnet program lacks.

From a Macintosh machine, you should start a terminal window and the use the ssh command to connect desired machine. This would be done by the use of the following command:

     ssh userid@machineName

     where
        userid is the account name
     and
        machineName is the name of the machine you want
For Example, to log onto the CS 101 instuctor account on bert.cs.uic.edu the command would be:
     ssh i101@bert.cs.uic.edu
The userid for the CS 101 instructor account is i101.

Once you are logged into a machine, you will need to learn some basic UNIX commands to get around and perform various tasks. Again, the ACCC has some web page support for using its UNIX machine icarus. In particular the ACCC's web page UNIX 101 give a nice summary on various UNIX commands. The CS Department also has a summary at http://www.cs.uic.edu/~consult/how/unix.html.

The Basic UNIX Commands

The UNIX commands that you will need for this lab are:

Other UNIX Commands

There a literally hundreds of UNIX commands and I doubt that anyone knows all of them. A few other UNIX commands that you may want to know are:

Your CS Home Page

Your CS account will include space on the CS Department's web server. There is no web page in the space, so we will create a simple one for this assignment. You can access your homepage with the address of:
     http://www.cs.uic.edu/~USERID

where USERID is your own CS account name.

Your home page will be stored in the file called index.html in the directory WWW within your CS account. (A special note: the WWW "directory" is really a "link", but for now we will gloss over that difference.)

Once you log onto your CS account, you are in your "home directory". Type the command:

     ls
to see what files and "sub-directories" are in you home directory. You should have a directory called WWW Now change to that directory by typing the command:
     cd WWW
Note that CASE is very important. The command cd must be in lower case and WWW must be in upper case. Now type the ls command to see what is in your WWW directory. The files in this directory are made available to the world by the CS web server. Most likely you will get nothing as a result since your account is probably empty. Your default web page should be in a file called index.html. To create this file (or change it if it does exist) type the command:
     pico index.html
This will start the pico text editor and will allow you to make changes to this file.

HTML Tags

When using an simple editor like pico to create or modify web pages, you will need to type in your own HTML tags to make the page display as you would like it to. For this assignment, we will only introduce one HTML tag: LINE BREAK.

All HTML tags start with an less than symbol, then contain the text that specifies the specific tags and end with a greater than symbol.

If the Text File Contains,The Web Page Displays
Hello      There !  How   are you   ? 
Hello There ! How are you ?
Hello     There! <br>  How   are  you?
Hello There!
How are you?
Hello     There! <br> <br> How   are  you?
Hello There!

How are you?
Hello   
There!
How 
   are
you?
Hello There! How are you?
Hello   
There!  <br> 
How 
   are
you?
Hello There!
How are you?
Hello   
There!  <br>   <br> 
How 
   are
you?
Hello There!

How are you?

Lab Assignment 1

Due: Friday 1/22/2008 by 11:59 pm.

Troubleshooting

If your web page is viewable, then don't worry about the following information for now.

If you cannot view your file, the most likely error is that the permissions are not set correctly for your WWW directory or your index.html file. Odds are that the fault is with the permissions of your index.html file. This is were the ls -l command comes into play. The following information is also discussed in the ACCC's Web Publishing for Beginners in the "First Steps" section.

When I am in my WWW directory and enter the ls -l command, the result for my index.html file is:

     -rw-r--r--  1 i101 instruct  1270 Jan 15 22:08 index.html
The key part here is the -rw-r--r--. If the last 3 characters do not contain the r, the page won't be displayed. To fix this type in the following command while in your WWW directory.
     chmod a+r index.html
This command will change the permission to allow the web browsers to read the index.html file in your WWW directory.

There are other possible places were the permissions could be set wrong. One is at your WWW directory. To fix this we need a variation on the chmod command. Entering the following command sequence should solve any problems.

  1. Type in the following command to make sure you are in your home directory:
       cd
    
    To return from your WWW directory to your home directory always use the cd command as shown above. This is improtant since the WWW directory is really a link in your home directory.

  2. Type in the following command to set the permissions for your WWW directory.
       cd WWW
       chmod a+rx .
    
    Note the period at the end is a very important part of this command.

  3. Type in the following command to make sure all of the files in your WWW directory are readable by a web browser:
       chmod a+r *
    

Grading Criteria

Total: 100