{"id":67,"date":"2013-06-02T21:53:00","date_gmt":"2013-06-02T12:53:00","guid":{"rendered":"http:\/\/yokensaka.com\/centos\/?p=67"},"modified":"2014-07-19T19:58:49","modified_gmt":"2014-07-19T10:58:49","slug":"%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%83%ad%e3%82%b0%e8%a7%a3%e6%9e%90%ef%bc%88awstats%ef%bc%89","status":"publish","type":"post","link":"http:\/\/yokensaka.com\/centos\/?p=67","title":{"rendered":"\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u89e3\u6790\uff08Awstats\uff09"},"content":{"rendered":"<p>Awstats \u306f\u8996\u899a\u7684\u306b\u7dba\u9e97\u3067\u3001\u898b\u3084\u3059\u3044\u30ed\u30b0\u89e3\u6790\u30c4\u30fc\u30eb\u3060\u3002<br \/>\n\u65e5\u5225\u30fb\u6642\u9593\u5225\u30fb\u30a2\u30af\u30bb\u30b9\u5148\u306a\u3069\u69d8\u3005\u306a\u7d71\u8a08\u60c5\u5831\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3002<br \/>\nAwstats\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u524d\u306b<a href=\"http:\/\/yokensaka.com\/centos\/index.php?catid=4&amp;blogid=1\">Repoforge\u30ea\u30dd\u30b8\u30c8\u30ea<\/a>\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304f\u3002<br \/>\n<b>\u25a0Awstats\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/b><br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067Awstats\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre>\r\n[root@server1 ~]# yum -y install awstats\r\n<\/pre>\n<p>awstats\u3092\u4f7f\u3046\u306b\u306f\u3001perl\u3082\u5fc5\u8981\u3002perl -v\u3068\u5165\u529b\u3057\u3066\u3001<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u304c\u8fd4\u3063\u3066\u304f\u308c\u3070\u3001perl\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<pre>\r\n[root@server1 ~]# perl -v\r\nThis is perl, v5.10.1 (*) built for i386-linux-thread-multi\r\nCopyright 1987-2009, Larry Wall\r\nPerl may be copied only under the terms of either the Artistic License or the\r\nGNU General Public License, which may be found in the Perl 5 source kit.\r\nComplete documentation for Perl, including FAQ lists, should be found on\r\nthis system using \"man perl\" or \"perldoc perl\".  If you have access to the\r\nInternet, point your browser at http:\/\/www.perl.org\/, the Perl Home Page.\r\n<\/pre>\n<p><b>\u25a0 Awstats\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6<\/b><\/p>\n<pre>\r\n\u307e\u305a\u4e0d\u8981\u306a\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u304a\u304f\r\n[root@server1 ~]# rm -f \/etc\/awstats\/awstats.localhost.localdomain.conf\r\n[root@server1 ~]# rm -f \/etc\/awstats\/awstats.`hostname`.conf\r\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\r\n[root@server1 ~]# cp \/etc\/awstats\/awstats.model.conf \/etc\/awstats\/awstats.yokensaka.com.conf\r\nawstats.conf\u3092\u7de8\u96c6\r\n[root@server1 ~]# vi \/etc\/awstats\/awstats.yokensaka.com.conf\r\nSiteDomain=\"localhost.localdomain\"\r\n\u3000\u2193\r\nSiteDomain=\"yokensaka.com\"\u3000\u2190\u3000\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u540d\u306b\u5909\u66f4\r\nHostAliases=\"localhost 127.0.0.1\"\r\n\u3000\u2193\r\nHostAliases=\"localhost 127.0.0.1 REGEX[^192\\.168\\.1\\.]\"   \u2190\u3000\u5185\u90e8\u304b\u3089\u306f\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\r\nDNSLookup=2\r\n\u3000\u2193\r\nDNSLookup=1\u3000\u2190\u30001\u306b\u5909\u66f4\uff08DNS\u306e\u9006\u5f15\u304d\u306b\u3059\u308b\u8a2d\u5b9a\u306b\u5909\u66f4\uff09\r\n#LoadPlugin=\"tooltips\"\r\n\u3000\u2193\r\nLoadPlugin=\"tooltips\"\u3000\u2190\u3000#\u3092\u524a\u9664\uff08\u8a72\u5f53\u3059\u308b\u90e8\u5206\u306b\u30de\u30a6\u30b9\u3092\u5f53\u3066\u308b\u3068\u30d8\u30eb\u30d7\u304c\u8868\u793a\u3055\u308c\u308b\u3002\uff09\r\n#LoadPlugin=\"geoipfree\"\r\n\u2193\r\nLoadPlugin=\"geoipfree\"\u3000\u2190\u3000#\u3092\u524a\u9664(\u30a2\u30af\u30bb\u30b9\u5143\u306e\u56fd\u60c5\u5831\u3092\u8a73\u7d30\u306b\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u5909\u66f4)\r\n\u30d7\u30e9\u30b0\u30a4\u30f3\u300cperl-Geo-IPfree\u300d\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\n[root@server1 ~]# wget http:\/\/pkgs.repoforge.org\/perl-Geo-IPfree\/perl-Geo-IPfree-0.8-1.el6.rf.noarch.rpm\r\nperl-Geo-IPfree\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n[root@server1 ~]# yum -y localinstall --nogpgcheck perl-Geo-IPfree-*.rpm\r\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\r\n[root@server1 ~]# rm -f perl-Geo-IPfree-*.rpm\r\n<\/pre>\n<p><b>\u25a0 awstats.pl\u30a2\u30af\u30bb\u30b9\u5236\u9650<\/b><\/p>\n<pre>\r\n[root@server1 ~]# vi \/etc\/httpd\/conf.d\/awstats.conf\r\n&lt;Directory \/var\/www\/awstats\/&gt;\r\nDirectoryIndex awstats.pl\r\nOptions ExecCGI\r\norder deny,allow\r\ndeny from all\r\nallow from all\u3000\u2190\u3000\u8ffd\u52a0\r\n#allow from 127.0.0.1\u3000\u2190\u3000\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\r\nallow from xxx.xxx.xxx.xxx\u3000\u2190\u3000\u7279\u5b9a\u306e\u5916\u90e8IP(xxx.xxx.xxx.xxx)\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\r\n&lt;\/Directory&gt;\r\nApache\u8a2d\u5b9a\u53cd\u6620\r\n[root@server1 ~]# \/etc\/rc.d\/init.d\/httpd restart\r\nhttpd \u3092\u505c\u6b62\u4e2d:                                            [  OK  ]\r\nhttpd \u3092\u8d77\u52d5\u4e2d:                                            [  OK  ]\r\n<\/pre>\n<p>\u4f1a\u793e\u7b49\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u5408\u3001\u81ea\u5206\u306e\u4f1a\u793e\u306e\u63a5\u7d9a\u74b0\u5883\uff08IP\u30a2\u30c9\u30ec\u30b9\uff09\u3092\u8abf\u3079\u3001\/etc\/hosts.allow\u3078\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u305d\u3093\u306a\u6642\u306f<a href=\"http:\/\/www.taruo.net\/e\/\" target=\"_blank\">\u8a3a\u65ad\u304f\u3093<\/a>\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<br \/>\n<b>\u25a0 Apache\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u304b\u3089AWStats\u306e\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210<\/b><\/p>\n<pre>AWStats\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u521d\u671f\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210\r\n[root@server1 ~]# vi awstatsinit.sh\r\n#!\/bin\/sh\r\nlogfile=`grep ^LogFile \/etc\/awstats\/awstats.$1.conf|sed -e 's\/LogFile=\"\\([^ ]*\\)\"\/\\1\/p' -e d`\r\nfor log in `ls $logfile*|sort -r`\r\ndo\r\n`rpm -ql awstats|grep \"awstats\\.pl\"` \\\r\n-config=$1 -update -logfile=$log\r\ndone\r\nAWStats\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u521d\u671f\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\r\n[root@server1 ~]# sh awstatsinit.sh yokensaka.com\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.yokensaka.com.conf\" by AWStats version 7.1 (build 1.983)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log-20140706\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nDirect access to last remembered record has fallen on another record.\r\nSo searching new records from beginning of log file...\r\nJumped lines in file: 0\r\nParsed lines in file: 241447\r\nFound 16 dropped records,\r\nFound 0 comments,\r\nFound 0 blank records,\r\nFound 6 corrupted records,\r\nFound 241425 old records,\r\nFound 0 new qualified records.\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.yokensaka.com.conf\" by AWStats version 7.1 (build 1.983)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log-20140629\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nDirect access to last remembered record is out of file.\r\nSo searching it from beginning of log file...\r\nJumped lines in file: 0\r\nParsed lines in file: 233838\r\nFound 18 dropped records,\r\nFound 0 comments,\r\nFound 0 blank records,\r\nFound 0 corrupted records,\r\nFound 233820 old records,\r\nFound 0 new qualified records.\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.yokensaka.com.conf\" by AWStats version 7.1 (build 1.983)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log-20140622\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nDirect access to last remembered record has fallen on another record.\r\nSo searching new records from beginning of log file...\r\nJumped lines in file: 0\r\nParsed lines in file: 261127\r\nFound 8 dropped records,\r\nFound 0 comments,\r\nFound 0 blank records,\r\nFound 2 corrupted records,\r\nFound 261117 old records,\r\nFound 0 new qualified records.\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.yokensaka.com.conf\" by AWStats version 7.1 (build 1.983)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log-20140615\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nDirect access to last remembered record has fallen on another record.\r\nSo searching new records from beginning of log file...\r\nJumped lines in file: 0\r\nParsed lines in file: 268241\r\nFound 26 dropped records,\r\nFound 0 comments,\r\nFound 0 blank records,\r\nFound 6 corrupted records,\r\nFound 268209 old records,\r\nFound 0 new qualified records.\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.yokensaka.com.conf\" by AWStats version 7.1 (build 1.983)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nDirect access to last remembered record is out of file.\r\nSo searching it from beginning of log file...\r\nPhase 2 : Now process new records (Flush history on disk after 20000 hosts)...\r\nJumped lines in file: 0\r\nParsed lines in file: 48942\r\nFound 2 dropped records,\r\nFound 0 comments,\r\nFound 0 blank records,\r\nFound 2 corrupted records,\r\nFound 48900 old records,\r\nFound 38 new qualified records.\r\nAWStats\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u521d\u671f\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u524a\u9664\r\n[root@server1 ~]# rm -f awstatsinit.sh\r\n<\/pre>\n<p><b>\u25a0 httpd\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6<\/b><\/p>\n<pre>\r\nhttpd\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6\r\n[root@server1 ~]# vi \/etc\/httpd\/conf\/httpd.conf\r\n\u9577\u3059\u304e\u308bURI\uff08414 Error\uff09\u306f\u30ed\u30b0\u306b\u8a18\u9332\u3057\u306a\u3044\r\n# The following directives define some format nicknames for use with\r\n# a CustomLog directive (see below).\r\n#\r\nLogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\r\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\r\nLogFormat \"%h %l %u %t \\\"%!414r\\\" %&gt;s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\r\n\u30ed\u30b0\u306e\u8a18\u9332\u5185\u5bb9\u5909\u66f4\r\n# logged therein and *not* in this file.\r\n#\r\n#CustomLog logs\/access_log common\r\n\u3053\u306e\u4e0b\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\r\nSetEnvIf Request_URI \"default\\.ida\" no_log\r\nSetEnvIf Request_URI \"cmd\\.exe\" no_log\r\nSetEnvIf Request_URI \"root\\.exe\" no_log\r\nSetEnvIf Request_URI \"Admin\\.dll\" no_log\r\nSetEnvIf Request_URI \"NULL\\.IDA\" no_log\r\nSetEnvIf Remote_Addr 192.168.1 no_log\r\nSetEnvIf Remote_Addr 127.0.0.1 no_log\r\nCustomLog logs\/access_log combined env=!no_log\r\n\u4ee5\u4e0a\u3067\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3001\u4e00\u5ea6httpd\u3092\u518d\u8d77\u52d5\u3055\u305b\u308b\u3002\r\n[root@server1 ~]# service httpd restart\r\nhttpd \u3092\u505c\u6b62\u4e2d:                                            [  OK  ]\r\nhttpd \u3092\u8d77\u52d5\u4e2d:                                            [  OK  ]\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001\/etc\/cron.hourly\/awstats \u304c\u4e00\u6642\u9593\u6bce\u306b\u5b9f\u884c\u3055\u308c\u308b\u3002\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u30661\u6642\u9593\u305f\u3063\u3066\u304b\u3089\u3001 http:\/\/\u30b5\u30fc\u30d0\u30fc\u30a2\u30c9\u30ec\u30b9\/awstats\/awstats.pl \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308c\u3070\u3001\u89e3\u6790\u7d50\u679c\u304c\u898b\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002<br \/>\nError: Couldn&#8217;t open config file\u30fb\u30fb\u30fb\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u306f<br \/>\nhttp:\/\/\u30b5\u30fc\u30d0\u30fc\u30a2\u30c9\u30ec\u30b9\/awstats\/awstats.pl?config=\u30c9\u30e1\u30a4\u30f3\u540d<\/p>\n<div align=right><a href=\"#\">\u25b2 \u30da\u30fc\u30b8\u30c8\u30c3\u30d7\u3078<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Awstats \u306f\u8996\u899a\u7684\u306b\u7dba\u9e97\u3067\u3001\u898b\u3084\u3059\u3044\u30ed\u30b0\u89e3\u6790\u30c4\u30fc\u30eb\u3060\u3002 \u65e5\u5225\u30fb\u6642\u9593\u5225\u30fb\u30a2\u30af &hellip; <a href=\"http:\/\/yokensaka.com\/centos\/?p=67\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-awstats"],"_links":{"self":[{"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":1,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":207,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/207"}],"wp:attachment":[{"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yokensaka.com\/centos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}