Hey All,
I understand how file permissions work but i don't seem to understand how to correctly configure the Owner/Group.
When i upload files to my server with ftp the username is used for Owner AND Group. So i installed Drupal and want to set al file permissions correct. The problem is i now need to set some directories to 777 because Owner or Group is not apache (i guess).
Here below how drupal describes: (http://drupal.org/node/244924)
-------------------
(I'm assuming that greg user is part of greg group and that greg is the site owner)
[root@localhost]cd /path_to_drupal_installation
[root@localhost]chown -R greg:www-data .
[root@localhost]find . -type d -exec chmod u=rwx,g=rx,o= {} \;
[root@localhost]find . -type f -exec chmod u=rw,g=r,o= {} \;
[root@localhost]cd /path_to_drupal_installation/sites
[root@localhost]find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
[root@localhost]find . -name files -type d -exec find '{}' -type f \; | while read FILE; do chmod ug=rw,o= "$FILE"; done
[root@localhost]find . -name files -type d -exec find '{}' -type d \; | while read DIR; do chmod ug=rwx,o= "$DIR"; done
--------------------
So i now changed Group from username to apache, is this correct>secure?
(but Owner of the directory or file is still username)
It seems to work because i now can set directory to 775 and not the insecure 777, when i look in the directory i see files created with the Owner/Group apache.
And now when i upload new files with ftp i need to change the Group all the time, this doesn't seem to be normal? (i guess only if i need to give it write access)
I understand how file permissions work but i don't seem to understand how to correctly configure the Owner/Group.
When i upload files to my server with ftp the username is used for Owner AND Group. So i installed Drupal and want to set al file permissions correct. The problem is i now need to set some directories to 777 because Owner or Group is not apache (i guess).
Here below how drupal describes: (http://drupal.org/node/244924)
-------------------
(I'm assuming that greg user is part of greg group and that greg is the site owner)
[root@localhost]cd /path_to_drupal_installation
[root@localhost]chown -R greg:www-data .
[root@localhost]find . -type d -exec chmod u=rwx,g=rx,o= {} \;
[root@localhost]find . -type f -exec chmod u=rw,g=r,o= {} \;
[root@localhost]cd /path_to_drupal_installation/sites
[root@localhost]find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
[root@localhost]find . -name files -type d -exec find '{}' -type f \; | while read FILE; do chmod ug=rw,o= "$FILE"; done
[root@localhost]find . -name files -type d -exec find '{}' -type d \; | while read DIR; do chmod ug=rwx,o= "$DIR"; done
--------------------
So i now changed Group from username to apache, is this correct>secure?
(but Owner of the directory or file is still username)
It seems to work because i now can set directory to 775 and not the insecure 777, when i look in the directory i see files created with the Owner/Group apache.
And now when i upload new files with ftp i need to change the Group all the time, this doesn't seem to be normal? (i guess only if i need to give it write access)