【发布时间】:2018-04-20 00:59:57
【问题描述】:
我们刚刚将网站移至新服务器,并不断看到此错误消息:
[Tue Nov 07 14:57:08.796821 2017] [:error] [pid 1777] :Apache2 IO write: (32) Broken pipe at /home/example/web/example.org/public_html/cgi-bin/links/admin/Booking/Calendar.pm line 228
第 228 行是:
print Links::SiteHTML::display('calendar_view_room', { month_loop => \@dates, owner_id_fk => $room_owner_useridfk, room_name => $room->{room_name_show}, target => $target, room_id => $room_id });
服务器设置是 nginx 前端,然后将 Perl 内容的代理传递到 Apache 2.4。我们还在 Apache 端使用 mod_perl。
有什么我可以看的,试图找出为什么会出现这个错误?我在 Google 上能找到的唯一内容可以追溯到 2009 年,并没有太大帮助。
更新:为了尝试找出导致此问题的 IP(以便我可以查看它们是真实的还是机器人),我已将我的 Apache 错误日志配置更新为:
ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
我对某些人来说新格式很好:
[2017 年 11 月 8 日星期三 08:54:41] [错误] [pid 12574] util_script.c(591): [client 122.119.97.15:42982] 来自脚本的错误标头 'community.cgi':错误的标题:
...但是对于与 IO 相关的错误,我没有为客户得到任何东西?
[2017 年 11 月 8 日星期三 08:59:53] [错误] [pid 12576] Apache2__Log.h(331): [client :Apache2 IO write: (32) Broken pipe at /home/example.org/public_html/cgi-bin/links/admin/Booking/Calendar.pm 第 228 行
【问题讨论】:
-
将错误与请求关联起来,看看它们是否来自合法用户?根据我自己的经验,它们似乎来自发送请求但在收到响应之前关闭连接的机器人。
-
@ChrisTurner 谢谢会调查的。有点棘手,因为错误日志没有 IP。也许我可以调整错误日志格式,以便将来发生时包含它
-
@ChrisTurner - 我已经在 Apache 中更新了我的
ErrorLogFormat,以尝试查找 IP……但由于某种原因,该错误不起作用? (请参阅我更新的问题)。有什么想法吗?