PERL CGI Tutorial for Writing Interactive Form Scripts
File Permissions
The purpose of File Permissions is to limit the access of files by web visitors.
You can't set file permissions from a Windows environment.
File permissions may be set after you upload to your web space. Some servers will set them automatically for you. For those that don't, you will have to search the CGI help files that your web host provides.
Note: PERL scripts must be saved in your cgi-bin folder.
Some FTP Client programs include a CHMOD (Change Mode) feature for setting file permissions.
Cute FTP is one that does. To access CHMOD using Cute, right click on the script in the cgi-bin directory.
For the page to be available to users the script must be set to execute for users.
There will be a line of characters separated into 3 groups displayed beside the filename that look something like:
For a script:
-rwx r-x r-x
For directory:
drwx r-x r- x
There are 3 groups of 3 characters.
The individual characters are:
d = directory
leading - = file
- = denied
r = read
w = write
x = execute
For any group: r - x would mean read allowed, write denied, execute allowed
The left group is for you.
The middle group is for your group.
The right group is for your users.
The right most user settings should be set to r-x. For read and execute.
Some CHMOD devices will require you to enter an octal code.
Settings of 0715, 0745, 0755 will usually get the job done.
0755 or 755 is usually the preferred setting
Octal settings:
Read=4
Write=2
Execute=1
Combinations of the three values produce the octal code settings.
7=read,write,execute
6=read,write
5=read,execute
4=read
3=write,execute
2=write
1=execute
0=denied
Once again the left digit, (forget the leading zero)
is for you the owner.
The middle is for the owner's group.
The right digit is for your users or visitors.
When you first upload your forms and scripts, and they produce an internal error, this is the first place to look.
See Troubleshooting Scripts
|