Datasheet
884
Managing a Remote Site
Understanding file permissions
Most hosting services use Linux or Unix. These operating systems have a
more sophisticated file permission mechanism than the Windows file system
does. At some point, you may need to manipulate file permissions.
Essentially, the universe is divided into three populations: Yourself, your
group, and everybody else. You can allow each group to have different kinds
of permission for each file. Each of the permissions is a Boolean (true or
false) value:
✦ Read permission: The file can be read. Typically, you want everybody
to be able to read your files, or else you wouldn’t put them on the Web
server.
✦ Write permission: The file can be written, changed, and deleted.
Obviously, only you should have the ability to write to your files.
✦ Execute permission: Indicates that the file is an executable program or
a directory that can be passed through. Normally, none of your files is
considered executable, although all your directories are.
Using FTP to manage your site
Most of the work is done on a local machine and then sent to the server in
a big batch. (That’s how I did everything in this book.) The standard Web-
based file management tools are pretty frustrating when you want to effi-
ciently upload a large number of files.
Permissions are typically treated as binary
numbers: 111 means “read, write, execute.”
This (111 value) is also a 7 permission because
111 binary translates to 7 in base ten (or base
eight, but let’s skip that detail for now).
A permission is read as three digits, each one a
number indicating the permissions, so 644 per-
mission means rw- r-- r--. This example
can be translated as “The owner should be
able to read and write this file. Everyone else
can read it. Nobody can execute it.”
If you don’t understand this concept, don’t
worry about it. The guidelines are very simple:
Make sure that each of your files has 644 per-
mission and that each directory has 755 per-
mission. That’s all you really need to know.
What’s with all the permissions?
53_9780470537558-bk08ch01.indd 88453_9780470537558-bk08ch01.indd 884 10/7/10 8:58 PM10/7/10 8:58 PM