Apache web server for windows - Chapter 2 . Running Commands from the Shell

Chapter 2 . Running Commands from the Shell 69 You can also turn file permissions on and off using plus (+) and minus ( ) signs, respectively. This can be done for the owner user (u), owner group (g), others (o), and all users (a). For example, start with a file that has all permissions open (rwxrwxrwx). Run the following chmod commands using minus sign options. The resulting permissions are shown to the right of each command: chmod a-w file r-xr-xr-x chmod o-x file rwsrwsrwchmod go-rwx file rwx—— Likewise, here are some examples, starting with all permissions closed (———) where the plus sign is used with chmod to turn permissions on: chmod u+rw files rw——- chmod a+x files –x–x–x chmod ug+rx files r-xr-x— When you create a file, it s given the permission rw-r–r– by default. A directory is given the permission rwxr-xr-x. These default values are determined by the value of umask. Type umask to see what your umask value is. For example: $ umask 022 The umask value masks the permissions value of 666 for a file and 777 for a directory. The umask value of 022 results in permission for a directory of 755 (rwxr-xr-x). That same umask results in a file permission of 644 (rw-r–r–). (Execute permissions are off by default for regular files.) Time saver: use the -R options of chmod, to change the permission for all of the files and directories within a directory structure at once. For example, if you wanted to open permissions completely to all files and directories in the /tmp/test directory, you could type the following: $ chmod -R 777 /tmp/test This command line runs chmod recursively (-R) for the /tmp/test directory, as well as any files or directories that exist below that point in the file system (for example, /tmp/test/hat, /tmp/test/hat/caps, and so on). All would be set to 777 (full read/write/execute permissions). This is not something you would do on an important directory on a read/write file system. However, you might do this before you create a directory structure on a CD-ROM that you want to be fully readable and executable to someone using the CD-ROM later. The -R option of chmod works best if you are opening permissions completely or adding execute permission (as well as the appropriate read/write permission). The reason is that if you turn off execute permission recursively, you close off your capability to change to any directory in that structure. For example, chmod -R 644 /tmp/test turns off execute permission for the /tmp/test directory, and then fails to change any files or directories below that point. Caution Tip
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply