【发布时间】:2017-08-04 11:16:13
【问题描述】:
为什么下面fail2ban regex
failregex = ^%(_apache_error_client)s ((AH001(28|30): )?File does not exist|(AH01264: )?script not found or unable to stat).*$
^%(_apache_error_client)s script '.*' not found or unable to stat
不匹配
[client 111.111.111.111:51008] script '/srv/www/htdocs/wwwuni/fileadmin/Dokumente/index.php' not found or unable to stat
【问题讨论】:
-
failregex 是两行;第二行在 stat),$ 之后开始
-
也许你错过了第二行
stat之后的$? -
丢失的 $ 不是问题。问题是 _apache_error_client 的定义与我更改的行不匹配 _apache_error_client = [[^]]*] [(error|\S+:\S+)]( [pid \d+])? [客户端
(:\d{1,5})?] 到 _apache_error_client = [[^]]*] [(:error|\S+:\S+)]( [pid \d+])? [client (:\d{1,5})?] (: 前面的错误)