My server is centos 7
,with php 5.4
,apache 2.4
.
My website locate in /var/www
.
As for apache
is the only one user read or write in /var/www
,I set all files and folders owner and group to apache
:
For the folders and files read only:-r------- 1 apache apache 922 Jun 3 2014 connect.php
For the files need to be write:-rw------- 1 apache apache 922 Jun 3 2014 connect.php
Which means only 600
or 400
for files permission.(*.php need not x
permission)
As to folders permission, only 500
or 700
.
This should be the best practice, because provide permission as little ad possible.
Is there any security issue?