仓酷云

标题: 带来一篇CentOS下利用AWStats剖析Nginx会见日记 [打印本页]

作者: 金色的骷髅    时间: 2015-1-14 20:14
标题: 带来一篇CentOS下利用AWStats剖析Nginx会见日记
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!AWStats是在Sourceforge上开展很快的一个基于Perl的WEB日记剖析工具。
它能够统计您站点的以下信息:

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




欢迎光临 仓酷云 (http://ckuyun.com/) Powered by Discuz! X3.2