Awstatsを利用することにより,Apache,Squid及びPostfixのアクセスログを解析することができます。
| # yum install awstats |
| /usr/share/awstats/wwwroot/cgi-bin(/.*)? system_u:object_r:httpd_sys_script_exec_t /var/lib/awstats(/.*)? system_u:object_r:httpd_sys_content_t |
| # cd /etc/selinux/targeted/src/policy # make clean # make reload # fixfiles relabel |
| LogFile="/var/log/httpd/access_log" LogType=W LogFormat=1 # 当サイトのドメイン名 SiteDomain="www.shitomi.jp" # 上記以外の当サイトのドメイン名(正規表現) HostAliases="REGEX[^.*\.shitomi\.(net|com)$]" DNSLookup=1 DirData="/var/lib/awstats" DirCgi="/awstats" DirIcons="/awstatsicons" EnableLockForUpdate=1 # DNSの逆引きを行わないIPアドレス(正規表現) SkipDNSLookupFor="REGEX[^192\.168\.0\.]" # 閲覧を許可するIPアドレスの範囲 AllowAccessFromWebToFollowingIPAddresses="192.168.0.1-192.168.0.254" SkipHosts="127.0.0.1 REGEX[^192\.168\.0\.]" Lang="jp" |
| # /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=apache |
| LogFile="/var/log/squid/access.log" LogType=W LogFormat=4 # 当サイトのドメイン名 SiteDomain="ns.shitomi.jp" 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 |
| # /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=squid |
| 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="mail.shitomi.jp" 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 |
| # /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=postfix |