Showing results for 
Search instead for 
Did you mean: 

Permissions Help

Permissions Help


I seem to have an issue with permissions and i dont know what i am doing wrong. I would appreciate some help as i have followed the magento guides but something is not right somewhere.

I have magento 2.4.5-p1 running on a dedicated server running ubuntu 20.04, nginx and varnish. I have given ownership of magento directory to my user and my user is in the www-data group.

Whenever a new cache is generated (by running a flush or clean or anything like that) it is always created as the www-data user, not my user. Whenever i update magento i seem to run into issue with permissions as well. 

I sometimes get issues where my site goes down after an update (like now) and looking in the nginx log file i see this:

[error] 265160#265160: *2906409 access forbidden by rule, client:, server:, request: "POST /pub/health_check.php HTTP/1.1", host: ""


My server user one i use to login, and is obviously not a root account. I use the account to run the cli commands etc.

PHP seems to be running under the www-data user, is this where the issue is coming from?. MySQL is running under a user called mysql.


I'm sure i had the same setup on another server and had no issues.

I would appreciate some help getting my permissions correct so i can get my site back up and running.






Re: Permissions Help

Hello @CSP_Alex 


Actually these messages are a good thing, Magento would warn you in the admin panel if it could access the file via HTTP. If you see this log message, everything is fine. Magento tries to access app/etc/local.xml via HTTP, which fails, so you get this error log. And the point is, that it should fail! Otherwise everybody could see your database credentials, by accessing in the browser.

However, if these log messages annoy you and you are confident that your server setup will stay as secure as it is, you can easily remove this feature:


Getting rid of the security notification
To get rid of this security check, do not attempt to hack the Magento core (as some forum threads have suggested in the past). Instead, you can just modify the admin-theme to remove this check. Open up the following file or create it if it does not exist:

Then add the following code to it:

        <remove name="notification_security" />
        <remove name="notification_survey" />
This removes the blocks notification_security and notification_survey from the backend-pages entirely, skipping therefor the security check. No core hacks involved.
Problem solved? Click Accept as Solution!

Re: Permissions Help

Thanks, that answers part of the problem, but i still need to sort out the permissions issues so i dont get further problems.

This error does seem to coincide with when i get 503 errors on varnish and my site goes down. This happens after almost every update done via composer

Re: Permissions Help

A magic kit is a fascinating and enchanting tool that allows individuals, both young and old, to explore the world of illusion and wonder. These kits are designed to provide aspiring magicians with the necessary tools and knowledge to perform a variety of magic colouring book and illusions that captivate and mystify audiences. From pulling rabbits out of hats to making objects disappear, a magic kit opens the door to a world of creativity and entertainment.