FastCGI does not work with SELinux enabled

Refers to:

  • Plesk 12.0 for Linux

Created:

2016-11-16 13:00:08 UTC

Modified:

2016-12-21 19:43:55 UTC

0

Was this article helpful?


Have more questions?

Submit a request

FastCGI does not work with SELinux enabled

Symptoms

PHP in FastCGI mode does not work. It seems to work properly with SELinux disabled but it generates error 500 "Internal Server Error" when it is in "Enforcing" state.

# getenforce
Enforcing

Apache error log files contain the following entries:

/var/www/vhosts/domain.tld/logs/error_log

[Mon Mar 30 19:32:54 2015] [warn] [client 169.254.16.85] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Mar 30 19:32:54 2015] [error] [client 169.254.16.85] Premature end of script headers: info.php

/var/log/httpd/error_log

failed to open log file /var/log/httpd/suexec_log
fopen: Permission denied

Cause

Invalid SELinux security context.

Resolution

Set the following security context to the /usr/sbin/suexec

# chcon system_u:object_r:httpd_suexec_exec_t:s0 /usr/sbin/suexec
Have more questions? Submit a request
Please sign in to leave a comment.