I'm a bit stumped on something here with the php-fpm setup... I'm seeing my virthosts not able to serve content because when apache connects to the php-fpm socket, it gets a "permission denied" error. The error does make sense - the web server runs as user "www" (whether in pre-fork or worker mpm modes), and there are no suexec overrides (not sure that's even available in worker mpm?) in the individual virtual host entries. And in the per-user php-fpm configs, the permissions are clearly set to the user/group of the the owner, and the mask is 0660 - meaning ONLY the owner of the site has access to those sockets. This does not seem like it should work - is something different supposed to be happening here? Should the www group be the group owner of the sockets? If I manually override that by doing a recursive "chgrp www" in the php-fpm socket directory, all is well. If I manually override the php-fpm config to make www the group owner all is well.
What am I missing? I know I can just hack around this by modifying the code that generates the php-fpm config, but that feels wrong...
Vhost config example:
[root@panel /usr/local/etc/apache24]# cat sites-enabled/35_froxlor_normal_vhost_web1.example.com.conf
# 35_froxlor_normal_vhost_web1.example.com.conf
# Created 31.03.2019 00:59
# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.
# Domain ID: 2 - CustomerID: 1 - CustomerLogin: tester1
<VirtualHost 10.3.2.207:80>
ServerName web1.example.com
ServerAdmin css-test1@example.com
DocumentRoot "/var/customers/webs/tester1/web1/"
<FilesMatch \.(php)$>
SetHandler proxy:unix:/var/run/apache2/fastcgi/1-tester1-web1.example.com-php-fpm.socket|fcgi://localhost
</FilesMatch>
<Directory "/var/customers/webs/tester1/web1/">
Require all granted
AllowOverride All
</Directory>
Alias /webalizer "/var/customers/webs/tester1/webalizer/web1.example.com"
ErrorLog "/var/customers/logs/tester1-web1.example.com-error.log"
CustomLog "/var/customers/logs/tester1-web1.example.com-access.log" combined
</VirtualHost>
[root@panel /usr/local/etc/apache24]#
Question
sporkman
I'm a bit stumped on something here with the php-fpm setup... I'm seeing my virthosts not able to serve content because when apache connects to the php-fpm socket, it gets a "permission denied" error. The error does make sense - the web server runs as user "www" (whether in pre-fork or worker mpm modes), and there are no suexec overrides (not sure that's even available in worker mpm?) in the individual virtual host entries. And in the per-user php-fpm configs, the permissions are clearly set to the user/group of the the owner, and the mask is 0660 - meaning ONLY the owner of the site has access to those sockets. This does not seem like it should work - is something different supposed to be happening here? Should the www group be the group owner of the sockets? If I manually override that by doing a recursive "chgrp www" in the php-fpm socket directory, all is well. If I manually override the php-fpm config to make www the group owner all is well.
What am I missing? I know I can just hack around this by modifying the code that generates the php-fpm config, but that feels wrong...
Vhost config example:
PHP-FPM config example:
Oh, maybe you don't want to just trust me, so some logs showing the permissions issue:
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.