1. 解压源码包
[root@MFS-chunkserver-2 ]#cd /srv/
[root@MFS-chunkserver-2 ]#tar zvxf awstats-6.6.tar.gz
[root@MFS-chunkserver-2 ]#tar zvxf cronolog-1.6.2.tar.gz
2. 安装awstats
[root@MFS-chunkserver-2 ]#mv awstats-6.6 /usr/local/
[root@MFS-chunkserver-2 ]#cd /usr/local/
[root@MFS-chunkserver-2 ]#mv awstats-6.6/ awstats
[root@MFS-chunkserver-2 ]#cd awstats/
[root@MFS-chunkserver-2 ]#cd tools/
[root@MFS-chunkserver-2 ]#perl awstats_configure.pl
3. 安装cronlog
[root@MFS-chunkserver-2 ]#cd /srv/
[root@MFS-chunkserver-2 ]#cd cronolog-1.6.2
[root@MFS-chunkserver-2 ]#./configure
[root@MFS-chunkserver-2 ]#make
[root@MFS-chunkserver-2 ]#make install
4. 编辑apache 的配置文件
[root@MFS-chunkserver-2 ]# vi /etc/httpd/conf/httpd.conf(添加如下内容)
<VirtualHost 192.168.10.251>
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
ServerName ispace.qubaoquan.com
CustomLog "|/usr/local/sbin/cronolog
/var/log/http/qubaoquan/%Y-%m-%d.access.log" combined
ErrorLog "/var/log/http/qubaoquan/qubaoquan.error_log"
DocumentRoot /usr/local/tomcat/webapps/ispace1/
<Directory "/usr/local/tomcat/webapps/ispace1/">
Options Includes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
5. 创建日志目录并且赋权
[root@MFS-chunkserver-2 ]# mkdir -p /var/log/http/qubaoquan
[root@MFS-chunkserver-2 ]# chown -R apache:apache
/var/log/http/qubaoquan
6. 编辑awstats 配置文件
[root@MFS-chunkserver-2 ]#vi
/etc/awstats/awstats.ispace.qubaoquan.com.conf(更改如下选项)
LogFile="/var/log/http/qubaoquan/%YYYY-0%MM-0%DD-0.access.log"
DirData="/usr/local/awstats/data"
7. 创建数据目录
[root@MFS-chunkserver-2 ]#mkdir -p /usr/local/awstats/data/
8. 创建自动化任务
[root@MFS-chunkserver-2 ]#crontab -e
* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update
-config=ispace.qubaoquan.com
9 现在就可以通过浏览器访问日志分析页面.
http://192.168.10.195/awstats/awstats.pl?config=ispace.qubaoquan.com
注释:现在生成的日志文件的格式名格式为:2010-03-24.access.log