Maurice
When setting up a new system user, the PHP-FPM configuration currently uses the same username for both the user and group, like this:
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = wordpress
group = wordpress
However, this can lead to permission issues when accessing files created by the custom FPM process because they are saved under the wrong group name. The Nginx server, which runs under the 'ploi' user, can't access these files.
To resolve this, I've been manually fixing it by running the following command:
root@ploi: $ chown -R wordpress:ploi /home/wordpress
And I've also adjusted the FPM config like this:
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = wordpress
group = ploi
I am not sure, if this is the right way to fix it, but at least it works. We manage numerous servers and custom system users with various FPM pools. Would there be a way to apply any fix for all existing pools to avoid this issue?
Edit 1)
I realize that the Wordpress uploads have 660 permissions. I don't think this is correct, I just wonder why. What I find confusing is that new sites, created by Ploi, also have the ploi group applied to the project folder and the default index.html. Files created by the custom fpm-ploi have a different group though, now what is the correct one?
Wrong PHP-FPM pool configs/file permissions lead to 403 error
-
Dennis moved item to board Closed
11 months ago -
Maurice moved item to project Site Level Requests
1 year ago -
Maurice created the item
1 year ago