Serving Your GuestsTOC



The butterfly's day
hath not long to tarry
for the spider doth pray
for to prey, yea very


What is the UNIX Philosophy?TOC



One might say that the era of open friendly computer systems was born with UNIX. One would be wrong to say so,... yet there is more than a little bit of truth in the saying. There is probably no question that the World-Wide Web is the child of the UNIX philosophy. One of the major components of the UNIX operating system is the open nature of the filing system: the ease with which files can be shared as well as the ability to keep some files locked up and away from prying eyes. Many persons use UNIX without any knowledge of these capabilities. The typical user may find themselves using a UNIX server without any idea that the system is not dedicated to their own individual needs. The beauty of UNIX is that a user might feel this way. The truth is that the system has many features which are definite clues to the multi-user facilities of UNIX. In most cases, your UNIX server will not provide you with a convenient word processor. The reasons for this are many:
  • The system has many different printing ports.

  • The UNIX server has many different terminal types accessing it at the same time. Consequently, it is best for the UNIX server to only transfer ASCII-type file information back and forth between the server and your computer.

  • The UNIX server has many different clients. Each client uses some of the computing time. The more time spent with each client, sending special graphics files for example, the more time you will have to wait to be served.

Perhaps the major reason that there are not convenient word processors on UNIX machines is that, up until recently, UNIX machines were mostly used by computer enthusiasts with a great deal of patience. There are some ways to get around the lack of easy-to-use editors. One is to use your browser's e-mail capabilities to send files to your email account. Then save the files and strip the headers. That is: strip the address and subject e-mail information. Another way is to edit on your personal computer and the transfer files using an ftp utility. Finally, if you are a patient person you can learn to use vi. This chapter is mainly for those who have neither the time nor the inclination to buy a UNIX or vi manual in order to learn all the right stuff.

What is a Server?TOC



A server is to the computer network like the heart to the body. A server is a computer which is primarily dedicated to storing and distributing files, and running computer applications over a network. The advantage of using a computer application from a server is readily apparent to anyone who has tried to keep the software in a local network up-to-date. It is a tedious and thankless job to go from one machine to another installing the same software. If the software is accessed over a network, then it requires only one installation. This is a great time saver.

Once a file or program is installed on the server, anyone with the proper authority can access the information or program. Whenever you access a distant webpage you are using a server, or perhaps a series of servers.

Using a server is a little like going to eat at a restaurant. If the restaurant is busy, you must wait in line. This is called a queue in computer lingo. Finally, you are seated. The server awaits your request. Over a network, you make a request by moving your mouse or striking your keyboard. The request is then written down on a pad of paper by your server (or put another way, the computer stores your request in a buffer). The server then takes your order into the kitchen for processing.

Sometimes the restaurant is very busy. The server may not be able to attend to your requests quickly. This can also happen with computer servers. You may find yourself typing into your server, while at the same time nothing appears on the screen. This can also happen on your personal computer, if it is doing several tasks at once.

We imagine that when we type something at the keyboard, there is a direct link from the keyboard to the screen: just like a mechanical typewriter. This is not the case. Whenever you type on the keyboard, the information goes to a buffer. This is a temporary storage mechanism. The information in the buffer is then processed by the computer, usually as letters printed on your screen, or by the movement of the arrow on your screen.

If the server is busy, or if you have a low priority in the computer queueing system, then your request is not processed immediately and you must wait for your action to appear on the screen. If you are editing a document over the network, then each time you press a key on the keyboard, you are requesting a service. The keyboard request travels across the network to the server which then recognizes the request and sends a signal back to your computer. Your computer processes the signal and then puts the letters on your screen. This process is called echoing.

On most servers, the more requests you make, the quicker the server responds ... up to a point. If you leave your editing process for a short time, you may notice that when you return, you can type several letters before the server will echo the letters back to your screen.

A Note on BuffersTOC

    A buffer is a temporary data storage system: a kind of holding tank. The most efficient transfer of data is in bundles. Suppose you are typing at a UNIX prompt. The letters you type are placed in a buffer and echoed back to your screen. The command you type is not executed until you hit the " enter" key. The use of buffers makes multi-tasking over networks more efficient.

    A Note on The Enter KeystrokeTOC

    To avoid confusion, I will use the symbol "¬ " throughout, to denote the enter keystroke.



What is a Client? TOC



A client is the person, or computer system, making a request from the server. The use of the term client is to indicate the relationship between the two computers in a given interaction. The client is dependent on the server for obtaining the resources needed and for carrying out some operations.

