今天在一台几乎废弃的 freebsd 服务器上折腾,删除了里面的 postfix 邮件系统。折腾完毕修改了 /etc/rc.conf,去掉了 hostname 键,reboot 之后发现 apache 没有自动启动,手动启动也失败。通过 apachectl configtest 检查结果是 Syntax OK,于是去找 /var/log/http_error.log,错误日志如下:
[Sat Dec 15 00:17:43 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ""
Configuration Failed

查了资料,修改 httpd.conf,将下面一行注释掉就可以了:
LoadModule unique_id_module libexec/apache2/mod_unique_id.so

在 apache 手册上查到这个 unique_id_module 模块的概述:
This module provides a magic token for each request which is guaranteed to be unique across "all" requests under very specific conditions. The unique identifier is even unique across multiple machines in a properly configured cluster of machines. The environment variable UNIQUE_ID is set to the identifier for each request. Unique identifiers are useful for various reasons which are beyond the scope of this document.

大概意思就是给每个请求提供一个唯一标识的环境变量,具体说明在这里

再次启动 apache 还发现一个报错:
No such file or directory: Failed to enable the 'httpready' Accept Filter

曾经在某网的一篇文章上看过,google 找到相关资料,说这貌似是 freebsd 与 apache2 之间的一个小 bug。解决方案如下:
# kldload accf_http
# vi /boot/defaults/loader.conf

找到下面这行:
accf_http_load = "NO"

将 NO 改为 YES 就可以了。

标签: freebsd, apache

添加新评论