cancel
Showing results for 
Search instead for 
Did you mean: 

Folder Premission

Folder Premission

Hello,

we are try to test magento2 on running a plesk v12 Server.

After install magento 2 we get some trouble with folder premission. If Magento2 create a new folder it will get premission 770 but if we try review magento2 page we cant see any JS and any CSS. If we change folder premission to 755 it will working. But if magento2 create a new folder it will get everytime 770. Did anyone know how we can solve this issue?

 

Best regards,
Sebastian

7 REPLIES

Re: Folder Premission

I also had to deal with this an hour ago, lucky you! Can't trace back where I got this info but there you go.

 

You can change the permission level that Magento 'automatically' sets on new folders & files.

 

Location:

 

/vendor/magento/framework/Filesystem/DriverInterface.php
(WRITEABLE_DIRECTORY_MODE and WRITEABLE_FILE_MODE)

 

/lib/internal/Cm/Cache/Backend/File.php
(directory_mode and file_mode)

Re: Folder Premission

Hello,

thank you for fast reply.

I had change this.

But if this the best solution?

What happen if we update magento version?

Did magento really need 644 and 755?

 

Best regards,

Sebastian

Re: Folder Premission

No worries!

 

A dirty workaround indeed but it works great in terms of 'efficiency'. Secured-wise; do not take my word for it (use at your own risks). Personally I have no idea what this platform secures onto (yet anyway) and still investigating the security implications of giving such perms myself. If I find anything concrete I'll post back here mate.

 

You also have the magento's recommended 770 & 660 options... if of course you'd like to shut down your site entirely LOLL

 

RE your question; I have no idea what happen when the site gets updated. I'm guessing the files will be overwritten so keep notes of where to do the code changes (again) after future updates

 

tc

 

Re: Folder Premission

Hello,

ok it would be great.
We also get this error: "Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider. "

How we can solve it? Which files we need change?

Re: Folder Premission

Wow, which hosting provider are you hosting your store with???

 

I'm guessing the msg you are getting is from Magento? I have these perms on my DEV store and yet to see any warnings. In fact I'd rather see the auth warning in all honesty... where you get this message from?

 

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento


pub: find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \;


var: find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \;

 

app/etc: find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \;

 

install, then
app/etc: find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \;

Re: Folder Premission

Hi,

this message will display after login backend magento...Smiley Sad

How we can solve it?

It only cause if we are using FPM insted of FASTCGI

Re: Folder Premission

It is not recommended that core files is changed as they may be changed/replaced by later update of Magento.

 

There are some known issuses regarding permissions on servers that have Suphp installed. Please advice to the installation documentation and also look at the github for following the topic for a solution for this.

 

Permission Issues I

Permission Issues II