I've been running a pretty fine lamp stack hosting multiple sites.
Pools are running okay.
Each website has it's own pool and runs as it's own system-user.
These system-users are created without /home/.. directories and without shell.
Each users has it's own group as the same name (default).
All these (user) groups had been added to www-data (apache) user.
I'm using php-fpm 8.1 with apache2.
The problem:
Files and folders created by the (wordpress) websites have the wrong permissions.
They have 755 (dirs) and 644 (files) but I want them to be 750 and 640.
When I created these website directories I did the correct chmod to the specific site user and set all folder and file permissions recursively to 750 and 640.
The user and group of new files created by the sites are all correct, the right user that runs the pool.
Only.. the "other" permission is given 4 instead of 0.
What I've tried, without succes:
- setfacl recursively : $
setfacl -Rdm u::rwx,g::rx,o::- DIR
- set umask for user in /etc/passwd : $
chfn --other='umask=037' username
- set system wide umask in
vim /etc/login.defs
- set umask in:
etc/systemd/system/php-fpm.service.d/override.conf
[Service]
UMask=0037
All without success unfortunately.
Thanks for your suggestions!