Taking a very high level look at this assignment, the main goal is to publish your previous XHTML assignment on the world wide web. To do that, you will need to copy your XHTML page(s) to the webserver, and then change and verify the file permissions on your pages so they can appear on the web. The webserver for the class runs the UNIX operating system, which is where learning UNIX comes in.
The lower level goals are something like this:
Your assignment will be graded by looking at the files and directories you "create". Frankly, it's possible to cheat by using the GUI on a Windows or Macintosh computer on campus to do most of the assignment. So we are going to have you create a "session log" of your work, and will use that to verify that you used the UNIX CLI to do it.
As usual, these instructions assume that you are working in the class lab (or other ACS lab) on campus. It is certainly possible to do it from home, assuming you have an internet connection. If you have Windows, you will need both PuTTY (see below) to do the assignment and, to turn in the session log, FileZilla -- see the "turning in" documentation. If you have a Macintosh, you can use the Terminal (Applications->Utilities->Terminal) program. Unfortunately, there is no built in session loggin in Terminal, but you can use the UNIX command script to do the same thing. There will be a brief discussion on script in a minute.
There is a very large number of commands in UNIX. To accomplish this assignment, though, you will only need to know a few of them. Here is a table with the commands that you will need, plus a couple that you might need if you get introuble.
Notes:
The class webserver is the same icogsci1.ucsd.edu server that you have been using to turn in your assignments all quarter. To access the server for this assignment, however, you are going to log in using telnet. Telnet gives you a command line interface (CLI) or "Shell" access to the class server. The program that you type your commands into, and which runs them for you, is called the Shell.
Instead of the obsolete and insecure telnet program, you should use a version of SSH, "Secure Shell". In the class lab(s), ACS has 2 different programs: one called SSH, and other one is called PuTTY. PuTTY is free and can be downloaded to your home (Windows) computer if you wish to do the assignment from home. The instructions will concentrate somewhat on PuTTY because we think that's what most of you will be using.
Macintosh users who want to do the assignment at home, be patient.
PuTTY is already installed on the class
lab Computers.
However, in Fall 2007, PuTTY seems to
have disappeared from the Start menu.
It is on the lab machines, however, and here's how to get at it.
Windows users working at home can download and use
PuTTY from
http://www.chiark.greenend.org.uk/~sgtatham/putty/

Note, if you type in a "Saved Sessions" name (like icogsci1) and click the Save button, then PuTTY will save the the settings you have made and it will appear in the configuration dialog like the one pictured above.
While PuTTY is active, you can get back to the configuration menu (for instance, to change keyboard settings or the colors used) at any time by clicking on the icon to the left of "PuTTY" on the title bar, and then selecting "Change settings...". Make your changes, click on Session at the top left and you can save your updates.
The class lab(s) have SSH (called "secure shell"), which is located in Start->Programs->Secure Shell. Note there is also, a "Secure Transfer Client" in that same folder; you don't want that, but the "Secure Shell Client" instead.
Once SSH is running, you will see a window like the one below (click on it to see a larger image.)
Simply type Return to get the "Connect" dialog:
Enter the class server computer name, icogsci1.ucsd.edu, as the "Host Name" and your cg3fzz account code (not your ACS username!); and when prompted (a separate dialog), the corresponding password.
Mac OSX comes with a version of SSH.
To use it, you must first open the Terminal
application, which can be found in Applications->Utilities->Terminal.
When you start Terminal, it will actually
give you a UNIX window on your Macintosh!
Then you type:
ssh -l cg3fzz icogsci1.ucsd.edu
where, of course, you use your class account instead of cg3fzz.
Regardless of which SSH program you are using, the first time you try to connect to icogsci1.ucsd.edu you will most likely see a warning to the effect that icogsci1.ucsd.edu is "untrusted" and do you want to continue to connect. Like the one from PuTTY shown below.

