File and folder permissions for Magento setup

The command chmod o+w will add writes for other. Since file permissions are user, group and other respectively, this will actually change the file permissions to be 646 and 757 respectively. In my opinion these are odd permissions for those particular files, but note that the wiki explicitly states if PHP is running as a module. Since the installer generates local.xml in the app/etc folder and possibly generates the .htaccess file (it's been that long since I've done a fresh install, I can't remember), the purpose behind this would therefore seemingly be for if the installer is running as a user that is neither the owner nor in the group for the files.


In conclusion:

If you wan't to ensure that your files are secure, you have to first find out what server API your PHP is using. You can find this by creating a phpinfo-page on your webserver. If your API is CGI/FastCGI as mine the following permissions seems like the right way to go:

Folder permissions:   755
File permissions      644
Mage permissions:     550

As pointed out by Cags, there is a newer knowledge-base post suggesting folder permissions to be set to 700 and file permissions to be set to 600. I tried these permissions, however my site did not work afterwards.