I know there is a lot of talk about security involving any CMS these days. Especially between Joomla, Drupal and Wordpress. Everyone keeps saying 777 is bad, you should never use it because it is a security risk and your site will get hacked. Well that may be true, but most of these people never provide a solution. All they say is your directories should be 755. On many php installs this means only apache can wright to these folders. So if you try to upload a theme, component, module or plugin from your CMS it will fail. That is why so many people have to set directories to 777 in order for things to work properly. Before doing any of the below create a backup first!
If you are using Plesk there is an easy but not well documented solution. Apache suEXEC must be installed for this to work properly, but if you are using plesk it most likely is already running. http://httpd.apache.org/docs/1.3/suexec.html
Go to Domains > yourdomain.com > Web Hosting Settings. Scroll down to PHP support. Make sure ‘safe_mode’ is unchecked then select FastCGI application. This FastCGI is much different and faster than CGI. Also this should be much quicker than using suPHP which would be the other option to fixing permissions issues.

You may have to restart Apache before everything works correctly. After turning this on my site had errors and would not run. Turns out I had some ownership issues. I ran a chown from the command line which returned ownership to the ftp user. Everything worked great after this. You can now change your 777 directories to 755.
If you have SSH shell access the following commands can be run from the command line to reset all files and directories back to the server defaults of 755 and 644. Change directories to the top directory (" / ") of your Joomla! installation, then run:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
For more infomation on Joomla and permissions: http://docs.joomla.org/How_do_UNIX_file_permissions_work%3F
