Magento – Internal server error when setting full permissions

downloadermagento-1.9permissions

I am working on magento 1.9.x. I have currently moved my local project instance to new server.
When I go to Connect Manager(/downloader), it gives warning message saying, "Warning: Your Magento folder does not have sufficient write permissions.".

After some research, I had tried with putting 777 permissions to root directory, but due to which it gives Internal Server Error and none of the page works.

If I just put 777 to downloader directory only, then Magento Connect Manager redirects to 404 page. I didn't understand why this happens on this server.

Is there any issue with server configuration or do I need to give permissions to any other directory as well?

Best Answer

Depending on your server configuration and running webusers you need to setup write access to some directories. All other files should be read only to the webuser! This will make sure your website isn't defaced easily.

First of all, there are a lot of reasons to not have a /downloader directory on production environments. There have been some patches in the past for the downloader. Add some sort of security with basic auth on these directories

First of all, reset all to read only/default.

# In your Magento root directory
# This will put all files in readonly for group/other and write for user
chmod ugo-rwx,ugo+rX,u+w -R .

# Some files need execute rights
chmod +x cron.sh mage

# Some directories need write access
chmod go+w -R media var downloader includes

Also remove downloader/connect.cfg so it will re-initiate.

Related Topic