仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 463|回复: 8
打印 上一主题 下一主题

[CentOS(社区)] 带来一篇CentOS下利用AWStats剖析Nginx会见日记

[复制链接]
金色的骷髅 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 20:14:35 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

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=
蒙在股里 该用户已被删除
9#
发表于 2015-3-23 22:10:36 | 只看该作者
现在的linux操作系统如redhat,难点,红旗等,都是用这么一个内核,加上其它的用程序(包括X)构成的。
乐观 该用户已被删除
8#
发表于 2015-3-17 03:11:12 | 只看该作者
掌握硬件配置,如显卡,声卡,网卡等,硬件只要不是太老或太新一般都能被支持,作为一名Linux系统管理员建议多阅读有关硬件配置文章,对各种不支持或支持不太好的硬件有深刻的了解。
谁可相欹 该用户已被删除
7#
发表于 2015-3-9 17:13:47 | 只看该作者
我们自学,就这个循环的过程中,我们学习了基本操作,用vi,shell,模拟内存的分配过程等一些OS管理。
小魔女 该用户已被删除
6#
发表于 2015-2-27 13:06:48 | 只看该作者
让我树立了很大的信心学好这门课程,也学到了不少专业知识和技能。?
admin 该用户已被删除
5#
发表于 2015-2-9 12:59:33 | 只看该作者
期间我阅读了不少关于Linux的相关资料,其中也不乏一些有趣的小故事,这既丰富了我的课余生活,也让我加深了对一些术语的理解,比玩游戏强多了。?
因胸联盟 该用户已被删除
地板
发表于 2015-2-4 01:42:25 | 只看该作者
linux鸟哥的私房菜,第三版,基础篇,网上有pdf下的,看它的目录和每章的介绍就行了,这个绝对原创!
愤怒的大鸟 该用户已被删除
板凳
发表于 2015-1-25 18:51:38 | 只看该作者
请问谁有Linux的学习心得的吗?简单的说说?
若天明 该用户已被删除
沙发
发表于 2015-1-15 06:50:42 | 只看该作者

带来一篇CentOS下利用AWStats剖析Nginx会见日记

大致看明白了,楼主的思维太过发散、太过跳跃了。楼主,加强集中精力叙述一件事情的能力。不要再发散了……
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-9-24 15:29

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表