[CentOS] how to make centos safty(php+mysql)

Mon Feb 28 18:58:34 UTC 2011
Cameron Kerr <cameron at humbledown.org>

On 1/03/2011, at 4:51 AM, Yang Yang wrote:

> hi,every
> 
> i have a php project and use centos to go
> 
> and how to make folder's privilage and make it saft
> 
> like: /home/htdocs/test
> 
> chown -R www:www /home/htdocs/test
> 
> chmod -R 644 /home/htdocs/test

Almost correct, but directories also need the 'execute' permission. 644 for files, 755 for directories.

chmod 755 /home/htdocs/test/


You seem new to this, so I should also point you to the following, which will give you a good head-start.

http://phpsec.org/projects/guide/
http://www.owasp.org/index.php/Main_Page

and this is a tutorial for PHP in a Chinese context, although on a Windows platform.

http://www.herongyang.com/PHP-Chinese/

再见!
胡鑫