|
|
INSTALLING PERL SCRIPTS & CHANGING FILE PERMISSIONS 
This page explains how to set file permissions for the three most common type of web files:
Pages (.html .php), Scripts (.cgi .pl) Data Files (.txt .dat) and Config Files (.pl .cfg)
If you're new to installing Perl Scripts, or getting the dreaded: "500 - Internal Server Error"
when you try to execute and run a script package you have downloaded, Start Here . . .
If you have to, download and unzip the entire script package and start over. To keep things simple, let's make the following Ground Rules and Affirmations:
- NUMBER 1 PRIORITY RULE (Ignore this, get nowhere on UNIX / Linux Server Hosting.)
ALL Scripting Files must be uploaded using an FTP Client in the ASCII Only Mode
to the Hosting Server!
Uploading them as BINARY will destroy the UNIX / Linux line returns; not a good thing.
NOTE: Avoid and save yourself trouble in the future; Use a PLAIN TEXT EDITOR like NotePad or Note Tab Pro when you edit and or configure your script files. Do Not use Microsoft FrontPage, Macromedia Dreamweaver, Adobe GoLive etc... to edit or upload your scripts.
- NUMBER 2 PRIORITY RULE
ALL Scripting Files include a readme.txt file or have instruction configurations inside the script itself. READ AND FOLLOW these instructions STEP BY STEP.
If you have to, . . . print them out and check off each step as you complete them!
(Nothing beats following the installation instructions.)
Server Directories default normally to: 755
HTML Pages and Images should be: 644
6 readable / writable by the Owner,
4 readable by the Group,
and
4 readable by Other web visitors.
One exception to this is .html pages that have to be re-written and updated by a script.
In that case apply preferably 777 or 766 permission level, both directory & file.
Another exception is images sometimes have to be 755 for the script to load them.
Executable Perl Scripts and Executable Directories should be: 755
7 readable / writable / executable by the Owner,
5 readable / executable by the Group,
and
5 readable / executable by Other web visitors.
Data & Configuration files should be: preferably 766 or 777, both directory & file.
7 readable / writable / executable by the Owner,
6 readable / writable by the Group,
and
6 readable / writable by Other web visitors.
And also, lets use the following Permissions Abbreviations:
- drwxr-xr-x ("d" indicates a directory folder) = 755 folder has executable permissions.
- drwxrw-rw- ("d" indicates a directory folder) = 766 folder has write to files permissions.
- --- (or 0) = no
permission.
- r-- (or 4) = read-only permission.
- r-x (or 5) = read / execute permission.
- rw- (or 6) = read / write permission.
- rwx (or 7) = read / write / execute permission.
Sometimes you'll see these numbers referenced for a script configuration. For instance:
chmod your script to "755" or "777".
"755" means set file permissions to:
"Read - Write - Execute / Read - Execute / Read - Execute".
"777" means set file permissions to:
"Read - Write - Execute / Read - Write - Execute / Read - Write - Execute".
"755" is in fact the most common setting for CGI / Perl scripts:
If your script does not work or you get an "Internal Server Error" when you run it try this first.
Practice Pad:
To access changing file permissions using your WS_FTP Software:
FTP Session Log into your account and go to the directory where the files are located.
- Highlight the file that you want to change permission.
- Locate the "File Permissions", "FTP Commands" or "chmod" command in your
WS_FTP Software - this is normally under the right mouse click of the highlighted file.
(if you are using a different FTP Client Software refer to the manual or help file.)
WS_FTP Light Edition Menu
right click -> chmod [ UNIX ]
|
WS_FTP Professional Menu
right click -> FTP Commands
|
To change file permissions using your FTP software:
There should be three groups. Each group should have either checkboxes, a numerical input area or a selection for the permission type.
- set pages to rw- for the
Owner, r-- for the Group, and r-- for Other.
- set scripts to rwx for the Owner, r-x for the Group, and r-x for Other.
- set data / configuration files to rwx for the Owner, rw- for the Group, and rw- for Other.
- --- (or 0) = no
permission.
- r-- (or 4) = read only permission.
- r-x (or 5) = read / execute permission.
- rw- (or 6) = read / write permission.
- rwx (or 7) = read / write / execute permission.
- rw-rw-rw- (or 666) = All read/write for Owner, Group and Other permission and should NEVER be used, it makes your file too vulnerable.
Many scripts will instruct you in the readme to make a file permission of 666 for a writable file or directory. The permission of 766 or even 777 is much safer security. (not to mention that some servers will lock you out at 666 permission levels, so just don't use it.)
WS_FTP Light Edition Menu
showing permissions level of 644
|
WS_FTP Professional Menu
showing permissions level of 755
|
We host all our clients with Bluehost and fully recommend their services.
|
|
|
|