PHP-FPM enabled websites are down. Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket

Created:

2017-08-07 12:15:22 UTC

Modified:

2017-08-16 16:47:27 UTC

0

Was this article helpful?


Have more questions?

Submit a request

PHP-FPM enabled websites are down. Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket

Applicable to:

  • Plesk for Linux

Symptoms

Website is unavailable if PHP-FPM support is enabled:

503 Service Unavailable.

In domain's web server error log the following entries:

#  tail -fn0 /var/www/vhosts/system/example.com/logs/error_log
[proxy:error] [pid 12408:tid 140554054616832] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/example.com/php-fpm.sock (*) failed
[proxy_fcgi:error] [pid 12408:tid 140554054616832] [client 203.0.113.2:55499] AH01079: failed to make connection to backend: httpd-UDS

SELinux is in Enforcing state

# getenforce
Enforcing

/var/log/audit/audit.log contains the following

# grep php-fpm.sock /var/log/audit/audit.log | grep denied | tail type=AVC msg=audit(1502106372.230:19034): avc: denied { write } for pid=7151 comm="httpd" name="php-fpm.sock" dev="dm-0" ino=1215310 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=sock_file

Cause

Plesk specific SELinux policy was not installed

Resolution

- Connect to the server using SSH .

- Execute the command below. If the output is empty then you need to install psa-selinux package.

# rpm -qa psa-selinux

Below is an example for CentOS 7, for other OS versions visit http://autoinstall.plesk.com

#  yum install http://autoinstall.plesk.com/PSA_17.5.3/dist-rpm-CentOS-7-x86_64/opt/selinux/psa-selinux-17.5.3-cos7.build1705170314.17.noarch.rpm

- Otherwise, execute the command

# /usr/local/psa/etc/selinux_policy_upgrade_trigger

Have more questions? Submit a request
Please sign in to leave a comment.