【问题标题】:After Upgrade to Debian Jessie: Random mod_fcgid errors升级到 Debian Jessie 后:随机 mod_fcgid 错误
【发布时间】:2017-05-20 10:47:50
【问题描述】:

我目前正在拔毛: 从 Debian wheezy 升级到 jessie 后,有时会出现 Apache mod_fcgid 错误。

当前设置:

  • Debian GNU/Linux 8.6 (jessie) / 3.16.0-4-amd64
  • Apache/2.4.10 (Debian)
  • PHP 5.6.29-0+deb8u1

一些 Apache 站点运行良好,而一些站点在多次重新加载后出现了很好的错误 500。 Apache 日志显示

[fcgid:warn] [pid 23714] (104)Connection reset by peer: [client 123.456.789.12:53191] mod_fcgid: 从 FastCGI 服务器读取数据时出错

[fcgid:warn] [pid 23714] (104)Connection reset by peer: [client 123.456.789.12:53191] mod_fcgid: ap_pass_brigade 在 handle_request_ipc 函数中失败

奇怪的是,这个错误只是偶尔发生。作为用户,我可以再次重新加载页面,一切都很好。 我知道我不是第一个遇到此错误的人,到目前为止我尝试了几件事,但没有任何帮助。

我已经做了什么:

  • 在 /etc/apache2/mods-available/fcgid.conf 中设置 FcgidOutputBufferSize 0 -> 没有区别
  • 在包装脚本中设置PHP_FCGI_MAX_REQUESTS=99999 -> 没有区别
  • 在 /etc/apache2/mods-available/fcgid.conf 中设置 FcgidMaxRequestsPerProcess 500 -> 没有区别
  • 在 /etc/apache2/mods-available/fcgid.conf 中将 FcgidMaxRequestsPerProcess 增加到 3600 -> 没有区别

有什么想法吗? 提前致谢。

马丁

【问题讨论】:

    标签: php linux apache mod-fcgid


    【解决方案1】:

    我不想这么说,但是从一个 Debian 版本更新到另一个版本(例如:从 Wheezy 到 Jessie)可能会很麻烦,而且并不总是能完美运行。有很多事情可能会出错,并导致异常行为。

    无论如何,我在这里要做的(可能会也可能不会),首先我会查看更新前机器上的所有自定义配置文件和脚本,并调查它们是否仍然可以在新版本上运行.

    接下来,我会确保我有一个包含存储库列表 /etc/apt/sources.list,例如:

    deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
    deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
    deb http://security.debian.org/ jessie/updates main contrib non-free
    deb-src http://security.debian.org/ jessie/updates main contrib non-free
    deb http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
    deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
    deb http://ftp.debian.org/debian jessie-backports main contrib non-free
    deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free
    

    之后,运行apt-get update,然后运行以下代码——重要提示:以下代码可能会覆盖您程序的自定义配置文件(如果有的话):

    dpkg --force-confnew --configure -a
    sleep 1
    apt-get -y -o DPkg::options::="--force-confnew" install -f 
    sleep 1
    dpkg --force-confnew --configure -a
    sleep 1
    apt-get -y update
    sleep 1
    apt-get -y -o DPkg::options::="--force-confnew" dist-upgrade
    

    之后,reboot 并检查问题是否仍然存在。

    下一步是删除(清除)apachephp 软件包(如果可能的话),然后重新启动并重新安装它们。例如:

    apt-get -y --purge remove apache2 php5
    reboot
    apt-get -y install apache2 php5
    

    然后,reboot 并检查问题是否仍然存在。

    如果此时您仍然有问题,我会考虑从头开始重新安装整个操作系统。我将许多 Debian 机器从一个版本更新到另一个版本,并且在太多机器中存在太多问题,所以我不再这样做了,而是从头开始安装操作系统。

    我希望这会有所帮助,祝你好运。

    【讨论】:

    • 非常感谢您提供这本详细的手册,但我已经从头开始编写了重要的配置文件,而不是使用旧的。
    【解决方案2】:

    我发现问题只存在于某些站点,尤其是那些将 ion loader 与 PHP 结合使用的站点。我没有重新安装整个机器,而是将有困难的虚拟主机切换到 PHP-FPM。

    现在一切都以这种方式运行良好且快速。 好吧,这不是这个问题的真正解决方案,但至少是一个很好的解决方法......

    【讨论】:

    • 很高兴您通过解决方法解决了您的问题。我不想以任何方式成为“黛比唐纳”,但我建议你进一步调查这个问题。旧机器是否也出现同样的问题?如果不是,为什么现在会发生?您应该知道这个答案,以便能够再次信任机器。可能还有更多你不知道的问题潜伏着。也许这个错误只是一个问题的“症状”,会在不同的场景和情况下表现出来。只是我的2美分。祝你好运!
    猜你喜欢
    • 2021-08-16
    • 1970-01-01
    • 1970-01-01
    • 2015-07-23
    • 1970-01-01
    • 2015-11-29
    • 2015-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多