CentOS 7 apache2 httpd + mod_fastcgi 无法安装

sgo*_*ohl -2 httpd fastcgi mod-fastcgi centos7

有人试过在 CentOS7/httpd 上安装 mod_fastcgi 吗?

由于它不在 epel 或 fusion 存储库中,我尝试了 el6 rpm,它不起作用(httpd 说:无法将模块/mod_fastcgi.so 加载到服务器中:/etc/httpd/modules/mod_fastcgi.so:未定义符号:unixd_config )。

从源代码编译 mod_fastcgi (# make top_dir=/usr/lib64/httpd) 也失败了,出现了数千个这样的错误:

/usr/include/httpd/http_config.h:574:32: error: request for member 'connection' in something not a structure or union

mod_fastcgi.c:2881:5: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type [enabled by default]
     ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, "FastCGI: access denied: %s", r->uri);
Run Code Online (Sandbox Code Playgroud)

SELINUX 已被禁用(以排除“拒绝访问”的原因)

我还安装了编译fastcgi的要求:httpd-devel libtool make gcc apr apr-devel。

由于 mod_fastcgi 恕我直言是连接到 PHP-FPM 的常用方法,我真的无法想象 fastcgi 不适用于 CentOS 7,所以我认为我做错了什么。

不幸的是,mod_proxy 对套接字连接的支持从 httpd 2.4.10 开始,而 CentOS 7 存储库只有 2.4.6,我想避免编译 apache2(并且真的想使用 fastcgi 并继续使用 fpm-sockets)

我可能会错过任何过时的 fastcgi 吗?如果没有,我的愿望是成功编译 mod-fastcgi。更擅长编译的人可以在默认的centos7 vm上测试吗?

Mic*_*ton 10

在 Apache 2.4 中,使用的官方模块是mod_proxy_fcgi教程)而不是古老的 mod_fastcgi。该模块以及 mod_fcgid 都是第三方模块。

当然,总是有 nginx。

  • 感谢您的回答。我已经在 apache 之前使用 nginx 作为反向代理,但仍然需要 .htaccess 开发人员更改配置的可能性。由于我使用 fpm-sockets(因为如果你有多个池,tcp 就无法管理),并且 mod_proxy_fcgi 从 2.4.9 开始只能使用套接字,我不得不自己编译 httpd,我实际上想避免这种情况。但这是唯一的解决方案。 (2认同)