<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I@laoer.com &#187; awstats</title>
	<atom:link href="http://i.laoer.com/tag/awstats/feed" rel="self" type="application/rss+xml" />
	<link>http://i.laoer.com</link>
	<description>技术、生活、感悟 -- Laoer的博客</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>在Linux上安装awstats</title>
		<link>http://i.laoer.com/linux-install-awstats.html</link>
		<comments>http://i.laoer.com/linux-install-awstats.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 04:31:25 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[awstats]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=47</guid>
		<description><![CDATA[awstats是一个Apache/Windows IIS的日志分析工具，每次安装的时候都参考车东的《AWStats简介》，这次我把安装步骤记录下来，下次再安装时就比较方便了。 我的Apache安装在/usr/local/apache/，access_log日志文件用cronolog工具按天截断 wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz tar zxvf awstats-6.9.tar.gz mv awstats-6.9/wwwroot/cgi-bin /usr/local/apache/cgi-bin/awstats (wwwroot下还有一些静态文件夹，最后Copy到相应Web目录下) 下面安装GeoIP相关包，GeoIP是一个ip-location的工具，可以根据IP确定位置，包括国家、城市，具体参考其网站 http://www.maxmind.com/app/ip-location wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.36.tar.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz tar zxvf GeoIP.tar.gz cd GeoIP-1.4.5 ./configure make make install cd .. tar zxvf Geo-IP-1.36.tar.gz cd Geo-IP-1.36 perl Makefile.PL（注意，在这里可能出错，是因为找不到GeoIP的包，可以用perl Makefile.PL LIBS=&#8217;-L/usr/local/lib&#8217; INC=&#8217;-I/usr/local/include&#8217;） make make install cd .. gunzip GeoIP.dat.gz mv GeoIP.dat /usr/local/apache/cgi-bin/awstats/ gunzip GeoLiteCity.dat.gz [...]]]></description>
			<content:encoded><![CDATA[<p>awstats是一个Apache/Windows IIS的日志分析工具，每次安装的时候都参考<a title="车东" href="http://www.chedong.com" target="_blank">车东</a>的《<a title="AWStats简介：Apache/Windows IIS的日志分析工具的下载，安装，配置样例和使用" href="http://www.chedong.com/tech/awstats.html" target="_blank">AWStats简介</a>》，这次我把安装步骤记录下来，下次再安装时就比较方便了。</p>
<p>我的Apache安装在/usr/local/apache/，access_log日志文件用cronolog工具按天截断</p>
<p>wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz<br />
tar zxvf awstats-6.9.tar.gz<br />
mv awstats-6.9/wwwroot/cgi-bin /usr/local/apache/cgi-bin/awstats<br />
(wwwroot下还有一些静态文件夹，最后Copy到相应Web目录下)</p>
<p>下面安装<a title="GeoIP" href="http://www.maxmind.com/app/ip-location" target="_blank">GeoIP</a>相关包，GeoIP是一个ip-location的工具，可以根据IP确定位置，包括国家、城市，具体参考其网站 <a href="http://www.maxmind.com/app/ip-location" target="_blank">http://www.maxmind.com/app/ip-location</a></p>
<p>wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz<br />
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.36.tar.gz<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz</p>
<p>tar zxvf GeoIP.tar.gz<br />
cd GeoIP-1.4.5<br />
./configure<br />
make<br />
make install<br />
cd ..</p>
<p>tar zxvf Geo-IP-1.36.tar.gz<br />
cd Geo-IP-1.36<br />
perl Makefile.PL（注意，在这里可能出错，是因为找不到GeoIP的包，可以用perl Makefile.PL LIBS=&#8217;-L/usr/local/lib&#8217; INC=&#8217;-I/usr/local/include&#8217;）<br />
make<br />
make install<br />
cd ..</p>
<p>gunzip GeoIP.dat.gz<br />
mv GeoIP.dat /usr/local/apache/cgi-bin/awstats/</p>
<p>gunzip GeoLiteCity.dat.gz<br />
mv GeoLiteCity.dat /usr/local/apache/cgi-bin/awstats/</p>
<p>cd /usr/local/apache/cgi-bin/awstats/<br />
mv awstats.model.conf common.conf<br />
修改common.conf文件，加入<br />
LoadPlugin=”decodeutfkeys”<br />
LoadPlugin=”geoip GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoIP.dat”<br />
LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoLiteCity.dat”</p>
<p>保存退出之后，还在/usr/local/apache/cgi-bin/awstats/目录下<br />
mkdir data</p>
<p>vi awstats.pl<br />
修改里面的内容<br />
$LIMITFLUSH =<br />
50000;   # Nb of records in data arrays after how we need to flush data on disk<br />
保存退出</p>
<p>新建你网站的配置文件<br />
vi awstats.domainname.conf<br />
加入内容<br />
Include “common.conf”<br />
LogFile=”/usr/local/apache/logs/domainname-access_log.%YYYY-24%MM-24%DD-24&#8243;<br />
SiteDomain=”domainname”<br />
DefaultFile=”index.html”<br />
DirData=”/usr/local/apache/cgi-bin/awstats/data/”<br />
保存退出</p>
<p>执行<br />
./awstats.pl -update -config=domainname -lang=cn<br />
就可以生成domainname的分析报表，通过http://domainname/cgi-bin/awstats/awstats.pl?config=domainname就要可以在web上查看了<br />
需要每日生成的话，写一个crontab的脚本在每天凌晨执行就可以了</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/linux-install-awstats.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

