cancel
Showing results for 
Search instead for 
Did you mean: 

Unauthorized access to sensitive files

Unauthorized access to sensitive files

Hello, i installed a new Magento 2.3 on a new machine and i am getting this Warning

I Already tried to set Permissions and etc, does anyone know the correct way to do this?

 

Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider.

 

12 REPLIES 12

Re: Unauthorized access to sensitive files

@eCom_Microware  You may be running your website outside of the Pub folder. Document root for your website in your virtual host must be pointing to pub folder. This must fix your issue. Below URL can help you in setting the same.

 

https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Unauthorized access to sensitive files

My website is in /var/www/html

but i will take a look on it

Re: Unauthorized access to sensitive files

@eCom_Microware  Setting it to pub will fix your issue.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Unauthorized access to sensitive files

My 000-default.conf

contain this 

<Directory /var/www/html>
	Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Re: Unauthorized access to sensitive files

@eCom_MicrowareYour setting should look like below. Please follow the setting provided by Magento (URL) in earlier post.

 

<Directory /var/www/html/pub>
	Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Unauthorized access to sensitive files

I already set this config, and restarted apache, the error doesnt disapper

 

 

Re: Unauthorized access to sensitive files

@eCom_MicrowareI hope you create the cache as well.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Unauthorized access to sensitive files

I already cleared the cache, could you please be more specified??

Re: Unauthorized access to sensitive files

@eCom_Microware 

Do you have only 1 website on your server and this is why you have updated the default.conf? Can you confirm that changes are reflected and your Magento is running from 'pub' folder?

 

Another thing to check if you have .htaccess available in 'app' folder. Many of time during code upload / copy / paste .htaccess file get disappears.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

 

 

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.