|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!AWStats是在Sourceforge上开展很快的一个基于Perl的WEB日记剖析工具。
它能够统计您站点的以下信息:
- 会见量(UV),会见次数,页面扫瞄量(PV),点击数,数据流量等
- 准确到每个月、逐日、每小时的数据
- 会见者国度
- 会见者IP
- Robots/Spiders的统计
- 访客延续工夫
- 对分歧Filestype的统计信息
- Pages-URL的统计
- 访客操纵体系扫瞄器等信息
- 别的信息(搜刮关头字等等)
上面是AWStats剖析Nginx日记的操纵步调:
1、设置nginx日记格局
修正nginx.conf的日记格局,否则awstats没法剖析。
[size=1em][size=1em]log_formataccess$remote_addr-$remote_user[$time_local]"$request"
[size=1em]$status$body_bytes_sent"$http_referer"
[size=1em]"$http_user_agent""$http_x_forwarded_for";
[size=1em]access_log/var/log/nginx/access.logaccess;
注重,日记格局里的双引号不克不及漏了且每一个参数之间是一个空格分开,由于只需有渺小的不同,awstats就没法读取日记。
改好后,使nginx重读设置文件:
[size=1em][size=1em]shell#nginx-t&&nginx-sreload
2、主动切割nginx日记
天天早晨23点59分准时实行一个shell剧本来切割nginx日记。剧本内容以下:
<divstyle="padding:0px;margin:0px;color:rgb(85,85,85);font-family:宋体,ArialNarrow,arial,serif;font-size:14px;line-height:28px;"><divclass="syntaxhighlighterbash"id="highlighter_23960"style="width:720px;padding:0px!important;margin:0.3em0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;border:0px!important;bottom:auto!important;float:none!important;left:auto!important;line-height:1.1em!important;outline:0px!important;overflow-y:visible!important;overflow-x:auto!important;position:relative!important;right:auto!important;top:auto!important;vertical-align:baseline!important;box-sizing:content-box!important;font-family:Consolas,BitstreamVeraSansMono,CourierNew,Courier,monospace!important;font-size:1em!important;min-height:inherit!important;background-image:none!important;background-attachment:initial!important;background-size:initial!important;background-origin:initial!important;background-clip:initial!important;background-position:initial!important;background-repeat:initial!important;"><divclass="container"style="padding:0px!important;margin:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;border:0px!important;bottom:auto!important;float:none!important;left:auto!important;line-height:1.1em!important;outline:0px!important;overflow:visible!important;position:relative!important;right:auto!important;top:auto!important;vertical-align:baseline!important;width:auto!important;box-sizing:content-box!important;font-size:1em!important;min-height:inherit!important;background:none!important;">[size=1em]#!/bin/bash
[size=1em]#
[size=1em]#Filename:nginxCutLog.sh
[size=1em]#Author:Qicheng
[size=1em]#Website:http://qicheng0211.blog.51cto.com/
[size=1em]#Description:切割nginx日记
[size=1em]#Notes:设置crontab,天天23点59分准时实行
[size=1em]#
[size=1em]ROOT_UID=0
[size=1em]if["$UID"-ne"$ROOT_UID"];then
[size=1em]echo"Error:必需以root用户运转此步伐!"
[size=1em]exit1
[size=1em]fi
[size=1em]
[size=1em]nginx_logs_dir="/var/log/nginx"
<divclass="linenumber16index15alt1"style="white-space:nowrap;padding:0px1em!important;margin:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;border:0px!important;bottom:auto!important;float:none!important;left:auto!important;line-height:1.1em!important;outline:0px!important;overflow:visible!important;position:static!important;right:auto!important;top:auto!important;vertical-align:baseline!important;width:auto!important;box-sizing:content-box!important;font-size:1em!important;min-height:inherit!important;background-image:none!important;background-attachment:initial!important;background-size:initial!important;background-origin:initial!important;background-clip:initial!important;background-position:initial!important;background-repeat:initial!important;">nginx_pid_file= |
|