SORICH SAMURAIby SORICH

hello,world

2010年6月
             
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

最新の記事

カテゴリー

月間アーカイブ

最新のトラックバック

最新のトラックバック

apache    2009.08.03 [ Mon ] 18:51

「ブログのアクセスを集計したい」と言われたので、とりあえずブログのアクセスだけ別のログファイルに出力してみることにします。
全体のアクセスログはローテートで、一定期間で過去のログがなくなってしまうので、最小限のアクセスログのみサーバーに残そうと思います。



ちなみに使ってるブログエンジンはMovableTypeで、記事は静的に出力しています。
ログに出力するURLは、/blog/以下の***.htmlにしました。
カテゴリーなどの一覧ページではなく、記事を閲覧してもらわないとログには出力されないということですね。
そのままではロボット(クローラ)のアクセスであふれてしまいそうなので、ロボットのアクセスはログに記録しないことにしました。
ロボット一覧は新しいのを見つけ次第追記していこうかと思います。

httpd.conf
LoadModule setenvif_module modules/mod_setenvif.so

# ロボット
SetEnvIf User-Agent "Baiduspider" no_blog
SetEnvIf User-Agent "FeedHub MetaDataFetcher" no_blog
SetEnvIf User-Agent "Googlebot" no_blog
SetEnvIf User-Agent "ia_archiver" no_blog
SetEnvIf User-Agent "JUST-CRAWLER" no_blog
SetEnvIf User-Agent "MJ12bot" no_blog
SetEnvIf User-Agent "Moreoverbot" no_blog
SetEnvIf User-Agent "msnbot" no_blog
SetEnvIf User-Agent "Plagger" no_blog
SetEnvIf User-Agent "Python-urllib" no_blog
SetEnvIf User-Agent "R6_CommentReader" no_blog
SetEnvIf User-Agent "R6_FeedFetcher" no_blog
SetEnvIf User-Agent "Technoratibot" no_blog
SetEnvIf User-Agent "Toread-Crawler" no_blog
SetEnvIf User-Agent "Twiceler" no_blog
SetEnvIf User-Agent "Y!J-BSC" no_blog
SetEnvIf User-Agent "Yahoo Pipes" no_blog
SetEnvIf User-Agent "Yahoo! Slurp" no_blog
SetEnvIf User-Agent "Yeti" no_blog

SetEnvIf User-Agent "ICC-Crawler" no_blog
SetEnvIf User-Agent "MicroAd" no_blog
SetEnvIf User-Agent "^Pathtraq" no_blog
SetEnvIf User-Agent "Test FeedCrawler" no_blog
SetEnvIf User-Agent "URI::Fetch" no_blog

SetEnvIf User-Agent "BuzzBot" no_blog
SetEnvIf User-Agent "DotBot" no_blog
SetEnvIf User-Agent "ichiro/mobile" no_blog
SetEnvIf User-Agent "^Modiphibot" no_blog
SetEnvIf User-Agent "^PHP" no_blog
SetEnvIf User-Agent "^psbot" no_blog
SetEnvIf User-Agent "Tagoobot" no_blog
SetEnvIf User-Agent "woriobot" no_blog
SetEnvIf User-Agent "^WWW::Document" no_blog
SetEnvIf User-Agent "^Yandex" no_blog

SetEnvIf User-Agent "^Mozilla/\d\.0( \(compatible;\))?$" no_blog

# ブログ以外
SetEnvIf Request_URI "^/(?!blog/)" no_blog
SetEnvIf Request_URI "(?<!\.html)$" no_blog

# MT
SetEnvIf Request_URI "/mt-static/" no_blog
SetEnvIf Referer "/mt.cgi" no_blog

# その他
SetEnvIf Request_URI "^/blog/index.html$" no_blog

CustomLog /var/log/blog/access_log combined env=!no_blog
いろいろ思案した結果このように記述してみました。
ひとまずブログのログは取り始めましたので、集計結果は近日公開予定!?

トラックバック(0) コメント(0)

カテゴリ:

コメントする




トラックバック(0)

このブログ記事を参照しているブログ一覧: [apache2]ブログのアクセスのみ、別のログファイルに出力する。


このブログ記事に対するトラックバックURL:

Copyright(C) SORICH Ltd. All Rights Reserved.