我正在尝试使用 Awstats 分析我的网络主机生成的 Apache 日志。我使用 XAMPP 在我的计算机上启动并运行了 Awstats,并从我的 Plesk 控制面板下载并连接了各种 .gz 日志文件,并将它们导入到 Awstats 中。
问题是 Awstats 似乎不尊重或不理解 Apache 日志中条目的日期。例如,我的原始日志文件包含从今年 3 月开始的条目,但当我查看 Awstats 时,它只报告 4 月 16 日的统计数据。我怀疑这可能是因为 Apache 日志文件格式不太适合 Awstats。以前有人见过这种行为吗?我是否需要重新配置 Plesk 以将其日志文件输出为 Awstats 可以理解的格式?
下面是我处理过的 Apache 日志文件的前几行(出于安全目的已删除):
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/themes/CherryFramework/css/camera.css HTTP/1.0" 200 427 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/themes/multi_wordpress/bootstrap/css/responsive.css HTTP/1.0" 200 441 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/themes/multi_wordpress/style.css HTTP/1.0" 200 422 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/themes/multi_wordpress/bootstrap/css/bootstrap.css HTTP/1.0" 200 440 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/cherry-plugin/lib/js/FlexSlider/flexslider.css?ver=2.2.0 HTTP/1.0" 200 444 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/cherry-plugin/lib/js/owl-carousel/owl.carousel.css?ver=1.24 HTTP/1.0" 200 448 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/cherry-plugin/lib/js/owl-carousel/owl.theme.css?ver=1.24 HTTP/1.0" 200 445 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-includes/css/dist/block-library/style.min.css?ver=5.0.3 HTTP/1.0" 200 427 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/cherry-plugin/includes/css/cherry-plugin.css?ver=1.2.7 HTTP/1.0" 200 442 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/column-shortcodes//assets/css/shortcodes.css?ver=1.0 HTTP/1.0" 200 441 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
180.163.220.3 - - [22/Mar/2019:00:58:11 +0000] "GET /wp-content/plugins/contact-form-7/includes/css/styles.css?ver=5.1.1 HTTP/1.0" 200 436 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
这显示访问日期为 3 月 22 日,但是 Awstats 没有显示此时间段的数据,并且仅从 4 月 16 日开始报告。
以下是 4 月 16 日的一些日志 - 如您所见,日志文件格式相同:
13.106.59.199 - - [16/Apr/2019:11:40:29 +0100] "GET /wp-content/themes/multi_wordpress/style.css HTTP/1.0" 200 422 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:29 +0100] "GET /wp-content/themes/multi_wordpress/bootstrap/css/responsive.css HTTP/1.0" 200 441 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:29 +0100] "GET /wp-content/themes/multi_wordpress/bootstrap/css/bootstrap.css HTTP/1.0" 200 440 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/plugins/advanced-wp-columns/assets/css/awp-columns.css?ver=5.0.3 HTTP/1.0" 200 642 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/plugins/motopress-content-editor-lite/bootstrap/bootstrap-grid.min.css?ver=3.0.4 HTTP/1.0" 200 460 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/themes/CherryFramework/js/jquery.debouncedresize.js?ver=1.0 HTTP/1.0" 200 716 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/themes/CherryFramework/style.css HTTP/1.0" 200 811 "https://www.redacted.co.uk/wp-content/themes/multi_wordpress/main-style.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/themes/CherryFramework/css/style.css HTTP/1.0" 200 426 "https://www.redacted.co.uk/wp-content/themes/CherryFramework/style.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/uploads/2016/02/3-1024x632.jpg HTTP/1.0" 200 422 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/uploads/2016/02/Spare-1-300x225.jpg HTTP/1.0" 200 427 "https://www.redacted.co.uk/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
213.106.59.199 - - [16/Apr/2019:11:40:30 +0100] "GET /wp-content/uploads/2015/09/redacted-Logo-small.png HTTP/1.0" 200 430 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
2.50.46.27 - - [16/Apr/2019:11:42:07 +0100] "POST /autodiscover/autodiscover.xml HTTP/1.0" 404 35655 "-" "Microsoft Office/16.0 (Windows NT 6.1; MAPI 16.0.11328; Pro)"
我最初怀疑日志文件从 Plesk 输出的格式错误,或者使用了不正确的分隔符,但事实上一些日志似乎被解释而其他日志却没有,这让我认为情况并非如此,因为如果是这样的话,Awstats 很可能根本不会显示任何结果。
希望有人可以帮忙。
干杯,
菲尔