IIT Logo
Publishing Your Web Page on Hawk

Making Your Web Pages

About hawk

Using Telnet to Connect to Your hawk Account

Logging into Your hawk Account

Creating Your Web Page Directory in Your hawk Account

Uploading Your Web Pages to hawk

Preparing Your Uploaded Files

Checking Your Web Pages

Editing Your Page Directly on the Server

Publishing Your Pages to the Server with WYSIWG HTML Editors


Making Your Web Pages

This tutorial assumes that you already know how to write a Web page. It's a good idea to use the mkweb (see below) command to create your initial Web page--you can always replace it later.

About Hawk

www.iit.edu, IIT's primary Web server, runs a version of the UNIX operating system called Irix. You will be using a command line interface to communicate with the server, which means that you will communicate with the server by typing in commands (like DOS) rather than clicking on icons (as in Windows or on a Macintosh). Your Web pages will appear to be in a subdirectory of your account on hawk, even though they are actually served by another computer.

From here on, we will take you, step by step, through the process of uploading your pages to hawk, giving you the required UNIX commands along the way. If you want to know more about UNIX in general, please take a look at Welcome to UNIX help for Users.

Using Telnet or SSH to Connect to Your Hawk Account

SSH or telnet are the recommended methods of connecting to your hawk account. For step by step instructions on how to use both of these to connect to hawk refer to the the following link. Connecting to Hawk Using SSH/Telnet

Telecommunications Software (Kermit, Procomm, Smartcomm, etc.)

It is also possible to access hawk using various other telecommunications software. You will dial directly into a campus modem bank or run Kermit over your on-campus serial connection to connect to hawk.cns.iit.edu.

Commercial Services

Online services such as America Online or Compuserve may provide their own Telnet clients. Follow their online documentation to Telnet to hawk.cns.iit.edu, then follow the instructions below.

Telnet Between Two Shell Accounts

Telnetting between another shell account and hawk is very simple. At the system prompt, issue this command followed by a carriage return:

telnet hawk.cns.iit.edu

and you will be connected to your hawk account. Once you have done this, log in using your IIT login and password.

Logging Into Your hawk Account

Once you have connected to your hawk account, you will be asked for your username and your password. Enter each one as it is asked for, followed by a carriage return.

Creating Your Web Page Directory in Your hawk Account

The quickest way to create your Web page directory, www, on hawk is to type

mkweb

at the hawk prompt. This will automatically create the necessary directory, set the proper file access protections, and walk you through the steps to create a very basic web page titled index.html. The Web server is set up to recognize files named index.html in each directory as the default file, with your www directory as the default Web directory. This means that when no other file in a directory is specified, the file named index.html will be displayed. We recommend that you identify which file is going to be your main page and call it index.html. Not having an index.html file is a potential security problem as it allows anyone access to all files in your www directory.

To learn more about setting file protections, see Setting Permissions for Files and Directories below.

Your Web Directory

If you list your main directory using the full listing command ls -la, you will see something like this for your Web directory:

lrwx------ 1 howto cns 23 Jan 7 1998 www -> /web/usr1/acc/howto/www

The www -> /web/usr1/acc/howto/www entry reflects the fact that this is actually a link to a directory in another location. Your web directory is actually on another computer, www.iit.edu (also known as arachne), and the Web directory on this system (which your web directory is a part of) is mounted as another drive on hawk. For all practical purposes you can treat the www directory as any other directory, but there may be situations arise where you have to access the directory using the full directory path starting with /web.

Uploading Your Web Pages to hawk

Next you need to get your Web pages from your local computer to your hawk account. Again, how you do that will depend on what kind of access you are using and what type of software you are using to establish your online connection. The most common way to upload files to Hawk is via File Transport Protocol (FTP).

Using Internet Explorer as an FTP Client

Internet Explorer can be used to copy files via FTP. Using IE is a quick and easy way to drag and drop files between your computer and any FTP site. However, it is limited, so if you require advanced functionality, you should consider using another FTP client, such as SmartFTP. To learn how to use IE as an FTP client, please see http://ots.iit.edu/howto/browserftp/.

Telecommunications Software (Kermit, Procomm, Smartcomm, etc.)

Most telecommunications software packages have some means of uploading and downloading files. Check the documentation that comes with your software for specific details. To ensure compatability with hawk, use the Kermit file transfer protocol (which you will find in all of the major terminal software packages).

PPP/Campus Network

If you are using PPP dial-up access or the CampusTCP/IP Network for your online connection, you can use an FTP client, such as WS_FTP for Windows or Fetch for the Macintosh, to move your files to your hawk account. These are usually point and click applications. Or in Windows 95 or NT, you can use command-line FTP by clicking on start, clicking on run and typing ftp hawk.cns.iit.edu in the dialog box. This will work exactly the same as FTP Between Two Shell Accounts discussed below.

Commercial Services

If you are using an online service such as America Online or Compuserve, these services provide their own FTP. Check with their online documentation for specific instructions.

FTP Between Two Shell Accounts

Let's assume that you are FTPing from another account to your hawk shell account, issue the following command on the 'run' screen (click the start menu then click on run):

   ftp hawk.cns.iit.edu

After connection, you'll be asked for your username and password. Give the username and password associated with your account.

Next, change directories to your World Wide Web directory by typing:

   cd www

Now, you want take ASCII files from the other account and *put* them into your hawk account. You do this with the put command. For example, if you want to put the file index.html into your hawk account, use this command followed by a carriage return:

   put index.html

to move it. If the file were named index.htm, you could even type:

   put index.htm index.html

which would automatically change the name of the file as it transferred.

You can also use wildcards to move multiple files. For example, if you want to move all the files ending with .html, use the following commands, each followed by a carriage return:

   prompt

   mput *.html

The prompt command doesn't actually do anything, it actually keeps something from happening. If you issued the mput *.html command without it, hawk would doublecheck with you before moving each file. This can be tiresome. So, to avoid it, you can turn off this feature with the prompt command.

Note: The preceding commands are only good for ASCII files, also known as Text files. Graphics files must be handled a little differently. Before moving any graphics files (.gif, .jpg, etc.), issue the following command followed by a carriage return:

   binary

This will alert hawk that a binary file is coming and the server will treat it accordingly. If you do not do this before moving a graphics file, the graphics file will become corrupted and will not work

You can use the ls (short for list) command to check the hawk account and see that your files are actually there.

Preparing Your Uploaded Files

Now that you have established a Telnet connection to your hawk account and your Web files have been uploaded, you need to make a few adjustments to the files before they can be accessed by a Web browser. You need to login to hawk again (if you are not still logged in).

First, make sure that your files are in your account. Use the command:

   cd www

to change directories to your Web directory and then type

   ls

to list all your files. If you are accustomed to DOS, this is the equivalent of the dir command

Changing Filenames

Since the hawk Web server is set up to recognize files named index.html in each directory as the default file, this means that when no other file in a directory is specified, the file named index.html will be displayed. Since the main file you might have created is probably index.htm, you will need to rename it to index.html.

You may also have to rename other files. If you created your files on a DOS computer, your files probably end with an .htm extension. These files should be renamed so that they have an .html extension although .htm should work.

Renaming files in UNIX is simple. Let's assume that you want to change a file called example.htm to index.html. Use this command:

   mv example.htm index.html

Filename Rules

  1. Don't use duplicate filenames because the second file will overwrite the contents of the first file.
  2. You can use up to 256 characters in any file or directory name. Extensions are optional and unlimited.
  3. The following characters are illegal in UNIX filenames: ? ! @ # $ % ^ & * ( ) - + ' " ? / \ |
    Your best bet is to limit yourself to alphanumeric characters (letters and numbers).
  4. Do not put spaces in your filenames. Use periods or underscores to represent spaces, like this: my_file.december.
  5. UNIX filenames are case sensitive. This means that index.html, Index.html, INDEX.html, and InDeX.html are all considered to be different filenames.

Setting Permissions for Files and Directories

In order for your files to be accessed, you must give users permission to use them. If you type the command:

   ls -l

You'll see a list of files that looks a little different than the list you saw when you used the plain ls command. Here's an example of a display generated by the ls -1 command:

     -rwxr-xr-x 1 Access student 5467  Jan 30 1996  personal_homepages.html
     drwxr-x--- 2 Access student 512   Nov 30 1995  private/
     -rw-r--r-- 1 Access student 26970 Apr 22 08:41 resources.html
     -rw-r--r-- 1 Access student 1577  Jul 7  1995  riceppp.cmd
     -rw-r--r-- 1 Access student 788   Jul 7  1995  riceppp.zip
     -rw-r--r-- 1 Access student 1093  Jun 3  22:35 sample.html
     -rw-r--r-- 1 Access student 2213  Apr 30 22:35 sidebar.gif

The information on the far left indicates what type of permission is given to each file and directory. The very first space indicates what type of file this is. Notice that the second item from the top is a directory; this is indicated by the d in the first space. The rest of the items are regular files; this is indicated by the blank space at the beginning of the line.

After the first space, there are nine spaces left over. The first three spaces indicate what permissions are given to the owner of the file (that is probably you), the second three spaces indicate what permissions are given to the workgroup (don't worry about this), and the last three spaces indicate what permissions are given to the general public.

Each of the letters stands for a different type of permission:

 r = read access (the indicated user may look at the file); numerical value = 4
 w = write access (the indicated user may open the file and change it); numerical value = 2
 x = execute access (the indicated user may use directories and execute programs); numerical value = 1
              

All of your .html and graphics files should be set so that the owner has read and write access and the group and general public have read access. The easiest way to do this (let's assume the file we are changing is called index.html) is:

   chmod 644 index.html

You can use wildcards with this command, for example, if you want to change the permissions for all the files ending with .html, use the command:

   chmod 644 *.html

Making Subdirectories

If you want to make subdirectories to organize your files, you can do so with this command (let's assume that you want a subdirectory called beans):

   mkdir beans

This subdirectory and any others that you make require a different permissions setting than regular files. To set the permissions a directory (still using beans as an example), use this command:

   chmod 755 beans

You can use the ls -l command to compare the permissions set for your files to the ones in the example above.

You can also rename directories that have already been created by using the mv command.

Checking Your Web Pages

When you are done with your hawk session, you can log out of your account with the exit command. Now, check to see if you can access your pages with your favorite Web browser. Remember, every browser has it's own way of displaying a page, so be sure to use correct HTML to be sure that your page is displayed to it's best advantage regardless of the browser used to view it.

Your URL will be:

   http://www.iit.edu/~username/

This assumes that your main page is called index.html, which is the default filename. See the section on changing filenames if you missed this part.

Editing Your Pages Directly on the Server

To edit your pages in a telnet session, change to your www directory after login, then type

   pico index.html

(or whatever the name of the page is) and press enter. You will be using the Pico text editor. When you are done, save your page by pressing control-o. You can then test the page by viewing it in Netscape or other web browsers.



Adapted from How to Use Your Shell Account at http://www.gbgm-umc.org/conferences/shell.html (now a dead link), on the United Methodist Church General Board of Global Ministries Web site; by Susan R. Hagan, shagan@mars.superlink.net.
Used by permission.
Quick Links


OTS Maintenance Schedule
Updated: August 12. 2004