Animated Ball UMUC Logo
http://polaris.umuc.edu/~flazarus/

Uploading A WWW Page to a Unix Host


You need to be fairly familiar with Unix permission statements and file management to accomplish the upload task, which is essentially a four step process. At this point a good book on Unix would not hurt. Also, you might check Unix Help and Getting your feet wet.
  1. Prepare your site by creating the appropriate directories.
  2. Chmod these directories 711
  3. Upload HTML and graphic files into the appropriate directories.
  4. chmod all files 644

Let us take a look at the permission issue. A snippet of the result of an ls -l command for my working directory is shown.

drwx------   2 flazarus faculty      512 Jul 24 16:22 class
-rw-------   1 flazarus faculty    49908 Jul 15 14:23 fabric.txt
drwx------   2 flazarus faculty      512 Jul 24 16:21 fwr
-rw-------   1 flazarus faculty     8087 Jul 19 17:29 good_mt1.txt
drwx------   2 flazarus faculty      512 Jul  6 02:14 junk
drwxr-xr-x   2 flazarus faculty      512 Jul 22 17:20 share
drwx------   2 flazarus faculty      512 Jun  9 16:12 tycho
drwx--x--x   9 flazarus faculty      512 Jul 26 00:08 www

The first column shows two things, whether the listing is for a (d)irectory or a (-)file and the access permissions (r)ead, (w)right, or e(x)ecute for the owner. The permission for two additional groups my group, faculty, and everyone else is also indicated.

Permission can be set using a variety constructs. Let us review the "absolute" permission construct which is so called perhaps because they are absolutely impossible to remember!

The Code: --- read permission = 4, write permission =2, execute permission =1, no permission =0

*** So making a table with an example:

chmod permission commands-directories
Owner Group Other
Read 4 0 0
Write 2 0 0
Execute 1 1 1
----- ------ ----- -----
Sum 7 1 1



  Then 'Polaris> chmod 711 directory_name'
   Where:

  • chmod = change mode
  • 711 = sets the "permission" for a directory that allows, you the owner, full read/wright/execute access to all files within a directory. All others have very limited access. They can neither read nor write files within the directory.




chmod permission commands-files





Owner Group Other
Read 4 4 4
Write 2 0 0
Execute 0 0 0
----- ------ ----- -----
Sum 6 4 4
  Then 'Polaris> chmod 644 file_name'
   Where:
  • chmod = change mode
  • 644 = sets the "permission" for a file allowing you, the owner, read/write access. All others are limited to read only. Since we are addressing only ascii files execution has no meaning. Only binary (compiled) program files need be 'executed.' Other program files, such as JavaScript or Perl files, are not compiled and remain in ascii format.




With this very brief introduction let me write a "cookbook". As you know I do not care much for this "keystroke" approach since it does not serve well, so please do check a Unix text.



Grant world execute access to your home directory.

$ cd (moves to your home directory.)
$ chmod 711 . (grants group and world execute access. Don't forget the "dot")
$ ls -ld (verify that the permissions have been set correctly)
e.g., drwx--x--x 6 flazarus faculty 1024 Jul 29 14:00

Create a child directory named "www" under you home directory. This is where you will place your index.html file (the top page of your Web site). Grant world execute access to this directory.

$ cd (moves to your home directory)
$ mkdir www (creates the www directory below your home directory)
$ chmod 711 www (grants group and world execute access)
$ ls -ld (verify that the permission has been set properly for www)
e.g., drwx--x--x 9 flazarus faculty 512 Jul 26 00:08 www

Create as many child directories beneath www as you may need to organize your pages, such as graphics, topic1, topic2, and so on. Grant world execute access to all these directories.

$ cd www (moves to your www directory)
$ mkdir graphics (creates a graphics directory)
$ chmod 711 graphics (grants group and world execute access.)
$ mkdir topic1 (creates a topic1 directory)
$ chmod 711 topic1 (grants group and world execute access)
$ ls -l (verify that the permission has been set properly for graphics, topic1 etc.)
e.g., drwx--x--x 8 flazarus faculty 512 Jul 29 10:08 graphics

Upload your HTML and graphic files to the appropriate directories. Edit these files as required. Grant world read access to all these files (chmod 644 file_name). Grant world access to all relevant directories (chmod 711 directory_name). Access your Web page via "http://computer.umuc.edu/~user_ID/".

For example you can access my home page via: http://polaris.umuc.edu/~flazarus/

Please forgive the small typeface. I wanted it all to fit within a small window while maintaining strong formatting for clarity.
Back to the Mechanics Index