我正在尝试设置 php-fpm 的多个实例,以通过在 centos 6.5 上运行的 apache 2.2 运行多个版本的 php。
在未来的某个时候,这将最终出现在共享托管环境中,因此我需要尽可能严格的安全性。
因此,我试图避免完全禁用 selinux,并尝试将策略设置得尽可能窄。
我对 selinux 比较陌生(我们现有的服务器只是将其禁用)。我已经对这个主题进行了大量阅读,但逻辑仍然无法理解(正如我确定这个问题所显示的那样)。
调用 php-script apache 时会产生此错误:
[Sun May 18 10:46:17 2014] [error] [client 192.168.163.1] (13)Permission denied: FastCGI: failed to connect to server "/fcgi-bin-php5-fpm-i10000_test-1.testtest.org": connect() failed
[Sun May 18 10:46:17 2014] [error] [client 192.168.163.1] FastCGI: incomplete headers (0 bytes) received from server "/fcgi-bin-php5-fpm-i10000_test-1.testtest.org"
Run Code Online (Sandbox Code Playgroud)
包含 php-fpm 套接字的目录如下所示:
drwxr-xr-x. root root system_u:object_r:var_run_t:s0 .
drwxr-xr-x. root root system_u:object_r:var_run_t:s0 ..
srw-------. apache apache unconfined_u:object_r:var_run_t:s0 apache_default.sock
srw-------. apache apache unconfined_u:object_r:var_run_t:s0 i10000_test-1.testtest.org.sock
srw-------. …Run Code Online (Sandbox Code Playgroud)