Holmesian Blog

FreeBSD中Apache故障

服务器操作系统:FreeBSD7.前端Nginx 后端Apache22(通过FreeBSD的Ports安装)

这段时间服务器老是提示Nginx 502 Bad Gateway错误,经检查前端Nginx正常,后端Apache卡死,拒绝一切连接。必须重启后端Apache才恢复。查询日志有如下内容,网上搜索说是在FreeBSD下使用ports安装apache22会出现类似的warming:

    Failed to enable the 'httpready' Accept Filter

据说这是Apache21和FreeBSD之间Bug!

解决方法是:

    #kldload accf_http

并在/boot/defaults/loader.conf中添加如下内容,以便下次启动自动装载模块

    accf_data_load="YES"
    accf_http_load="YES"

Apache会卡死是因为FreeBSD自带的一个基于http端口过滤的模块不能加载。这个模块的作用是检查HTTP请求是否完整,如果请求是符合规则的则通过,反之就扔掉。

    [Fri Jan 22 00:54:49 2010] [error] [client 218.93.17.38] File does not exist: /usr/local/www/apache22/data/qqblog
    [Fri Jan 22 00:54:49 2010] [error] [client 220.181.94.221] File does not exist: /usr/local/www/apache22/data/html
    [Fri Jan 22 12:24:11 2010] [warn](22)Invalid argument: Failed to enable the 'httpready' Accept Filter
    [Fri Jan 22 12:24:12 2010] [notice] Digest: generating secret for digest authentication ...
    [Fri Jan 22 00:54:49 2010] [error] [client 218.93.17.38] File does not exist: /usr/local/www/apache22/data/qqblog
    [Fri Jan 22 00:54:49 2010] [error][client 220.181.94.221] File does not exist: /usr/local/www/apache22/data/html

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »