There are upcoming maintenance events which may impact our services. Learn more

Magento says Your web server is set up incorrectly and allows unauthorized access to sensitive files. Print

  • 1

Problem Description

When logged in to Magento 2, it indicates: "Your web server is set up incorrectly and allows unauthorized access to sensitive files."

Magento generates this error based on the permissions set on the app/etc folder and the files within.

Problem Resolution

There are many guides showing how to resolve this on other platforms, so ours will focus on Plesk hosting.

Here's how to fix it such that all permissions are set correctly throughout your Magento system using shell. WEBSITE_ROOT for your primary domain is likely httpdocs and for other domains it will likely be the domain name itself. Your username will be the same username you see in shell for all files within httpdocs. A quicker version of this is to just run the last two commands.

cd {WEBSITE_ROOT}
chown -R {USERNAME}:psacln *
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod u+x bin/magento
chmod 700 app/etc
chmod 600 app/etc/*.php

Was this answer helpful?

← Back