设为首页 收藏本站
查看: 1721|回复: 0

[经验分享] Windows2003/XP上AWstats安装教程

[复制链接]

尚未签到

发表于 2017-5-21 11:49:40 | 显示全部楼层 |阅读模式
今天学习了在AWstats的安装教程,略有收获,还有待研究,希望各位仁兄指导!

教程如下:
感谢:
文章来自: http://www.servertechnology.cn/archives/693.html

win32 awstats 安装记 by Emerald 绿色学院 - Green Institute

一. awstats 简介
二. 下载 awstats
三. 安装 awstats
四. 下载和使用 cronolog
五. 设置 apache 的 httpd.conf 配置文件
六. 设置 AWStats
七. 更新 AWStats

/-*-------------------------------------------------------------------------------------*-/

一. awstats 简介

what is awstats

awstats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. this log analyzer works as a cgi or from command line and shows you all possible information your log contains, in few graphical web pages. it uses a partial information file to be able to process large log files, often and quickly. it can analyze log files from all major server tools like apache log files (ncsa combined/xlf/elf log format or common/clf log format), webstar, iis (w3c log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.
take a look at this comparison table for an idea on features and differences between most famous statistics tools (awstats, analog, webalizer,...).
awstats is a free software distributed under the gnu general public license. you can have a look at this license chart to know what you can/can't do.
as awstats works from the command line but also as a cgi, it can work with major web hosting provider which allow perl, cgi and log access.

you can browse awstats demo (real-time feature to update stats from web has been disabled on demos) to see a sample of most important information awstats shows you...

1. demo for web server log files
http://awstats.sourceforge.net/cgi-bin/awstats.pl

2. static demo for ftp log files
http://awstats.sourceforge.net/awstats.ftp.html

3. static demo for mail log files
http://awstats.sourceforge.net/awstats.mail.html

/-*-------------------------------------------------------------------------------------*-/

二. 下载 awstats
http://awstats.sourceforge.net/#download

----------------------------------------------------
注: 既然题目是安装记了, 嘻嘻, 那自然完全按我的方法进行.
----------------------------------------------------

我是下载 awstats-6.4.exe 自安装版本.

/-*-------------------------------------------------------------------------------------*-/

三. 安装 awstats

1. 运行 awstats-6.4.exe

2. 安装目录我设置 为: j:\awstats\

3.
#---------------------------------------------------
do you want me to build a new awstats config/proifle file
#---------------------------------------------------
选 y

4.
#---------------------------------------------------
your web site, virtual server or profile name:
#---------------------------------------------------
输入你网站的域名, 我的: gi.2288.org:88

5. 接着按两下 enter 键完成基本安装.

/-*-------------------------------------------------------------------------------------*-/

四. 下载和使用 cronolog
http://cronolog.org/download/index.html

win 32 version (zip file)

----------------------------------------------------
注: cronolog 功能主要是用于按天数截断 apache 日志.
----------------------------------------------------

1. 解压 cronolog-1.6.1-win32 zip 包.

2. 复制 cronolog.exe 到 apache 的 bin 目录,
我的是复制到:
#---------------------------------------------------
c:\program files\apache group\apache2\bin\
#---------------------------------------------------

/-*-------------------------------------------------------------------------------------*-/

五. 设置 apache 的 httpd.conf 配置文件

1. 打开 httpd.conf 文件.

2. 先注释掉以前的日志文件
例, 我以前的日志是:

#---------------------------------------------------
customlog logs/access_log.log common env=!image-request
#---------------------------------------------------

在前面加个#字符注释掉,例:
#---------------------------------------------------
#customlog logs/access_log.log common env=!image-request
#---------------------------------------------------

3. 重新定义日志记录文件
例:
#---------------------------------------------------
customlog "|bin/cronolog.exe logs/access_%y%m%d.log" combined env=!image-request
#---------------------------------------------------

4. 为 awstats 设置虚拟目录, 我是安装在 j:\awstats\
例:
#---------------------------------------------------
# awstats
alias /awstatsclasses "j:/awstats/wwwroot/classes/"
alias /awstatscss "j:/awstats/wwwroot/css/"
alias /awstatsicons "j:/awstats/wwwroot/icon/"
scriptalias /awstats/ "j:/awstats/wwwroot/cgi-bin/"

options +execcgi
allowoverride none
order allow,deny
allow from all

#---------------------------------------------------

5. 总结 apache httpd.conf 的设置
#---------------------------------------------------
##############################################################
## 避免对图片的请求出现在访问日志中
setenvif request_uri \.gif image-request
setenvif request_uri \.jpg image-request
setenvif request_uri \.png image-request
setenvif request_uri \.jpeg image-request

## 记录使用英语的请求到一个日志,而记录非英语的请求到另一个日志
#setenvif accept-language "en" english

#customlog logs/english_log.log common env=english
#customlog logs/non_english_log.log common env=!english
#customlog logs/access_log.log common env=!image-request

#customlog logs/access_log.log common env=!image-request
#customlog "logs/access_log.%y%m%d" combined env=!image-request
##############################################################

customlog "|bin/cronolog.exe logs/access_%y%m%d.log" combined env=!image-request

########################################################
# awstats
alias /awstatsclasses "j:/awstats/wwwroot/classes/"
alias /awstatscss "j:/awstats/wwwroot/css/"
alias /awstatsicons "j:/awstats/wwwroot/icon/"
scriptalias /awstats/ "j:/awstats/wwwroot/cgi-bin/"

options +execcgi
allowoverride none
order allow,deny
allow from all

########################################################
#---------------------------------------------------

6. 如果设置好的话, 重新启动 apache
#---------------------------------------------------
net stop apache2
net start apache2
#---------------------------------------------------

7. 一切顺利的话, 在 apache 的 log 目录应该有这样格式的日志显示
#---------------------------------------------------
access_20050309.log
#---------------------------------------------------

----------------------------------------------------
注: c:\program files\apache group\apache2\logs
----------------------------------------------------

8. 一切完成的话那就摆平 apache 方面的设置, 接着是 设置 awstats.

/-*-------------------------------------------------------------------------------------*-/

六. 设置 AWStats

1. 进入 J:\awstats\wwwroot\cgi-bin\ 目录

2. 打开 awstats.model.conf, 复制 awstats.model.conf 的内容到 awstats.gi.2288.org.conf 文件.
----------------------------------------------------
注: 我安装后 awstats.gi.2288.org.conf 里是空白的.
----------------------------------------------------

3. 查找 Logfile 字符串, 设置为:
#---------------------------------------------------
LogFile="C:\Program Files\Apache Group\Apache2\logs\access_%YYYY-24%MM-24%DD-24.log"
#---------------------------------------------------

4. 在 awstats.gi.2288.org.conf 文件里按 CTRL+F 查找 SiteDomain 字符串, 添加站点域名, 例:
#---------------------------------------------------
SiteDomain="gi.2288.org:88"
#---------------------------------------------------

5. 查找 HostAliases 字符串, 添加站点根域名, 我没有, 所以就让它成为默认状态.

6. 查找 DirData 字符串, 我的设置:
#---------------------------------------------------
DirData="."
#---------------------------------------------------

7. 查找 LoadPlugin="decodeutfkeys", 去掉前面的 # 字符, 例:
#---------------------------------------------------
#LoadPlugin="decodeutfkeys"
LoadPlugin="decodeutfkeys"
#---------------------------------------------------

8. AWStats 的设置完成大半部分了, 接着该是更新了, 要用到 Perl.
----------------------------------------------------
注: 不需要指定 Include"" 里的包含文件.
----------------------------------------------------

/-*-------------------------------------------------------------------------------------*-/

七. 更新 AWStats

1. 命令行方式 进入 Perl 安装目录的 Bin 目录, 例如我的:
#---------------------------------------------------
C:\Perl\bin>
#---------------------------------------------------

2. 运行下面的命令更新,例:
#---------------------------------------------------
perl J:\awstats\wwwroot\cgi-bin\awstats.pl -update -config=gi.2288.org
#---------------------------------------------------

显示为:
----------------------------------------------------
C:\Perl\bin>perl J:\awstats\wwwroot\cgi-bin\awstats.pl -update -config=gi.2288.
org
Update for config "J:\awstats\wwwroot\cgi-bin/awstats.gi.2288.org.conf"
With data in log file "C:\Program Files\Apache Group\Apache2\logs\access_2005030
8.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 52)
Jumped lines in file: 52
Found 52 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.

