<?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>花儿开了 &#187; awstats</title>
	<atom:link href="http://blog.istef.info/tag/awstats/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.istef.info</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 06 Jun 2010 05:52:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel='hub' href='http://blog.istef.info/?pushpress=hub'/>
		<item>
		<title>IXWebhosting 上安装 Awstats（三）</title>
		<link>http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/</link>
		<comments>http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 15:57:55 +0000</pubDate>
		<dc:creator>iStef</dc:creator>
				<category><![CDATA[Experiences]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ixwebhosting]]></category>

		<guid isPermaLink="false">http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/</guid>
		<description><![CDATA[续上文，IXWebhosting 上安装 Awstats（一）（二） 在前两篇文章中，我已经详细分析了 IXWebhosting 上安装 Awstats 的问题和解决办法，本文只讲具体实现过程，可以作为一个安装指南，方便每位 IX 用户。这里我建议专门添加一个子域名来安装 Awstats，比较方便。当然如果您希望安装在已有网站中，可以参考本文酌情修改。 设置服务器环境。在 IX 后台的 Domains 面板中选择一个顶级域名 domain.com，然后点击 add sub-domain，输入 stat，创建一个子域名 stat.domain.com。在面板的 Web options 中设置 stat.domain.com，在 CGI 中添加 .pl 扩展名，最后不要忘了 Apply 使配置生效。 上传 Awstats。点击这里下载 Awstats 6.6 beta，解压，将 wwwroot 目录中所有文件（包括子目录）上传到 stat.domain.com 目录中，将 tools 目录中的 awstats_buildstaticpages.pl 。 设定目录和文件权限。这一步可以用 ftp 操作，也可以用 IX 后台中提供的 WebAdmin 操作。将站点 stat.domain.com 的权限设置为 0717（默认为 0715），cgi-bin/*.pl [...]]]></description>
			<content:encoded><![CDATA[<p><!--SPONSOR=[PAGEFLAKES]-->续上文，IXWebhosting 上安装 Awstats（<a href="http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/">一</a>）<a href="http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-2/">（二）</a></p>
<p>在前两篇文章中，我已经详细分析了 <a href="http://www.ixwebhosting.com/templates/ix/v2/affiliate/clickthru.cgi?id=istefliu">IXWebhosting</a> 上安装 <a href="http://awstats.sourceforge.net/">Awstats</a> 的<a href="http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/">问题</a>和<a href="http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-2/">解决办法</a>，本文只讲具体实现过程，可以作为一个<strong>安装指南</strong>，方便每位 IX 用户。这里我建议专门添加一个子域名来安装 Awstats，比较方便。当然如果您希望安装在已有网站中，可以参考本文酌情修改。</p>
<ol>
<li>设置服务器环境。在 IX 后台的 Domains 面板中选择一个顶级域名 <em>domain.com</em>，然后点击 add sub-domain，输入 stat，创建一个子域名 stat.domain.com。在面板的 Web options 中设置 <em>stat.domain.com</em>，在 CGI 中添加 .pl 扩展名，最后不要忘了 Apply 使配置生效。</li>
<li>上传 Awstats。点击<a href="http://awstats.sourceforge.net/files/awstats-6.6.tar.gz">这里</a>下载 Awstats 6.6 beta，解压，将 wwwroot 目录中所有文件（包括子目录）上传到 <em>stat.domain.com</em> 目录中，将 tools 目录中的 awstats_buildstaticpages.pl 。</li>
<li>设定目录和文件权限。这一步可以用 ftp 操作，也可以用 IX 后台中提供的 WebAdmin 操作。将站点 stat.domain.com 的权限设置为 0717（默认为 0715），cgi-bin/*.pl 权限设定为 755。</li>
<li>下载<a href="http://istef.info/files/gen_conf.phps">我写的这个 PHP 脚本</a>，按照里面的注释设置好相应的参数。将它上传到你的服务器某个可访问路径下，并将扩展名改为 .php，记下这个访问地址，后面会用到。</li>
<li>用任何文本工具创建以下几个空文件：awallsites，数个 awstats.<em>yourdomain.com</em>.conf。将这些文件上传到 cgi-bin 目录下，设定 awallsites 权限为 0777，其余几个空配置文件权限为 0666。</li>
<li>修改 cgi-bin/awstats.model.conf，注释掉 LogFile，Domain, Aliases 几个选项。其余的选项根据需要设定，插件可以启用的只有 tooltips，其余的（包括 Geo_IP 和 Geo_City）不要启用，否则会出错误。将 awstats.model.conf 改名为 awcommon.conf。</li>
<li>添加 Cronjob。在 IX 的后台面板中，点击 Ftp Manager，编辑 Crontab。添加以下两条记录（这里注意将斜体部分修改为您对应的设置）：
<ul>
<li>4 * * * * wget &#8211;output-document=- <em>http://stat.domain.com/gen_conf.php</em></li>
<li>5 * * * * <em>/hsphere/local/home/user_name/stat.domain.com/cgi-bin/awallsites</em></li>
</ul>
</li>
<li>大功告成，等着看结果吧！</li>
</ol>
<p>做完以上步骤后，Awstats 就被安装在 IXWebhosting 上了。等完成第一次统计后（您事先设定的邮箱会收到邮件），访问 http://<em>stat.domain.com</em>/<em>domain_com</em> 就可以看到统计结果了，记得如果统计的域名为 domain.com，对应生成的目录就为 domain_com。</p>
<p>OK，全部步骤都在这里了。写的比较匆忙，有可能有疏忽的地方，如果您发现了还请您留言或邮件通知我，我会尽快改正。同时如果您有什么问题，也希望您一并提出来，大家一起解决，共同进步。</p>
<p>btw: 我觉得这个方法不止适用于 IXWebhosting，通过简单的脚本修改，应该很多 Linux host 都可以安装 Awstats。当然前提有两个：提供原始 Apache 日志，支持 crontab。
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F19%2Fhowto-install-awstats-on-ixwebhosting-part-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F19%2Fhowto-install-awstats-on-ixwebhosting-part-3%2F&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>IXWebhosting 上安装 Awstats（二）</title>
		<link>http://blog.istef.info/2006/12/19/how-to-install-awstats-on-ixwebhosting-part-2/</link>
		<comments>http://blog.istef.info/2006/12/19/how-to-install-awstats-on-ixwebhosting-part-2/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 15:57:13 +0000</pubDate>
		<dc:creator>iStef</dc:creator>
				<category><![CDATA[Experiences]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ixwebhosting]]></category>

		<guid isPermaLink="false">http://blog.istef.info/2006/12/19/how-to-install-awstats-on-ixwebhosting-part-2/</guid>
		<description><![CDATA[续上文：IXWebhosting 上安装 Awstats（一）、（三） 提示：这篇文章只是分析和解决问题，并不是一步一步设置那种。我认为，了解整个解决问题的过程比直接告诉你如何去做要受益更多。当然，这篇文章之后我也会写个最简明的教程，手把手帮你装好 Awstats，敬请期待。 上文提到了两个难点，解决了它们基本就等于成功了 80%，另外 20% 就看 IXWebhosting 是否提供了足够的运行环境了（经验正结论是肯定的）。首先看第一个问题，日志文件名的解决。 其实解决这个问题相对还是简单的，因为每天的日志文件命名还是很有规律的。我们只需要在配置文件中设置每日正确的 LogFile 就可以了。这种工作当然不能由人来做，要留给代码做。前文提到 IX 的日志文件文件名为 /logs/domain/domain.，前面的路径都很容易搞定，只差最后那个时间戳。通过测试，我得到这个时间戳实际就是格林威治时间每天的 00:00:00 的时间戳，通过一行 php 程序就可以搞定： &#60;?php gmmktime(0,0,0); ?&#62; 实际中由于 IXWebhosting 服务器时区设置不是 GMT，我用了两行命令生成了正确的时间戳。不过无论什么方法，能得到 LogFile 文件名这个问题解决也就有希望了。我使用的方法是在每次统计前，先运行一个 PHP 程序，生成含有正确 LogFile 的 awstats 配置文件，随后 awstats 进行统计时就可以正常进行统计了。这种方法的优点在于，我还可以在这个 php 脚本里做很多事情，为后面的工作做好准备，缺点就是要添加两个 cronjobs，稍微麻烦一点。另外我想可能通过写 Awstats 插件的方法，可以为 LogFile 添加对时间戳的支持。具体我没有试，因为我发现，由于多年不用，我现在对于 Perl 的程序，水平只限于看懂和改改了 -_-b。权衡利弊，我选择写 PHP 脚本生成配置文件。 由于 Awstats 配置文件是支持 Include 的，所以我们生成配置文件时只需要包含 [...]]]></description>
			<content:encoded><![CDATA[<p><!--SPONSOR=[PAGEFLAKES]-->续上文：<a href="http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/">IXWebhosting 上安装 Awstats（一）</a>、<a href="http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/">（三）</a></p>
<p><strong>提示：</strong>这篇文章只是<strong>分析和解决问题</strong>，并<strong>不是</strong>一步一步设置那种。我认为，了解整个解决问题的过程比直接告诉你如何去做要受益更多。当然，这篇文章之后我也会写个最简明的教程，手把手帮你装好 Awstats，敬请期待。</p>
<p>上文提到了两个难点，解决了它们基本就等于成功了 80%，另外 20% 就看 <a href="http://www.ixwebhosting.com/templates/ix/v2/affiliate/clickthru.cgi?id=istefliu">IXWebhosting</a> 是否提供了足够的运行环境了（经验正结论是肯定的）。首先看第一个问题，日志文件名的解决。</p>
<p>其实解决这个问题相对还是简单的，因为每天的日志文件命名还是很有规律的。我们只需要在配置文件中设置每日正确的 LogFile 就可以了。这种工作当然不能由人来做，要留给代码做。前文提到 IX 的日志文件文件名为 <userdir>/logs/domain/domain.<timestamp>，前面的路径都很容易搞定，只差最后那个时间戳。通过测试，我得到这个时间戳实际就是格林威治时间每天的 00:00:00 的时间戳，通过一行 php 程序就可以搞定：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">&lt;?php</span></li>
<li><span style="color: Blue;">gmmktime</span><span style="color: Olive;">(</span><span style="color: Maroon;">0</span><span style="color: Gray;">,</span><span style="color: Maroon;">0</span><span style="color: Gray;">,</span><span style="color: Maroon;">0</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Blue;">?&gt;</span></li></ol></div>
<p>实际中由于 IXWebhosting 服务器时区设置不是 GMT，我用了两行命令生成了正确的时间戳。不过无论什么方法，能得到 LogFile 文件名这个问题解决也就有希望了。我使用的方法是在每次统计前，先运行一个 PHP 程序，生成含有正确 LogFile 的 awstats 配置文件，随后 awstats 进行统计时就可以正常进行统计了。这种方法的优点在于，我还可以在这个 php 脚本里做很多事情，为后面的工作做好准备，缺点就是要添加两个 cronjobs，稍微麻烦一点。另外我想可能通过写 Awstats 插件的方法，可以为 LogFile 添加对时间戳的支持。具体我没有试，因为我发现，由于多年不用，我现在对于 Perl 的程序，水平只限于看懂和改改了 -_-b。权衡利弊，我选择写 PHP 脚本生成配置文件。</p>
<p>由于 Awstats 配置文件是支持 Include 的，所以我们生成配置文件时只需要包含 Include 和 LogFile 就可以了，当然如果需要多站统计再加上 Domain 和 Aliases。其它的配置预先写好个配置文件 Include 进来就好了。<span id="more-610"></span></p>
<p>PHP 脚本本身也很简单，主要有几个方面的功能。通过时间戳和命名规则得到正确的 LogFile 完整文件名，并写入配置文件，这也是最核心的功能。第二，尝试建立所需的静态文件输出路径，并设定正确的输出权限，同时向目录中写入 .htaccess 文件，定义 DirectoryIndex 为 awstats.<domain>.html，为浏览提供方便。由于我需要对多个站点进行统计，我额外添加了一部分，生成最终通过 cronjob 运行的 bash 脚本，对需要统计的站点进行统计。由于 IX 对于当天没有产生浏览的网站不生成日志，因此可以根据这点判断是否需要统计，从而生成合适的 bash 脚本提高效率。</p>
<p>再说说上次提到的目录权限问题。静态文件目录的问题很容易解决，通过 php 创建或 chmod 就可以解决，重点在于配置文件和最终的 Bash 脚本。由于不能将 cgi-bin 目录设为 0777，因此通过 php 无法向目录中建立文件，我选择了一个折中的方法绕过这个问题。准备几个 0 字节的文件，文件名与将要生成的文件一样，上传到 cgi-bin 目录。然后将配置文件的属性改为 0666，Bash 脚本的文件名改为 0777，这样 php 程序就可以根据需要修改他们的内容了。</p>
<p>做完这些工作，安放好 Awstats 程序和 PHP 脚本，并在 IX 的控制面板中设定好 cronjob，等着看漂亮的统计结果吧。</p>
<p>具体实现方法看<a href="http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/">这里</a>。
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F19%2Fhow-to-install-awstats-on-ixwebhosting-part-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F19%2Fhow-to-install-awstats-on-ixwebhosting-part-2%2F&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.istef.info/2006/12/19/how-to-install-awstats-on-ixwebhosting-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>IXWebhosting 上安装 Awstats（一）</title>
		<link>http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/</link>
		<comments>http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 15:28:56 +0000</pubDate>
		<dc:creator>iStef</dc:creator>
				<category><![CDATA[Experiences]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ixwebhosting]]></category>

		<guid isPermaLink="false">http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/</guid>
		<description><![CDATA[本文分三部分，这是第一部分。第二部分为问题的解决思路，第三部分为具体的实现方法。 Awstats 是一套非常强大的，基于日志的网站统计工具。关于这款统计工具的介绍，以及它在 Dreamhost 上的安装，我之前写过文章说明了，这里不重复了。自从主机搬家到 IXWebhosting，由于服务商没有预装这个统计工具，也就没法使用了。 周日的时候得了一点空闲，打算把 Awstats 在 IX 上装一下试试。虽然 IX 没有提供 Shell 给安装造成了不小的麻烦和限制，但最终经过努力，Awstats 还是被我成功在 IXWebhosting 上安家了。而且通过 cronjob，我让 awstats 对服务器上我的几个站的访问日志每个小时分析一次，并将统计结果生成静态页面。您可以在这里看看这个站点的统计结果，怎么样，还是不错的吧。不过由于 IXWebhosting 本身的限制，我没能成功安装 Geo_IP 和 Geo_City 这两个实用的插件，实在很是遗憾。不过相比 IX 自带的统计工具粗糙的结果以及每天一次的超慢频率，自己装一个 Awstats 还是很实用的。 IXWebhosting 提供 rawlog，支持 perl cgi 和 cronjob，基本满足了 Awstats 运行的最低条件，因此我才决定尝试手动安装 Awstats。在这个过程中我遇到了几个难题： 日志文件名：IXWebhosting 使用的日志文件名格式为 domain.[timestamp]，但我翻了翻 Awstats 的 Logfile 设定，似乎没有支持 Timestamp 的标记。 目录权限问题：这个问题在配置文件生成，命令行脚本的生成已经最后静态化输出中都制造了不少麻烦，不过好在解决起来还是比较简单。 具体的安装步骤……卖个关子，明天奉上。因为我发现每次写的长文浏览量都很少，所以太长的文章就拆开写好了，呵呵。]]></description>
			<content:encoded><![CDATA[<p><!--SPONSOR=[PAGEFLAKES]-->本文分三部分，这是第一部分。<a href="http://blog.istef.info/2006/12/19/how-to-install-awstats-on-ixwebhosting-part-2/">第二部分</a>为问题的解决思路，<a href="http://blog.istef.info/2006/12/19/howto-install-awstats-on-ixwebhosting-part-3/">第三部分</a>为具体的实现方法。</p>
<p><img src="http://stat.istef.info/icon/other/awstats_logo6.png" alt="Awstats" style="float:left" /><a href="http://awstats.sourceforge.net/">Awstats</a> 是一套非常强大的，基于日志的网站统计工具。关于这款统计工具的介绍，以及它在 Dreamhost 上的安装，我之前<a href="http://blog.istef.info/2006/08/12/install-awstats-on-dreamhost/">写过文章说明</a>了，这里不重复了。自从主机<a href="http://blog.istef.info/2006/12/08/migrate-to-ixwebhosting/">搬家</a>到 <a href="http://www.ixwebhosting.com/templates/ix/v2/affiliate/clickthru.cgi?id=istefliu">IXWebhosting</a>，由于服务商没有预装这个统计工具，也就没法使用了。</p>
<p>周日的时候得了一点空闲，打算把 Awstats 在 IX 上装一下试试。虽然 IX 没有提供 Shell 给安装造成了不小的麻烦和限制，但最终经过努力，Awstats 还是被我成功在 IXWebhosting 上安家了。而且通过 cronjob，我让 awstats 对服务器上我的几个站的访问日志每个小时分析一次，并将统计结果生成静态页面。您可以在这里看看<a href="http://stat.istef.info/istef_info/">这个站点的统计结果</a>，怎么样，还是不错的吧。不过由于 <a href="http://www.ixwebhosting.com/templates/ix/v2/affiliate/clickthru.cgi?id=istefliu">IXWebhosting</a> 本身的限制，我没能成功安装 Geo_IP 和 Geo_City 这两个实用的插件，实在很是遗憾。不过相比 IX 自带的统计工具粗糙的结果以及每天一次的超慢频率，自己装一个 Awstats 还是很实用的。</p>
<p>IXWebhosting  提供 rawlog，支持 perl cgi 和 cronjob，基本满足了 Awstats 运行的最低条件，因此我才决定尝试手动安装 Awstats。在这个过程中我遇到了几个难题：</p>
<ul>
<li>日志文件名：IXWebhosting 使用的日志文件名格式为 domain.[timestamp]，但我翻了翻 Awstats 的 Logfile 设定，似乎没有支持 Timestamp 的标记。</li>
<li>目录权限问题：这个问题在配置文件生成，命令行脚本的生成已经最后静态化输出中都制造了不少麻烦，不过好在解决起来还是比较简单。</li>
</ul>
<p>具体的安装步骤……卖个关子，明天奉上。因为我发现每次写的长文浏览量都很少，所以太长的文章就拆开写好了，呵呵。
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F18%2Fhow-to-install-awstats-on-ixwebhosting-part-1%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.istef.info%2F2006%2F12%2F18%2Fhow-to-install-awstats-on-ixwebhosting-part-1%2F&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.istef.info/2006/12/18/how-to-install-awstats-on-ixwebhosting-part-1/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>在 Dreamhost 上安装 Awstats</title>
		<link>http://blog.istef.info/2006/08/12/install-awstats-on-dreamhost/</link>
		<comments>http://blog.istef.info/2006/08/12/install-awstats-on-dreamhost/#comments</comments>
		<pubDate>Sat, 12 Aug 2006 14:38:05 +0000</pubDate>
		<dc:creator>iStef</dc:creator>
				<category><![CDATA[Experiences]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[dreamhost]]></category>

		<guid isPermaLink="false">http://blog.istef.info/2006/08/12/install-awstats-on-dreamhost/</guid>
		<description><![CDATA[Awstats 是一套强大的开源统计工具。它是基于日志进行统计的，支持 Apache 和 IIS 服务器。由于输出内容丰富，速度快效率高，目前被广泛应用。我的 Blog 所使用的主机为 Dreamhost，它提供每天的 Apache 访问日志，因此可以在这个平台上使用 Awstats。 关于 Awstats 的常规安装方法可以去参考它的说明，很详细。这里我只说一下如何在 Dreamhost 上进行安装。安装 Awstats 主要参考的材料是 Dreamhost Wiki 上提供的说明。我的过程和 DH 提供的略有不同。安装过程还算顺利，您可以先看看它输出的结果。 首先要打开您 Dreamhost 用户的 Shell 权限。如果您用的是 Windows 平台，可以使用 PuTTy 访问，如果是 linux 直接用 ssh 就可以了。 然后下载 Awstats 6.6，解压，将 wwwroot 目录下的文件全部上传到要安装的目录中。然后进入该目录，为 cgi-bin 目录下所有文件添加执行权限： chmod -R 0755 cgi-bin/ Awstats 需要一个目录存放生成的日志，这个目录要保证 Awstats 可写，建立一个即可： mkdir ~/awdata chmod [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://awstats.sourceforge.net/">Awstats</a> 是一套强大的开源统计工具。它是基于日志进行统计的，支持 Apache 和 IIS 服务器。由于输出内容丰富，速度快效率高，目前被广泛应用。我的 Blog 所使用的主机为 Dreamhost，它提供每天的 Apache 访问日志，因此可以在这个平台上使用 Awstats。</p>
<p>关于 Awstats 的常规安装方法可以去参考它的说明，很详细。这里我只说一下如何在 Dreamhost 上进行安装。安装 Awstats 主要参考的材料是 Dreamhost Wiki 上提供的<a href="http://wiki.dreamhost.com/index.php/AWStats_Installation">说明</a>。我的过程和 DH 提供的略有不同。安装过程还算顺利，您可以先看看它输出的<a href="http://istef.info/awstats/cgi-bin/awstats.pl?config=blog.istef.info">结果</a>。</p>
<p>首先要打开您 Dreamhost 用户的 Shell 权限。如果您用的是 Windows 平台，可以使用 PuTTy 访问，如果是 linux 直接用 ssh 就可以了。</p>
<p>然后下载 <a href="http://awstats.sourceforge.net/files/awstats-6.6.tar.gz">Awstats 6.6</a>，解压，将 wwwroot 目录下的文件全部上传到要安装的目录中。然后进入该目录，为 cgi-bin 目录下所有文件添加执行权限：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">chmod -R 0755 cgi-bin/</li></ol></div>
<p>Awstats 需要一个目录存放生成的日志，这个目录要保证 Awstats 可写，建立一个即可：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">mkdir ~/awdata</li>
<li>chmod 0755 ~/awdata</li></ol></div>
<p>完成以上步骤后，就要修改配置文件了。在 cgi-bin 目录下，有一个名为 awstats.example.com.conf，我们将它改名为欲统计域名文件。例如我要统计 blog.istef.info，那就将它改名为 awstats.blog.istef.info.conf。其实这也不是必须的，只是为了多配置文件时方便管理。编辑这个文件，在末尾添加如下行：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">LogFile=&quot;/home/yourusername/logs/domainname.com/http/access.log&quot;</li>
<li>SiteDomain=&quot;domainname.com&quot;</li>
<li>HostAliases=&quot;www.domainname.com&quot;</li>
<li>DNSLookup=0</li>
<li>DirData=&quot;/home/yourusername/awdata/&quot;</li>
<li>DirIcons=&quot;icon&quot;</li>
<li>SaveDatabaseFilesWithPermissionsForEveryone=0</li>
<li>DefaultFile=&quot;index.php index.html&quot;</li>
<li>LogFormat=&quot;%host %other %other %time1 %methodurl %code %bytesd %refererquot %uaquot&quot;</li></ol></div>
<p>上面的 yourusername 和 domainname.com 要换成你自己的。这样就基本完成了 awstats 的安装。</p>
<p>设置 cronjob，让 awstats 每天 1 点进行日志分析：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">cronjob -e</li></ol></div>
<p>添加一行</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">1 1 * * * ./istef.info/www/awstats/cgi-bin/awstats.pl -config=blog.istef.info -update</li></ol></div>
<p>然后 Ctrl+O Ctrl+X 保存即可。</p>
<p>Awstats 支持插件，而且插件也很丰富。你可以参考<a href="http://www.chedong.com/tech/awstats.html">车东的文章</a>，安装 GeoIP 和 GeoCity 这两个实用的插件。Dreamhost 上有编译所需的环境，编译时在 configure 的时候添加 &#8211;prefix=/home/yourusername/geoip 就可以了，很简单，这里就不再重复叙述了。有需要的朋友可以留言提问。
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.istef.info%2F2006%2F08%2F12%2Finstall-awstats-on-dreamhost%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.istef.info%2F2006%2F08%2F12%2Finstall-awstats-on-dreamhost%2F&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.istef.info/2006/08/12/install-awstats-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 1/21 queries in 0.009 seconds using memcached
Object Caching 682/718 objects using memcached

Served from: blog.istef.info @ 2012-02-13 15:25:07 -->
