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:
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.
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 wantFor Example, to log onto the CS 101 instuctor account on bert.cs.uic.edu the command would be:
ssh i101@bert.cs.uic.eduThe 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.
End your connection to UNIX. It is very important to disconnect when you are finished so no one else can come along after you and use your account.
List the contents of the current directory. Note: a UNIX directory is the same as a Windows folder.
The ls command has a special usage that will give more information about the files in the current directory. This is the long listing. This uses the -l option to the ls command:
ls -lThe first thing given on the long listing is the permissions for each file. This is important when making web pages viewable on the internet.
Allows the contents of file in <filename> to be changed. The editor pico is the counter part to the email reader pine. The ACCC's web page combine these two programs together under the name of pine. For a web page with a description of pico and how to use it, check out the North Carolina State Pico Page or ther University of South Dakota Pico Page.
Change to the directory given in <directoryName>. This command is normally used to change to a sub-directory of the current directory (change one level down in the hierarchical file system).
The cd command has two special usages. These are:
By just typing in cd, you will change back to your Home directory from where ever you are at in the hierarchical file system. Your Home directory is the directory you are in when you first log onto the UNIX system.
This command will move you up one level in the hierarchical file system. The directory that is one level up from the current directory is referred to as the parent directory of the current directory.
Display the contents of the file indicated by <filename> to the screen.
Display the contents of the file indicated by <filename> to the screen one page at a time.
Creates a duplicate of the file in <filename1> with the name <filename2>.
Renames the file in <filename1> with the name <filename2>.
Deletes the file in <filename> from the current directory. Note: once a file is deleted is cannot be restored. So use this command with caution!
Sends the file in <filename> to be printed at the printer with name <printerName>. This command also has a ACCC web page describing its use. Note: The lpr command will assume the file is stored using the ASCII character format (i.e. plain text). So don't try to print files that are not plain text.
Also check out the lp command and the CS Department How To Print page.
The actual command stands for Present Working Directory. This command will list the full path name of the current directory. Each slash in the full path name represents one level in the hierarchical file system.
List the contents of the current directory. Note: a UNIX directory is the same as a Windows folder.
This command will create a new directory with the name indicated by <directoryName> as a sub-directory of the current directory.
This command will remove/erase the directory with the name indicated by <directoryName> that is an existing sub-directory of the current directory. Note, the sub-directory must be empty (contain no files or other directories) before it can be removed.
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:
lsto 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 WWWNote 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.htmlThis will start the pico text editor and will allow you to make changes to this file.
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.
The use of this tag will cause the text following the tag to start at the beginning of the next line. The web browser will attempt to display as much information on each as possible no matter what spacing the original HTML file has. The browser just put one space between words removing any extra spaces or new line characters. This makes the use of <br> important.
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? |
This is the home page of Pat Troy.After the first line, type in your favorite joke or quotation. You should have at least one blank line between the first line that contains your name and your favorite joke or quotation.
Use the HTML tag of <br> to insert line breaks where needed.
http://www.cs.uic.edu/~USERID where USERID is your own CS account name.Once you have created your web page, send an email to the CS 101 instructor account at i101@cs.uic.edu that contains the URL for this assignment. The subject for the email must be something like CS 101: Lab 1 Submission. This part is very important to make sure your lab gets graded!
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.htmlThe 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.htmlThis 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.
cdTo 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.
cd WWW chmod a+rx .Note the period at the end is a very important part of this command.
chmod a+r *