[an error occurred while processing this directive]
When you create your CGI programs, you will need to change the access privileges to that they can be executed from a web page. To do this, you will use the chmod command. The chmod command has 2 properties, who will have privileges, and which privileges will they have.
1. Who will have privileges?
There are 3 categories of who can have privileges, the User, the
Group, and Others.
They are represented by the letters u, g, and o. Also the letter 'a' can represent All the categories together.
2. What privileges can people have?
There are also 3 types of privileges: Read, Write, and eXecute,
represented by the letters r, w, and x.
Privileges are assigned with an equals sign (=r, or =rw, or =rx), or added with a plus sign (+r, or +rwx), or subtracted with a minus (-w, or -rwx)
3. How do I type the command? For most CGI programs, I want to give read and execute privileges to the world, but not write, so that no one can delete or edit my program. This is the most common command:
chmod a+rx filename.cgi
This means add the ability to read and execute to everyone. When I first create a file, I have full read, write, execute privileges, but no one else has anything. This command gives the world the ability to run my program.
SHORTCUT: You can also type a single digit number for user,group,others. Add these values for each usertype: Read=4 Write=2 Execute=1 To allow yourself all privilages, and everyone else can read and execute (most common) chmod 755 filename.type To allow everyone all privilages use: 777 To allow yourself to read and write, and other can only read: 644 |
Try this example. You are still in the myfolder folder.
Try this matching game
1. Add Execute to Group users |
a) chmod g=rw filename.txt |
|
2. Remove Write from everyone |
b) chmod o-r filename.txt |
|
3. Everyone has only Read and Execute |
c) chmod a+rx filename.txt |
|
4. Add Read and Execute to everyone |
d) chmod g+x filename.txt |
|
5. Remove Write from others and group |
e) chmod a-w filename.txt |
|
6. Remove Execute from user |
f) chmod a+r filename.txt |
|
7. Group has only Read and Write. |
g) chmod go-w filename.txt |
|
8. Add Read to everyone |
h) chmod a=rx filename. txt |
|
9. Remove read from others |
i) chmod u-x filename.txt |
Here is the answer key:
1 - d
2 - e
3 - h
4 - c
5 - g
6 - i
7 - a
8 - f
9 - b
The chmod | Locating Perl Program | emacs editor |