Operations that are server-side require the server to do most of the work. The client simply receives the results of the work. Editing documents using an editor like vi is primarily a server-side relation.

Operations that are client-side require the personal computer to obtain information from the server, and then perform the task of making that information usable. The concept of the World-Wide Web involves participation by the server and the client. The use of a browser is primarily a client-side relation. This does not minimize the importance of the server in the interaction.

The future of client/server computing lies in client-side applications which make UNIX invisible. This does not mean that the UNIX system will not be used, it only means that the average person will be unaware of how they are using UNIX and telnet commands. A good example of this kind of distributed computing is the World-Wide Web browser. Another example is afforded by transparent ftp programs. These ftp programs will be discussed later in the chapter.

Using the Directory SystemTOC



Most directory systems have a parent/child relationship. In this sense, the directories on the machine, and in particular on your account, are like a family tree. When you log onto your UNIX account the computer places you in your HOME directory. On a UNIX machine you can always go HOME by entering

  • $ cd home ¬

    where $ represents the UNIX prompt sign and where cd means change directory.

    Starting in any directory, and assuming that you have the system's permission, you can move to the parent directory by entering

  • $ cd .. ¬

    This means change directory and go to the directory which contains my current working directory. You can create a directory in your HOME directory, simply by entering

  • $ mkdir www ¬

    This action will create a child-like-directory, in your HOME directory, called "www"

    A child-like-directory is usually called a subdirectory. This simply means a directory which lies below on the family tree of the directories.

    To see a list of directories and files enter at the prompt:

  • $ ls -a ¬

    This action will list all files and directories along with their characteristics. Another way to list is

  • $ ls -l ¬

    which lists everything along with their characteristics except the hidden files .

    If you get lost wandering through your directories, enter

  • $ pwd ¬

    at the prompt to print your working directory. Remember, on UNIX, unlike real life, you can always go home.

    Setting Up a Homepage on Your ServerTOC



    The most common UNIX editor is vi for "visual." This visual editor is not impressive to those who are used to personal computer editors. But when it was introduced in the late 1970's, by Bill Joy at the University of California-Berkeley, it was quite an improvement over the mainframe editors of the day. If you are used to editing documents on a personal computer you may find the use of vi a strain. I find that after using vi, and then switching to a personal computer editor, that I am constantly typing vi editing commands into my documents. Though I use vi, I would not recommend it for general editing use. Instead, I have developed some procedures for editing on your personal computer and doing some very simple work with vi or another editor. One other popular editor is Pico We will discuss some point about these editors later. If you are interested in using a UNIX editor, I would suggest buying a reference book.

    The Transparent ftp SolutionTOC

    In order to use an ftp program you must have a direct IP, that is a an internet protocol, hookup for the internet or be using a SLIP or PPP connection. These connection provide the correct coding systems for the secure transfer of your files. The good news is that there are now several Windows/Macintosh products on the market which do ftp in a user friendly environment. These products are very transparent, but there are too many possibilities to discuss them all. Remember to set the file transfer to binary, especially if you want to move graphics files.

    These ftp products will sometimes add extraneous characters to your files, but even if they do, they extra characters do not interfer with how your browser reads the HTML or graphics files.

    Two such products which I have used and can recommend are:

  • WS\_FTP for the IBM-compatibles at
      http://www.csrs.net/junodj/ws_ftp.htm

  • Fetch for the Mac at
      ftp://ftp.dartmouth.edu/pub/mac/
    For information on Fetch see:
      http://labweb.soemadison.wisc.edu/lab/pages/classes/moving_mac.html
    If you have a nice ftp program running on your personal computer, such as Fetch or WS\_FTP, you may find it much easier to use than an e-mail system. The ftp program will do all the work and it will move In-line image files correctly provided that you enable, or check, the binary box on your ftp program.

    The Command Line ftp SolutionTOC



    If you are using command line telecommunications package or if you are using a command line interface to move files from one UNIX server to another UNIX server then enter at the UNIX or DOS prompt:

  • C:$\backslash$> ftp open *server-address ¬

    where *server-address represents the telnet address location of the server you wish to use. If you have an account on the server you will be prompted to enter your account information. You should then receive an ftp prompt:

  • ftp>

    If you wish to send, or receive, an In-line image you must enter at the prompt:

  • ftp> bin ¬

    for binary. You should receive a response of the type:

      ftp> bin 200 Type set to I ftp>
    To return to text transmissions enter at the prompt:

  • ftp> ascii ¬

    which should elicit the response:

      ftp> ascii 200 Type set to A ftp>

    To exit, enter at the prompt:

  • ftp> quit ¬

    If you want to send a file to the server, make sure that you begin your ftp session in the correct subdirectory on your personal computer. You may move through directories on the server by using the usual commands. Be aware that in an ftp session, you may not have the same permission to move around on the server as you would in a normal session. As an example, go to the projects directory, on your computer, holding the project files for this book. Enter at the DOS prompt:

  • A:$\backslash$Webbing$\backslash$Projects> ftp ¬

    Log on to your account as usual. Let us move to our www subdirectory:

  • ftp>cd www ¬

    To put your documents on the server use the put command:

  • ftp>put simple.htm ¬

    To move In-line images change the Type to binary:

  • ftp> bin ¬

    Once again use put:

  • ftp>put sample.gif ¬

    When you are only moving a few files this method works very well. To move more files you can do multiple commands, like mput. Also you may wish to move files to your local computer to edit. To do this simply use the command get:

  • ftp>get simple.htm ¬

    This command will place the file on the directory of record when you began your session. To use DOS commands on your personal computer while in the program ftp use the following form

  • ftp>!dir /w ¬

    This will print the window form of your DOS directory file command.

    A Note About E-mail SolutionsTOC

      A standard e-mail solution will only allow you to move ASCII- type files securely. To move In-line images to your server, you will need to use one of the following:

    • ftp if you have a SLIP or PPP connection.

    • kermit or zmodem if you have only a simple modem connection.

    • MIME attachment feature on your e-mail program.

      One possibility is to encode the file and move them to the UNIX server using e-mail and then decode the file. This sort of manuvering requires some ingenuity. Postscript files are ASCII files. But even if you can move your graphics files using Postscript, you will need to use a file converter on the UNIX machine.

    The Pine E-Mail SolutionTOC

    The easiest way to transport your files may simply be by using the attachment feature of your personal computer's e-mail program. You may attach a variety of files types using this feature. Files can be handled by these e-mail systems using a MIME coding scheme and transported so that the actual file is attached and sent to your e-mail account on your UNIX server. If you wish to transfer graphics files or other binary files, be aware that you will not wish to read the e-mail, but rather save the attachment file as a file on the UNIX server. Many World-Wide Web browsers have e-mail programs that are designed to transfer attached files. Open your favorite e-mail program, in my case, I have used the Netscape e-mail program. \input fneml.tex Click on the "Send Mail" or "To:Mail" hot button. A new message editing window should appear. Send the email message to your e-mail account on your UNIX server. You may use the attachment feature of your e-mail program to attach files other than text files. For instance, you can attach graphics files using this feature. You can also attach your html files which you can then save using the e-mail account on your server. When you do this it is important to make sure that your personal computer mail program does not download and erase the files from your server. In some cases, this may simply mean that you must act quickly before your e-mail program automatically moves the message from your server account to your personal computer. You should be aware that this could be a problem.

    \input fattch.tex Now "click" on the "Attach File" hot button and use the dialog box to browse for the file you wish to attach. \input fgif.tex For this example, I have found the file info.gif in the Projects folder. If you "double click\rq \rq on the file or use the appropriate hot button the file will be loaded into the "Attachments" dialog box.

    If you will be using this feature of your e-mail to move files, then you may wish to disable the automatic e-mail download feature. This will mean that you will need to manually download your e-mail periodically.

    On the other hand, provided that you are careful to quickly access your server account and save your files you should be able to leave your automatic e-mail download feature enabled. This assumes that your e-mail program deletes the server-side mail messages when it downloads them to your personal computer. If it does not delete the files, then you should be able to access your files on both machines without changing any automatic settings.

    In addition to mailing files to yourself, you may wish to mail or recieve files from others. If someone sends an e-mail message with a file attached, you should be able to access it on both your server and your personal computer. If your e-mail program deletes meesages when it downloads them, then simply forward the message back to your UNIX account and quickly save it. You may also send files to other teachers and friends using the attachment feature. \vfill \eject Now "click " on the "OK" hot button to attach the file to your e-mail letter. As you can see, the file

  • info.gif

    has now been added to the "Attachment" list for my e-mail message. \input fsend.tex When you send this e-mail message, the e-mail program will send this file using a MIME or Multipurpose Internet Mail Extension.

    I now turn to the second part of the process of moving the file. Our graphics file has been sent, now we must go and pick it up. I wish save the files on the UNIX server machine using the Pine e-mail program. This is a common e-mail utility on UNIX machines. If Pine is not available on your UNIX server you should request that it be made available. It is particularly important for those wishing to make use of attachment files. Pine is a product of the University of Washington and does a great job with MIME. You should be able to start Pine by entering at the UNIX prompt:

  • $ pine ¬

    \input fpinea.tex Now enter "I" to open the index folder to view the list of messages in Pine.

    You may wish to explore some of the other features of Pine. Using a UNIX e-mail utility like Pine can be more difficult than the usual personal computer e-mail program, however, there are some advantages. When you use an e-mail package on your server, it allows for more security and privacy.

    Downloading your messages to your personal comuter will often make them available to anyone using your computer. When you leave your messages on your server, you only have one set of messages to organize and only one mailroom to keep uncluttered. \input fpineb.tex I wish to select the e-mail message infogif in this list. This is labeled as message number 44 in my list. This is the message I have just sent along with an attached file. Enter the number or use the curser keys to move to the line and hit the "Enter" key on your keyboard.

    It may be necessary to use the "O" command to see all the possible Pine commands. In fact, you should choose the "V" command to save the graphics file. Note that the pine editor gives special instructions since it has already recognized the file as a "gif\rq \rq image file. \input fpinec.tex Now you may use the usual save command and Pine will ask you if you wish to save the file with the original name. In some cases you may wish to change the name. The name should not repeat the name of a file in your home directory. If you think this will be a problem, give the file a different name before you mail it. \input fpined.tex We have chosen to save and we are given a final menu option. Return to accept and save as

  • info.gif

    or

  • ^C

    to cancel. You may also use

  • ^G

    to give a different name or path. \input fpinee.tex While we have chosen to move a graphics file using the Netscape e-mail program, keep in mind that it is possible to move text files as well.

    The Browser E-mail/vi SolutionTOC



  • Step 1 Construct your webpage using an ASCII text editor on your personal computer. When you have constructed a webpage use the "open local document" feature of your browser to preview your webpage document.

  • Step 2 See the section on "Setting up E-Mail". Copy or attach your document into an e-mail message which you then mail to yourself at your e-mail account on your server. One way to do this is to use the browsers e-mail facilities. If your browser has been initialized correctly, you will enter your password to access your server account. By using the browser e-mail facilities, you are then able to write your document, or paste it into the e-mail message using a nicer editor than would be available on your server.

  • Step 3 If you have your e-mail deleted from the server account when it is downloaded to your personal computer, then you will have to act quickly to save the e-mail document into a file on your server. Have your UNIX e-mail account up and running. Do this by logging into your e-mail from your "www" subdirectory. If you do this you can then save you e-mail message to a file in the "www" subdirectory.

  • Step 4 Save the e-mail self addressed file to a file name of your choosing. If it is intended to be your homepage it should look like

  • welcome.html ¬

    where ¬ represents the "enter" key on your keyboard. Otherwise, enter

  • *.html ¬

    where * represents any name of your choosing. Exit your server e-mail program

  • Step 5 Enter the following at the UNIX prompt:

  • $ vi *.html ¬

    where once again the "*" represents the file name that you used for the e-mail message. In other words, you should not actually enter an asterisk at the prompt.

  • Step 6 Now strip the unnecessary e-mail information carefully by typing "dd", that is delete one line, until you have reached the beginning tag <HTML>. If you are really adventurous you may delete all the header lines at once: that is type "16dd", for example. If you do this, you may want to make sure that you have plenty of space above your first HTML tag.

  • Step 7 You may now save the file by entering, precisely:

  • :wq ¬

  • Step 8 Enter the following at the UNIX prompt:

  • $ chmod o+r *.html ¬

    Your file should now be ready to access over the World-Wide Web. \input fpico.tex

    A Note on the Pico EditorTOC

      The pico editor is available on many UNIX machines and is gaining in popularity. If you have used the pine e-mail system, then you were probably using the pico editor. Using pico has the advantage of always being able to see useful commands. You may also use help to see a list of other commands.

  • Step 5/pico Enter the following at the UNIX prompt:

  • $ pico *.html ¬

    where once again the "*" represents the file name that you used for the e-mail message.

  • Step 6/pico Now strip the unnecessary e-mail header information by typing "control k", which appears on the screen labeled ^K. This will delete one line at a time. Continue until you have reached the beginning tag <HTML>.

  • Step 7/pico You may now save the file by typing "control X" and then answering yes to the save buffer enquiry. You must now make sure that the file is readable by others.

  • Step 8/pico Enter the following at the UNIX prompt:

  • $ chmod o+r *.html ¬

    Your file should now be ready to access over the World-Wide Web.

    The Browser E-mail/sed SolutionTOC



    The UNIX utility sed is a stream editor, meaning that you can edit documents by using a sequence of commands. You might think that this would be inferior to using a visual editor, but that is not always the case. If you know exactly what you want to do, sed can be extremely helpful and certainly less confusing than vi.

  • Step 1 - 2 Follow the directions in the previous section "The E-mail/vi Solution"

  • Step 3 As an example of a different way of saving files from email, log onto your UNIX account and start your UNIX e-mail from your HOME directory. You may save to different subdirectories by giving the correct path to the subdirectory. Save the e-mail self addressed file to a file name:

  • www/strippit.html

    Exit your server e-mail program.

  • Step 4 Enter at the UNIX prompt:

  • $ cd www ¬

    This should move you back into the "www" subdirectory. Now enter at the prompt:

  • $ sed '1,16 d' strippit.html > stripped.html ¬

    making sure to place a space between the 16 and the " d."

    This simple command will strip 16 lines from the file strippit.html and write the result in a new file stripped.html. Once again, since you saved the file from e-mail the UNIX system will likely assume that it is a private file and will not let others access the file. Consequently you must finnish by entering at the prompt:

  • $ chmod o+r stripped.html ¬

    You must use a different name for the stripped file each time you do this, since sed will not rewrite files. Also, if you attempt to save your e-mail to the same file it will append or add the e-mail to the file. So use a different file name each time, or delete the file "strippit.html" after stripping it by entering at the prompt:

  • $ rm strippit.html ¬

    each time.

    Using a ModemTOC



    Using a modem for accessing your server is almost always less than ideal. Due to budgeting in education, the use of modems in the classroom is the norm. Even if the baud rate, or modem speed, is high, the transmission channels are less secure and require better error correcting codes. Recently, great strides have been made to improve the speed of modems. The only problem is: getting software to use on your system which makes the modem "transparent." If the modem is not invisible, it is by definition a problem. There are several good products on the market, but there are far too many to discuss them individually. If your school system is paying good money for a commercial product, then the seller should give you as much support as you need to access your server properly. Call the provider and don't be shy.

    Most teachers and school districts work with limited budgets and so freeware and shareware become the solutions of necessity, not choice. Most UNIX machines should be running "C-Kermit" and "xmodem." The xmodem software is common on Macintosh systems and should allow you to transfer files via modem. The kermit is freeware developed at MIT and is available for both the Macintosh and the Windows/DOS platform.

    For example, suppose you have a Microsoft Windows Terminal program running over a modem. On my home computer, I have Windows 3.11 with kermit as an option in the Windows Terminal program.

    The Kermit SolutionTOC



    Kermit is a software package developed over several platforms that allows the transfer of files over modems. You should always use kermit in the binary mode. Step 1 Go to the www subdirectory on your UNIX account and enter at the prompt:

  • $ kermit

    You should see something like the following:

      C-Kermit>

    Step 2 Pull down the "Transfers" menu and select "Send Binary File. " o Browse through your system until you are in the correct directory for sending the file. Then click on the cancel button. This aligns your system so that you can quickly send files. If you want to explore the full range of kermit commands enter a "?"

    Step 3 Enter "receive" at the kermit prompt and you will receive the response to return and send

      C-Kermit>receive Escape back to your local system and give a SEND command... C-Kermit>

    Step 4 now return to the " Transfers" pull down menu and once again select "Send Binary File " or "Send Text File." Click on the file you wish to send and the terminal program will do the rest.

    The Modem Paste SolutionTOC



    To use this method you must have a pasting facility in your modem/window.

  • Step 1 Dial in and log onto your account.

  • Step 2 Open a file using your favorite UNIX editor, say vi

  • $ vi anything.html ¬

    \input fmyservi.tex

    and immediately type "i." The difference between my use of the word type and enter is that when I say type you need not strike the "Enter" key. The screen should now look like this: \input fvins.tex Now after having copied your ACSII/text file onto the clipboard in your local system, click on paste.

  • Step 3 Type the "Esc" key and enter the following to save the file:

  • :wq ¬

  • Step 4 If your are unable to obtain permission to access the file from your browser, enter the following at the prompt in the directory of the file you are trying to access:

  • $ chmod o+r *.html ¬

    where the star represents the file name.

    ReferencesTOC