About us Privacy Disclaimer Contact us
FAQ Help Advertising Feedback
Home Sitemap Search Donate us

  Home > Computer & I'net > CHMOD...

   Browse by title articles:
   What is hot:

Perl/CGI Intro

CHMOD

Perl Basics

Scalar Data

Quotes

Uploading

Know linux
Avoid Spam Emails by using JavaScript
5 Ways to Speed Up Your PC
How to Create an Emergency Repair Disk
 1 23456Next articles



CHMOD


Computer & I'net articlesCHMOD

by David Stanley    



The first part you will need to do is adjust the "permissions" of the folder that will contain your PERL scripts. That means you will "allow" a script to be "executed" from this specific place.

Normally the folder permissions are set to view (read) only. You can view web pages, images, animated things, movies, etc... We've now moved into an area where a script will need to be run (executed). Many free hosing sites will probably not have this available since running a script may be viewed as a virus. The security risk is too high. But... since you have come this far, I will presume you have access to a personal cgi-bin for your site or you are able to set permissions. Onward...

Permissions are set using a command called CHMOD. CHMOD stands for CHange MODe. You are giving the host computer new instructions about this file (folder).

The CHMOD comes as a set of 3 numbers. Each of these 3 numbers is a sum total of 3 other numbers. So you have to add 3 numbers to get the first CHMOD number, add 3 numbers to get the second CHMOD number and add 3 numbers to get the third CHMOD number. Most PERL areas will need a CHMOD setting of 755 or 777 (depending on the script you are using).

Understanding the numbers.

Each digit is a number value from 0 to 7. The value specifies what capabilities are available (or not). These numbers correspond to 3 command types. Read, write and execute.

Read (r) has a value of 4. It allows listing files in the directory.
Write (w) has a value of 2. It allows the addition of new files to the directory.
Execute (x) has a value of 1. It allows access to the files in the directory.

Here are the possible combinations available using these command types :

Digit rwx Result
0 --- no access
1 --x execute
2 -w- write
3 -wx write and execute
4 r-- read
5 r-x read and execute
6 rw- read and write
7 rwx read write execute



OK... so you know each digit will be a number from 0 to 7, but what does the 3 digits stand for?

The first number represents the host server. This will usually be set to 7 giving the host full permission on the files in the folder. The second number represents the group (YOU - the individual being hosted). And the third number represents the world (the visitors to the site). Normally, on free hosts, these two digits will be set to 4, allowing the reading (and displaying) of files. Thus, no executing capabilities.

Typical settings for files are 777, 755, 666 or 644.
Typical settings for directories are 777 or 755.
Cgi scripts 755, data files 666, and configuration files 644.

How do you change the CHMOD?

The easiest way (for a user) is by using an FTP program. Most FTP programs have a button or right-click menu that allows you to set the CHMOD on a specific folder. You may have to contact your host to find an alternate way of doing this.




-----------------

Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.






Articles

Auto & Trucks

Business

Computer & I'net

  ·General

  ·Apache

  ·CSS

  ·Database

  ·Hardware

  ·HTML

  ·Javascript&DHTML

  ·Linux

  ·MySQL

  ·Operating System

Perl / CGI

  ·PHP

  ·Programming

  ·Publishing

  ·Search Engines

  ·Software Problems

  ·SSI

  ·Tips & Tricks

  ·Utilities

  ·Web Design

Family

Food & Drink

Gardening

Health

Other

Pets

Psychology

Spiritual

Travel

Women

 Calculators

Capital gain




  Disclaimer | Privacy | Terms of useCopyright © 2004 Nice2know.com