|
Unix for Web PublishersFile Systems
All Unix machines (including athena) store data much like
regular PC and MAC operating systems. Both use files and
directories containing files. The main differences are that
people log on to athena over the network to browse its hard
drives instead of sitting right in front of the machine,
and that the hard drives are laid out differently.
Everything in Unix starts at the root directory or slash
(/'). This kind of equates to c:\ (on a PC) or the desktop
(on the Macintosh). There are many directories off of this
directory. Each directory has an owner and group to which
it belongs. Most of the system level stuff belongs to a
user called root. This is the system administrator account
from which the Unix system is configured and maintained.
The critical directories for web publishers to use are
~/www' and /www'. These are where group and individual
pages are stashed. The tilde tells Unix that you are
referring to your home directory (kind of like the root
folder of your own personal hard drive). Any time you type
"
Getting around in File Systems
The ` ls -l" the output might look like:
drwx------ 6 khhaga01 it 2048 Sep 16 12:36 Mail
drwx------ 2 khhaga01 it 96 Apr 22 1995 News
drwxr-xr-x 6 khhaga01 it 3072 Sep 13 13:07 bin
-rw------- 1 khhaga01 it 4111 Mar 17 1996 country.txt
-rw-r--r-- 1 khhaga01 it 24615 Apr 1 15:03 internet.txt
drwx--x--x 18 khhaga01 it 5120 Sep 5 15:34 www
Looking at the listing above will show the basics behind
navigating Unix.
drwx--x--x 18 khhaga01 it 5120 Sep 5 15:34 www
|\ /\ /\ / | \ / \/ \ / \ / \ /
| | | | | owner group size date changed name
| | | | |
| | | | Number of directories within this file/directory
| | | |
| | | Everyone else's rights
| | |
| | Group's rights
| |
| Owner's rights
|
File type
Mail, News, and www all began the line with a
"
Chmod for those using an FTP programChmod can also be run from most FTP clients to enable people to change file permissions without logging in to the Unix shell. This is done with binary numbers that can seem intimidating at first, but are easy to jot down or remember. The basic rule of thumb is that every file has three numbers for its permissions all seven or below. The first number is for user, the second for group, and the third for none of the above. The way the numbers are added is as follows:
+------------------ 0400 read by owner
| +---------------- 0200 write by owner
| | +-------------- 0100 execute/search by owner
| | | +------------ 0040 read by group
| | | | +---------- 0020 write by group
| | | | | +-------- 0010 execute/search by group
| | | | | | +------ 0004 read by others
| | | | | | | +---- 0002 write by others
| | | | | | | | +-- 0001 execute/search by others
| | | | | | | | |
r w x r w x r w x
If one adds all of the numbers for user, all of the numbers for group, and all of the numbers for other, one comes up with 777. When a certain permission is to be left off, simply subtract that number. A better www directory permission would be:
That would remove write permissions for everyone but the owner. Common Settings to remember:
Settings for those creating unit/departmental pages
MAC Users using FTPMacintosh users using Fetch to FTP their files up to athena can set permissions by selecting the file on athena (in the Fetch window) and then selecting "Change Permissions" from the Remote menu in Fetch. Fetch will then present an array of select boxes from which the user can select the appropriate permissions. Logging in through the shell may still be necessary to set directory permissions for departmental/unit pages. This is only necessary when creating new directories, however. The umask commandFor those tired of changing the permissions on every single file uploaded to athena, the umask command can be handy. One's umask is magical number that is subtracted from 777 to set the permissions for all new files created. When one changes a umask, all new files have those new permissions. Typing umask by itself will reveal one's current umask. To change it, simply type:
Where ### is a string of numbers. Be careful with umask
since one can prevent even a file's owner from being able
to open it with a prohibitive umask like 777. A very
common umask for those using athena just for web pages is
WS_FTP (the ftp program in ULNET software) users can set their umask in the session settings for Athena. There are step by step instructions about this here. MAC Users using FTPFetch allows users to set a umask at the beginning of the session. To do this, one should simply click on "Set Upload Permissions" in the remote menu before any files have been uploaded. This will give all uploaded files the same permissions for that session of Fetch. This can save time during large site updates. Creating/editing files and making new directoriesOnce navigation, changing permissions, and getting listings seems to be tolerable, one can begin easily creating files and directories. The mkdir command creates a directory wherever you tell it to. The ee command will create a new file or open an existing file and let you edit it. Hitting [escape] in ee brings up the menu of commands and a means of exiting the program. If ee is no fun as an editor, pico, emacs, and vi are also available but are MUCH more cryptic than ee (pico is the easiest of the three). With any editor, simply type the editor's name and the filename and it will open the file for you.
|