2006-08-22 Tue
長すぎるURIへのアクセスによってログ解析ができない
- Summary
WebDAVの脆弱性をつく攻撃によって,一行が長すぎるログが記録される.
このログ以降,awstatsが解析できない.
[2003-05-25-1]とも関連有り.
- access_logに残るログ
192.0.2.10 - - [11/Aug/2006:18:34:51 +0900] "SEARCH /\x90\x02\xb1\x02\xb1\x02\xb1\x02\xb1\x02\xb1\x02\xb1\x02\xb1 … \x90\x90\x90\x90\x90\x90\x90" 414 271 "-" "-"
- access_logに414エラーのログを記録しない
httpd.conf
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
- Reference
AWStats 6.0
http://cyberam.dip.jp/linux_server/log/awstats60_main.html
2006-07-11 Tue
AWStats で postfix, squid のログを解析
- awstats.postfix.conf
LogFile="perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |" LogType=M LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd" SiteDomain="example.com" DNSLookup=2 DirData="/var/lib/awstats" DirCgi="/awstats" DirIcons="/awstatsicons" EnableLockForUpdate=1 # 閲覧を許可するIPアドレスの範囲 AllowAccessFromWebToFollowingIPAddresses="192.168.0.1-192.168.0.254" Lang="jp" LevelForBrowsersDetection=0 LevelForOSDetection=0 LevelForRefererAnalyze=0 LevelForRobotsDetection=0 LevelForSearchEnginesDetection=0 LevelForKeywordsDetection=0 LevelForFileTypesDetection=0 LevelForWormsDetection=0 ShowMonthStats=UHB ShowDaysOfMonthStats=HB ShowDaysOfWeekStats=HB ShowHoursStats=HB ShowDomainsStats=0 ShowHostsStats=HBL ShowRobotsStats=0 ShowEMailSenders=HBML ShowEMailReceivers=HBML ShowSessionsStats=0 ShowPagesStats=0 ShowFileTypesStats=0 ShowFileSizesStats=0 ShowOSStats=0 ShowBrowsersStats=0 ShowOriginStats=0 ShowKeyphrasesStats=0 ShowKeywordsStats=0 ShowMiscStats=0 ShowHTTPErrorsStats=0 ShowSMTPErrorsStats=1
- awstats.squid.conf
LogFile="/var/log/squid/access.log" LogType=W LogFormat=4 SiteDomain="example.com" DNSLookup=2 DirData="/var/lib/awstats" DirCgi="/awstats" DirIcons="/awstatsicons" EnableLockForUpdate=1 # 閲覧を許可するIPアドレスの範囲 AllowAccessFromWebToFollowingIPAddresses="192.168.0.1-192.168.0.254" Lang="jp" LevelForBrowsersDetection=0 LevelForOSDetection=0 LevelForRefererAnalyze=0 LevelForRobotsDetection=0 LevelForSearchEnginesDetection=0 LevelForKeywordsDetection=0 LevelForWormsDetection=0 ShowDomainsStats=0 ShowRobotsStats=0 ShowFileSizesStats=0 ShowOSStats=0 ShowBrowsersStats=0 ShowOriginStats=0 ShowKeyphrasesStats=0 ShowKeywordsStats=0
- Reference
Awstats(ログ解析)/Fedora Core4
http://www.shitomi.jp/fc4/awstats.html
2006-06-05 Mon
AWStats Ver.6.5 完全日本語版
- Reference
AWStats Ver.6.5完全日本語版のページ
http://www.bflets.dyndns.org/Tools/AWStatsJpn.html
2005-11-07 Mon
移転に伴う Apache , AWStats の設定
- httpd.conf
NameVirtualHost * <VirtualHost *:80> DocumentRoot /var/www ServerName xight.org </VirtualHost> <VirtualHost *:80> DocumentRoot /home/yoshiki/public_html/chalow ServerName memo.xight.org ServerAlias memo CustomLog /var/log/apache/memo.access.log combined ErrorLog /var/log/apache/memo.error.log </VirtualHost>
- AWStats
confファイルを分割
# mv awstats.conf awstats.xight.conf
# cp awstats.xight.conf awstats.memo.conf
/etc/awstats/awstats.xight.conf
LogFile="/var/log/apache/access.log.enc" SiteDomain="xight.org"
/etc/awstats/awstats.memo.conf
LogFile="/var/log/apache/memo.access.log.enc" SiteDomain="memo.xight.org"
解析結果画面は
http://example.com/cgi-bin/awstats.pl?config=xight
http://example.com/cgi-bin/awstats.pl?config=memo
で確認できる.
- crontab
45 * * * * /home/yoshiki/bin/conv_weblog_to_utf8.pl < /var/log/apache/access.log > /var/log/apache/access.log.enc
45 * * * * /home/yoshiki/bin/conv_weblog_to_utf8.pl < /var/log/apache/memo.access.log > /var/log/apache/memo.access.log.enc
0 * * * * /usr/lib/cgi-bin/awstats.pl -config=xight -update > /dev/null 2>&1
0 * * * * /usr/lib/cgi-bin/awstats.pl -config=memo -update > /dev/null 2>&1
- Reference
バーチャルホストによる複数サイトの同時運用 (1/2)
http://www.atmarkit.co.jp/flinux/rensai/apache08/apache08a.html
バーチャルホストによる複数サイトの同時運用 (2/2)
http://www.atmarkit.co.jp/flinux/rensai/apache08/apache08b.html
AWStatsでのW3C拡張ログ形式の解析方法
http://shattered04.myftp.org/pc_31.html
2005-06-27 Mon
AWStat Tips
- AWStats6.0 ログをUTF8に変換して検索語の文字化け回避
http://cyberam.dip.jp/linux_server/log/awstats60_main.html
- Anti-spam domain blacklist
Fighting email spam の dom-bl.txtを利用.
- awstats.conf の設定 (ちょっと強引)
LogFile="cat /var/log/httpd/access.log.`/bin/date -v-1d +%Y%m%d` | grep -v -f REFERERSPAMLIST |"
- AWStats用語集
http://www.bflets.dyndns.org/Tools/AWStatsDocs_JP/awstats_glossary_jp.html
- Reference
/home/pochi/ChangeLog - 2005-06-27
http://www.pochi.cc/~sasaki/chalow/2005-06-27-2.html
/home/pochi/ChangeLog - 2005-06-06
http://www.pochi.cc/~sasaki/chalow/2005-06-06-1.html
/home/pochi/ChangeLog - 2004-08-31
http://www.pochi.cc/~sasaki/chalow/2004-08-31-5.html
2003-09-19 Fri
AWStats - Free log file analyzer for advanced statistics
- AWStats
Apache,FTP,メール等のログをグラフ表示
GNU GPL.
- 設定 - 変更点
49: LogFile = "/var/log/apache/access.log" 119: LogFormat = 1 142: SiteDomain = "xight.org" 156: HostAliases = "localhost 127.0.0.1 REGEX[^192\.168\.] xight.org" 191: DirData = "/var/cache/awstats" 311: SkipDNSLookupFor = "REGEX[^192\.168\.]" 330: CreateDirDataIfNotExists = 1 460: SkipHosts = "127.0.0.1 localhost REGEX[^192\.168\.]" 550: NotPageList = "css js class gif jpg jpeg png bmp ico swf mp3 wma mpg avi wmv" 700: MiscTrackerUrl = "awstats/js/awstats_misc_tracker.js" 957: ShowFlagLinks = "ja en" 1038: StyleSheet = "/awstats/css/awstats_bw.css" 1230: LoadPlugin = "tooltips" 1237: LoadPlugin = "decodeutfkeys" 1332: LoadPlugin = "userinfo"
- データをアップデートする
$ awstats.pl -config=example.com -update
後は,ブラウザで直接 awstats.pl にアクセスすることで閲覧可能.
- Debian での注意
/etc/awstats.conf が空っぽなのでオリジナルのソースからコピーする必要がある.
- 追記
decodeutfkeys pluginは URI::Escape が必要
- Reference
SourceForge - AWStats
http://awstats.sourceforge.net/
AWStats Ver.6.0完全日本語版のページ
http://www.bflets.dyndns.org/Tools/AWStatsJpn.html
AWStatsを試してみるメモ. [FreeBSD](fkimura.com)
http://www.fkimura.com/awstats0.html
jlb TL8S に AWStats Ver.5.7 を導入する
http://jlb.jp/hsinstall8s/aws57/
URI::Escape
2003-05-25 Sun
Apache の Combine ログから worm のログを分離
- Summary
mod_setenvifを利用して Combine ログからwormのログを消去,worm用のログファイルに出力する.
画像やcssのログは記録しない.
awstatsのエラー回避のためにも有効.
# For Combining log files <IfModule mod_setenvif.c> SetEnvIf Request_URI "^/_mem_bin/" worm trash SetEnvIf Request_URI "^/_vti_bin/" worm trash SetEnvIf Request_URI "^/c/winnt" worm trash SetEnvIf Request_URI "^/c/winnt" worm trash SetEnvIf Request_URI "^/msadc/" worm trash SetEnvIf Request_URI "^/MSADC/" worm trash SetEnvIf Request_URI "^/scripts/" worm trash SetEnvIf Request_URI "^/default.ida" worm trash SetEnvIf Request_URI "Admin\.dll" worm trash SetEnvIf Request_URI "cmd\.exe" worm trash SetEnvIf Request_URI "null\.ida" worm trash SetEnvIf Request_URI "NULL\.IDA" worm trash SetEnvIf Request_URI "root\.exe" worm trash SetEnvIf Request_URI "\.(gif)|(jpg)|(png)$" trash SetEnvIf Request_URI "\.(js)|(css)|(ico)$" trash SetEnvIf Request_URI "/robots\.txt$" trash SetEnvIf Remote_Addr "127\.0\.0\.1" trash SetEnvIf Remote_Addr "^192\.168\.[0-9]+\.[0-9]+$" trash </IfModule> CustomLog /var/log/apache/access_log combined env=!worm CustomLog /var/log/apache/worm_log combined env=worm
- Reference
AWStats 6.0
http://cyberam.dip.jp/linux_server/log/awstats60_main.html#8
ITMedia - Developer - Linux Tips
http://www.itmedia.co.jp/help/tips/linux/l0324.html