亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1713 | 回復(fù): 0
打印 上一主題 下一主題

Awstats分析Suid日志配置辦法 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2010-02-19 00:09 |只看該作者 |倒序?yàn)g覽


  Normal
  0
  
  
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
  EN-US
  ZH-CN
  X-NONE
  
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4
  
   
   
   
   
   
   
   
   
   
   
   
  

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-priority:99;
        mso-style-qformat:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
Awstats分析Suid日志配置辦法
         Awstats對squid日志的分析采用的是將日志傳送到日志服務(wù)器,并對日志進(jìn)行集中分析,被分析的日志內(nèi)容包括squid、apache和nginx日志。
1、  squid日志配置
squid日志需配置日志格式,在/etc/squid3/squid.conf中定義日志格式combined:
logformat combined
%>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh %{host}>h
配置由syslog監(jiān)聽日志,這里采用的是syslog的local5:
access_log
syslog:local5 combined
如在本地保留日志,可以單獨(dú)配置:
emulate_httpd_log on                 #使用apache格式記錄日志
access_log /var/log/squid3/access.log
重啟動squid服務(wù):
/etc/init.d/squid3 reload
2、  配置本地的syslog
編輯/etc/rsyslog.conf,配置對講local5傳送到遠(yuǎn)程服務(wù)器192.168.0.8:
local5.*     @192.168.0.8
重啟動syslog服務(wù):
/etc/init.d/rsyslog
restart
3、  Awstats服務(wù)器日志配置
配置允許從遠(yuǎn)程接收數(shù)據(jù),修改/etc/default/syslogd:
SYSLOGD="-r"
配置接收遠(yuǎn)程數(shù)據(jù)的位置,修改/etc/syslog.conf:
local5.*
/opt/awstats/apache_log/access_www.gonline.com.log
4、  配置Awstats對日志進(jìn)行分析:
LogFile="/opt/awstats/apache_log/access_www.gonline.com.log"       #日志文件位置
LogType=W                                                                                                                                                                                                                            #分析的日志為web格式
LogFormat = "%other %other
%other %other %other %other %host %other %logname %time1 %methodurl %code %bytesd
%refererquot %uaquot %other %virtualname" #日志格式
SiteDomain=
www.gonline.com
                                                                                  #默認(rèn)域名
HostAliases="gonline.com
www.gonline.com 127.0.0.1 localhost REGEX[.*\.gonline\.com$]"                                                                     #alias域名
DNSLookup=2                                                                                                                  #從dns讀取數(shù)據(jù)
DirData="/opt/awstats/data"                                                                                   #保存分析后的數(shù)據(jù)
DirCgi="/awstats"                                                                                                         #apache中配置的cgi名稱

         其它部分采用默認(rèn)即可。
         配置自動執(zhí)行awstats,在crontab加入:
                   30 * * * *
/root/scripts/apache_awstats.sh                     
         腳本內(nèi)容:
                   #!/bin/bash
slogfile=/opt/awstats/apache_log/access_www.gonline.com.log
dlogfile=/opt/awstats/apache_log/d_access_www.gonline.com.log
cat=/bin/cat
awk=/usr/bin/awk
mv=/bin/mv
rm=/bin/rm
awstats=/opt/awstats/wwwroot/cgi-bin/awstats.pl
h=`date +%H`
d=`date -d'1 day ago' -I`
od=`date -d'30 days ago' -I`

#$cat $slogfile |$awk -F'(squid):' '{print $2}'|sed -e 's#^ ##g'
>> $dlogfile && $cat /dev/null > $slogfile
$awstats -update -config=www.gonline.com

[ $h -eq 0 ] && $mv $dlogfile $dlogfile.$d
[ -f $dlogfile.$od ]
&& $rm $dlogfile.$od
5、   
               
               
               

本文來自ChinaUnix博客,如果查看原文請點(diǎn):http://blog.chinaunix.net/u1/47364/showart_2182408.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP