Basher52 wrote:i got a follow up question, to set maximum protection against hacking etc unless using .htaccess and other things, should/could i 'chown' all files and folder to the group/user 'apache'.
Absolutely not. That's the absolute worst thing you can do for security. The funny part about this is I have seen tutorials that tell you to do just that. I have to send the authors of such tutorials messages ripping them a new one when I see it.
Think about what happens if someone were to exploit a buffer overflow in your Apache daemon and gain a shell. Or even easier, exploit a vulnerability in one of your many PHP or any other CGI script. What UserID will this shell be running under? That's right, the user "apache". Now, if you are logged on as the user "apache" what files and directories can you write to and what files can't you write to? Obviously anything owned by the user "apache" is fair game and expect a defacing right off the bat, if you're lucky that is. So believe it or not it is *most* secure if the directories/files are owned by root and only have read permission wherever possible. Give the minimum amount of permissions that you possibly can.
To tell you the truth I usually set the ownership to my personal local user account (e.g. voidmain) on directories that I personally want to work. That way I can log on as user voidmain and make any changes necessary to files in my web directories and not have to switch user to root, AND the apache user doesn't have permission to write/change anything. That's probably the optimal way to do it.
So most directories are set owner:group voidmain:voidmain and rwxr-xr-x and most files are voidmain:voidmain rw-r--r--. In this case someone would have to either get access to my local "voidmain" account or "root" before anything could be changed. I really prefer to set my machines up so I don't have to become root for normal development/web type stuff.