My friend and I built a server and run it out of the data center he works in. Its more for fun than anything else since all the websites we run get virtually no traffic. So while security for us isn't a huge thing, I still want to learn more about it so we don't have problems in the future. We are running the latest Ubuntu.
One of the problems we have consistently had is the file permissions. When I upload new files via FTP, the default permission setting is 600. Then I have to manually change the permissions to 775 or 777 to be able to view the files in the browser.
Question 1:
I know setting them to 777 is not the correct setting, so what should I be setting them at? Should different types of files have different settings?
Question 2:
How do I change the server so that the correct file permissions as assigned by default? Someone told me to change the umask settings, but that doesn't seem to do anything for files created via FTP.