Issue
i don't know how to chmod files
after typing # ls -al /var/www/html
i get this :
- drwxr-xr-x. 2 root root 4096 Feb 25 23:23 .
- drwxr-xr-x. 6 root root 4096 Feb 25 21:27 ..
- -rw-r--r--. 1 root root 34 Feb 25 23:26 index.php
this time being my second time trying to install LAMP on Fedora 15 with the first time ended up reinstall the whole system because i mis-chmod some files
new to linux so please bear with me and be specific
and also first time post my question up here
thx in advance
Solution
chmod
is a command used to change the permissions of files in UNIX. While typing ls -al /var/www/html
you get a list of files (and hidden files because of the a
option) and the permissions they have.
drwxr-xr-x. 2 root root 4096 Feb 25 23:23 .
drwxr-xr-x. 6 root root 4096 Feb 25 21:27 ..
-rw-r--r--. 1 root root 34 Feb 25 23:26 index.php
It can be seen as: ooogggrrr
meaning o
owner of the file, g
group of the owner and r
rest of users. Each field can be r/- (value 4), w/- (value 2) and x/- (value 1), meaning read, write and execute.
Then, if you want a file to *ch*ange the *mod*es, you have to do chmod XXX file, where each X corresponds to one group.
So if you want a file to be written, read and executed by the owner, you need 4+2+1=7 permission. We normally set 755 permissions to files in webservers, so that all users can access to all contents, but just the owner can write in there.
So, to sum up, if you have to chmod files on your fedora, you have to give more permissions to the files in a certain directory.
Answered By - fedorqui Answer Checked By - Dawn Plyler (WPSolving Volunteer)