0

I changed my site (shared hosting) permission following the link here: http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html

find . -type f -exec chmod 400 {} \;
find . -type d -exec chmod 500 {} \; 
find var/ -type f -exec chmod 600 {} \; 
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \; 
find media/ -type d -exec chmod 700 {} \;
chmod 700 includes
chmod 600 includes/config.php

After doing this, I get the error:

You don't have permission to access /mymagentofolder/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

How can I resolve, and what are the correct permissions to have?

Thanks

egg
  • 499
  • 7
  • 26
  • make sure that files owned by the same user who runs the server/php, and dont forget about parent folder /var/www/-> html /magento/ – MagenX Mar 04 '16 at 19:35

1 Answers1

1

most likely, you are accessing the site with a different user then the webserver. Also, in shared hosting, it's common practice that the webserver and the php process also have different users.

To ensure, that still all users have access to the files, they should be in one group with all users are assigned to.

The permissions you posted above, only allow the actual assigned user to access the files. To ensure, that all users in the group have access, you most likely have to give the group the same permissions as the user.

You can try the following:

find . -type f -exec chmod 440 {} \;
find . -type d -exec chmod 550 {} \; 
find var/ -type f -exec chmod 660 {} \; 
find media/ -type f -exec chmod 660 {} \;
find var/ -type d -exec chmod 770 {} \; 
find media/ -type d -exec chmod 770 {} \;
chmod 770 includes
chmod 660 includes/config.php
David Verholen
  • 6,312
  • 1
  • 20
  • 38
  • 1
    then i would need additional information to solve your issue. you have to ensure that the webserver, php process (if not integrated in the webserver) and your own user can access all files (while webserver and php mostly need only read permissions and your user should have write permissions) but still have to protect some critical files like for example app/etc/local.xml. So it would be important to know: The user you are accessing the files with, The user the webserver uses and the user the php process uses (could be the same as the webserver). Additionally if they are in a common group – David Verholen Mar 04 '16 at 17:24
  • in the end, I've reset the permissions to 755/644, and it works. I'm going to gather the information you mentioned when I have more time. I obviously have something to learn there. – egg Mar 07 '16 at 14:11