Hi Everyone,
I have successfully installed Magento 2, however I am going through my error logs to find 403 errors to symbolic links. I cannot change the symbolic link permissions or ownership and they are stuck on 777. How can I change the permissions for these and why would they be 777. I am running Centos 7, Apache, php 7.0.2, MariaDB 10
Error eg
403 GET /pub/static/adminhtml/Magento/backend/en_US/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css HTTP/1.1
Thanks in advance
Solved! Go to Solution.
Hi Stuart, thanks for the reply. After a couple of weeks of trying to work out why the permissions are not correct, it seems that Plesk for some reason changes group ownerships for new files itself even though everything is setup correctly. I have found a work around for this by using sticky permissions
find var -type d -exec chmod g+s {} \;
I did this for all folders in the root directory and it works perfectly. Any new files created have the same permissions as the root folder they are in. This may help someone trying to install Magento though Plesk 12.5 as it worked for me.
I have also noticed that any new files or folders created have the wrong permissions. I have to manually update them. How would I set default permissions for new files and folders? I’m wondering if changing this will fix the issue above.
Thanks in advance
Thanks for the link once again. I have read through all this already and I have done everything required. I have successful installed it and it works fine, however any new files added are to the wrong owner and sym links I can’t change at all and I don’t know why. The document says “The base directory is typically a subdirectory named magento2” I have installed magento into httpdocs root folder as I didn’t think this would cause any issues.
Is there anyone else with any ideas why this might be happening? I am a web developer with a good knowledge of SSH but I’m no expert.
Also it says “The owner of the Magento file system: Must have full control (read/write/execute) of all files and directories.” However underneath it says Set permissions with :
find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento
Shouldn’t the 660 be 760
Any help would be appricated.
I have installed this a dozen times and followed the instruction but I think Plesk is changing the file group to psacln. When I load the server through WinSCP and transfer files the across permissions are correct but new files created have permission group to psacln.
Unlike normal files/folders symlinks need to be told specifically that you want to change their owners/permissions else you are simple changing the owner/permissions on the linked file or folder.
-h If the file is a symbolic link, change the mode of the link itself rather than the file that the link points to.
As such you need to use the following commands:
chmod -h XXX /path/to/symlink chown -h XXX /path/to/symlink
Hi Stuart, thanks for the reply. After a couple of weeks of trying to work out why the permissions are not correct, it seems that Plesk for some reason changes group ownerships for new files itself even though everything is setup correctly. I have found a work around for this by using sticky permissions
find var -type d -exec chmod g+s {} \;
I did this for all folders in the root directory and it works perfectly. Any new files created have the same permissions as the root folder they are in. This may help someone trying to install Magento though Plesk 12.5 as it worked for me.