C:\Perl\bin>
----------------------------------------------------
###########################################################
############################################################
############################################################
# 注意在这个步骤折中我没有出现上面的显示结果,而是出现如下结果:
C:\Perl\bin>perl c:\AWStats\wwwroot\cgi-bin\awredir.pl --update -config=www.levomobile.com
----- awredir 1.1 (build 1.6) (c) Laurent Destailleur -----
This script is absolutely not required to use AWStats.
It's a third tool that can help webmaster in their tracking tasks but is not used by AWStats engine.

This tools must be used as a CGI script. When called as a CGI, it returns to
browser a redirector to tell it to show the page provided in 'url' parameter.
So, to use this script, you must replace HTML code for external links onto you
HTML pages from
<a href="http://externalsite/pagelinked">Link</a>
to
<a href="http://mysite/cgi-bin/awredir.pl?url=http://externalsite/pagelinked">
nk</a>

For your web visitor, there is no difference. However this allow you to track
clicks done on links onto your web pages that point to external web sites,
because an entry will be seen in your own server log, to awredir.pl script
with url parameter, even if link was pointing to another external web server.
############################################################
############################################################
###########################################################

3. 这时在 J:\awstats\wwwroot\cgi-bin 下会多了一个 awstats032005.gi.2288.org.txt 的文本文件.
##################################
也没有出现该文件。
##################################

4. 完成了...

/-*-------------------------------------------------------------------------------------*-/

附加: 在 AWStats 目录下有一个 DOC 目录, 里面有参考资料, 慢慢看, 还有很多用处, 我也是熟悉中.

################################################################
对于上面的原因可能是我本机上没有www.lenovomobile.com 这个域名的网站,
但是我把地址改为127.0.0.1 也不好使用,还有就是
options +execcgi
allowoverride none
order allow,deny
allow from all
这段配置我没有加,因为加上apache报错无法启动。

另外在安装AWstats前一定要安装perl:
ActivePerl-5.6.1.638-MSWin32-x86.msi
我对perl属于门外汉 可能是我配置的错误,
向大家请教, 谁能帮我解释一下出现的错误?谢谢了

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-379569-1-1.html 上篇帖子: AWStats+QQ纯真库IP解析插件安装 下篇帖子: AWStats 6.4 final安装笔记
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表