This is perfectly normal, and only happens the very first time you connect to a particular host. In the case of PuTTY, you are offered 3 choices: Canceling will abort the connection attempt (and you'll have to start over), click "yes" will allow the connection and prevent the alert in future connections, while "no" will allow the connection but give you the alert the next time you connect. Presumably, you will select "yes".
Note to Macintosh users: the warning you see will not be a separate dialog window, just text in your SSH windown; to respond, you will have to type the whole word "yes"!
When you have successfully typed your account and password, and dealt with the security alert, you will see a "message of the day" screen (or screens) like below (click on it to enlarge it). This message is a list of announcements from ACS about your account and use of the ACS labs. As the prompt at the bottom of the screen will suggest, type 'q' to get rid of the announcements.
Now, you should arrive at the shell prompt, in this case: "bash-2.05b$ "
Congratulations, you have successfully logged into a UNIX system!
As stated earlier, you need to create a transcript of your commands as you work through the assignment. Don't be concerned about the transcript containing mistakes and errors (typos, incorrect command usage, etc.). We expect that. We just want to verify that you actually did the assignment using UNIX tools instead of some other method.
Depending how which SSH you are using, there are different methods of starting the session log. We start with PuTTY.
Important!!! always make sure to append to your log file, rather than overwritting it! That will let you stop the assignment and start it up again later. If you overwrite, the session log will only contain the last bit that you did!
|
|
When you are finished with the assignment, don't forget to transfer the log to your homework directory in your account.
To start session logging using the SSH program in the ACS labs is simple. Just select File->Session Logging. The log file name should be called something like: session.log, and navigate to where you want to save the log file, on your desktop (or perhaps on the class server, since you can use the "Class Resources").
Again, when you are finished with the assignment, don't forget to transfer the log to your homework directory in your account.
If you are using a Macintosh, or a version of SSH other than the ones we described previously, you can use the UNIX script command to do your session logging. This is a little trickier than using the logging built into PuTTY or SSH (and only needs to be used if you are not using one of them). You should use it exactly as shown below:
bash-2.05b$ script -a cg3fxx.log
where cg3fxx.log is the name of the logfile and
the -a flag tells the script to
append to the file if it already exists, rather than save over it.
After you execute this command, everything you type, and all of standard output will be recorded in this file, until you execute the exit command.
Because script is a less obvious to use than the PuTTY session log, we've included a brief demo.

Notice in the above demo, that the cg3fxx.log file appears as one of the files in the directory when the ls command is issued.
If you haven't already done so, start your session log.
Try typing: asdfasdf and then erasing it with the Backspace key.
If, instead of erasing the letters, you see ^H or ^? appear, you need to change what character your SSH is sending when you type the backspace key. For instance, in PuTTY, you click on the icon on the left of the title bar and select "Change settings"; then click on Keyboard (under Terminal) and make your change; then select Session and save your change. (On the Macintosh, you would need to change the "Window Settings..." of you Terminal program.)
Use the date program to time and
date stamp your work. If you stop, and then restart your work
(make sure to append to your log file!)
-bash-2.05b$ date
Sun Nov 4 21:41:48 PST 2007
-bash-2.05b$
You should be in your home directory at this point, right? Use the ls -l command to "see" what is there. You should see the directories (folders) from previous assignments. (There maybe other files and folders there, don't worry about them.)
You should already have hw3 directory created from the earlier parts of this assignment. If you do not have it, then use mkdir to create it now.
Then use mkdir to create the directories for the rest of the assignments: hw4, hw5, hw6, hw7, and hw8.
You should probably use the ls or ls -l to verify your results.
The prompt is a special Shell variable, called PS1 (prompt string 1). Here we will change the default prompt -bash-2.05b$ into something a little more useful for this assignment. The changed prompt will show the present working directory, so at any given time you now where you are (you can also get this information by using the pwd command). You can use the following syntax to do this (remember all commands in UNIX are case-sensitive).
-bash-2.05b$ PS1='[\u]\w > 'After you've executed the above command, your prompt should have changed into this:
[cg3f]~ >Notice the prompt is immediately changed. What we just did is assign a different value to PS1. The characters \u and \w are special "escape" characters, which the system understands and translates to something meaningful. For example, \u corresponds to the current (u)ser (so you know who you are!) and \w corresponds to the present (w)orking directory. This is an abbreviated version of what pwd outputs, where the ~ corresponds to the path of your home directory, i.e. /home/linux/cogsci/cg3f/cg3fZZ/. Since most of the time you will be working under your home directory, the path of your home directory is replaced for economy of space.
Use the mv program to change the name of the hw5 directory to public_html
You should probably use the ls or ls -l to verify your results.
Why the name: public_html? Because on this webserver, a directory called public_html in a person's home directory is their personal web directory!
Copy both your previous XHTML-css assignment
and the css style sheet into your
public_html
directory.
You will need to use the cp program to
do this. But exactly how is up to you.
We are being deliberately vague here. This is really the guts of the assignment
-- how you refer to files in different directories.
If confused, be sure to come to lecture as much will be revealed.

When you copy the XHTML assignment into your public directory (public_html) rename the html assignment to: index.html. You can either do this when you do the cp or in a separate step using mv. The style sheet should keep it's same name.
Why index.html? It's the default name for the main page in a web folder.
Use the chmod command with mode "o+r" to change the permissions for all .html documents, your CSS sheet, and any images in your public_html folder, and don't forget the ones in your subfolders.
You'll want to verify all your .html files, CSS style sheet, and any images have been changed to mode 'o+r', like index.html below. (The example assumes you are in your public_html folder.)
[cg3f]~ > ls -l index.html total 2 -rw-r--r-- 1 cg3fzz cg3f 204 Apr 27 14:26 index.html [cg3f]~ >
Hint: remember you can use ~ (tilde) to refer to your home directory, if it helps.
Then you can use "ls -ld" to verify that directory permissions look like the ones below, particularly the 'x' permission in the "other" portion of the permissions (the example assumes you are in your home directory).
[cg3f]~ > ls -ld . public_html drwxrwx--x 4 cg3fzz 512 Apr 27 12:26 . drwxr-x--x 2 cg3fzz 512 Apr 27 12:26 public_html [cg3f]~ >
If you've done things correctly, your page is now on the world wide web! The URL is:
http://icogsci1.ucsd.edu/~cg3fzz(with your account code, of course, and that's a tilde (~) in front of the cg3). If you will recall, the notation ~cg3fzz means the home directory of cg3fzz when used in UNIX commands. When it is used in a URL, it means the personal web directory for user cg3fzz. And in our case that means the subdirectory public_html in user cg3fzz's home directory.
Load that URL into a web browser and you should see your XHTML-css assignment! You should also see the color changes that your CSS style sheet creates. Remember that "Forbidden" means permissions issues which you need to fix.
If your page loads, but doesn't show the affects of your style sheet, make sure that the style sheet is in your web directory, and is "o+r". If that appears to be okay, make sure that CSS sheet name in the directory and the name in the <link> element in your index.html match exactly. If the names don't match, use mv to make the file name match what's in the <link> element.
If you make any changes (to permissions or filenames), reload your webpage.
Once you are satisfied with your results, it's time to turn in your session log.
We will grade you on