![apache 错误日志中的新行字符](https://linux22.com/image/152627/apache%20%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97%E4%B8%AD%E7%9A%84%E6%96%B0%E8%A1%8C%E5%AD%97%E7%AC%A6.png)
我检查了我的access.log
文件,发现了以下几行:
66.240.236.119 - - [26/Apr/2019:04:15:56 +0200] "\n" 400 3245 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:58 +0200] "\n" 400 3261 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:58 +0200] "\n" 400 3239 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:59 +0200] "\n" 400 3239 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:16:00 +0200] "\n" 400 3239 "-" "-"
方法是怎么来的\n
?我以前没有在访问日志中遇到过这个问题,所以我有点担心。
答案1
看起来有人触发了“换行请求”,例如
printf '\n' | nc localhost 80
这会在 access.log 中生成以下内容:
127.0.0.1 - - [27/Apr/2019:01:39:38 +0200] "\n" 400 0 "-" "-"
可能是为了测试你的服务器......