Score:0

php-fpm 8.1 on ubuntu 22.04 lamp stack ignores directory ACLs

us flag
Q2Q

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!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.