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

[经验分享] win32 awstats 安装记 by Emerald 绿色学院

[复制链接]

尚未签到

发表于 2015-11-27 14:37:06 | 显示全部楼层 |阅读模式
绿色学院 - green institute - 不听人间乐 - 想得到 - 做得到 - xoopswin32 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
<required if first install [y/n] ?
#---------------------------------------------------
选 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 &quot;|bin/cronolog.exe logs/access_%y%m%d.log&quot; combined env=!image-request
#---------------------------------------------------
  4. 为 awstats 设置虚拟目录, 我是安装在 j:/awstats/
例:
#---------------------------------------------------
# awstats
alias /awstatsclasses &quot;j:/awstats/wwwroot/classes/&quot;
alias /awstatscss &quot;j:/awstats/wwwroot/css/&quot;
alias /awstatsicons &quot;j:/awstats/wwwroot/icon/&quot;
scriptalias /awstats/ &quot;j:/awstats/wwwroot/cgi-bin/&quot;
<directory &quot;j:/awstats/wwwroot&quot;>
options +execcgi
allowoverride none
order allow,deny
allow from all
</directory>
#---------------------------------------------------
  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 &quot;en&quot; 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 &quot;logs/access_log.%y%m%d&quot; combined env=!image-request
##############################################################
  customlog &quot;|bin/cronolog.exe logs/access_%y%m%d.log&quot; combined env=!image-request
  ########################################################
# awstats
alias /awstatsclasses &quot;j:/awstats/wwwroot/classes/&quot;
alias /awstatscss &quot;j:/awstats/wwwroot/css/&quot;
alias /awstatsicons &quot;j:/awstats/wwwroot/icon/&quot;
scriptalias /awstats/ &quot;j:/awstats/wwwroot/cgi-bin/&quot;
<directory &quot;j:/awstats/wwwroot&quot;>
options +execcgi
allowoverride none
order allow,deny
allow from all
</directory>
########################################################
#---------------------------------------------------
  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=&quot;C:/Program Files/Apache Group/Apache2/logs/access_%YYYY-24%MM-24%DD-24.log&quot;
#---------------------------------------------------
  4. 在 awstats.gi.2288.org.conf 文件里按 CTRL+F 查找 SiteDomain 字符串, 添加站点域名, 例:
#---------------------------------------------------
SiteDomain=&quot;gi.2288.org:88&quot;
#---------------------------------------------------
  5. 查找 HostAliases 字符串, 添加站点根域名, 我没有, 所以就让它成为默认状态.
  6. 查找 DirData 字符串, 我的设置:
#---------------------------------------------------
DirData=&quot;.&quot;
#---------------------------------------------------
  7. 查找 LoadPlugin=&quot;decodeutfkeys&quot;, 去掉前面的 # 字符, 例:
#---------------------------------------------------
#LoadPlugin=&quot;decodeutfkeys&quot;
LoadPlugin=&quot;decodeutfkeys&quot;
#---------------------------------------------------
  8. AWStats 的设置完成大半部分了, 接着该是更新了, 要用到 Perl.
----------------------------------------------------
注: 不需要指定 Include&quot;&quot; 里的包含文件.
----------------------------------------------------
  /-*-------------------------------------------------------------------------------------*-/
  七. 更新 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 &quot;J:/awstats/wwwroot/cgi-bin/awstats.gi.2288.org.conf&quot;
With data in log file &quot;C:/Program Files/Apache Group/Apache2/logs/access_2005030
8.log&quot;...
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>
----------------------------------------------------
  3. 这时在 J:/awstats/wwwroot/cgi-bin 下会多了一个 awstats032005.gi.2288.org.txt 的文本文件.
  4. 完成了...
  /-*-------------------------------------------------------------------------------------*-/
  附加: 在 AWStats 目录下有一个 DOC 目录, 里面有参考资料, 慢慢看, 还有很多用处, 我也是熟悉中.
  偶的 AWSTATS 地址: http://gi.2288.org:88/awstats/awstats.pl?month=07&year=2005&output=main&config=gi.2288.org&framename=index
  /****************************************************************/
*
* author : Emerald<btbtd@yahoo.com.cn>
*
* homepage : http://gi.2288.org:88/
*
* Seo-Gi : http://seo.2288.org:99
*
* sitename : 绿色学院 - Green Institute
*
* date : 2005-3-9 23:06:50
*
/****************************************************************/

TXT 文件:
win32 awstats 安装记 by emerald 绿色学院 - green institute一. awstats 简介二. 下载 awstats三. 安装 awstats四. 下载和使用 cronolog五. 设置 apache 的 httpd.conf 配置文件六. 设置 AWStats七. 更新 AWStats /-*-------------------------------------------------------------------------------------*-/一. awstats 简介what is awstatsawstats 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 fileshttp://awstats.sourceforge.net/cgi-bin/awstats.pl2. static demo for ftp log fileshttp://awstats.sourceforge.net/awstats.ftp.html3. static demo for mail log fileshttp://awstats.sourceforge.net/awstats.mail.html/-*-------------------------------------------------------------------------------------*-/二. 下载 awstatshttp://awstats.sourceforge.net/#download----------------------------------------------------注: 既然题目是安装记了, 嘻嘻, 那自然完全按我的方法进行.----------------------------------------------------我是下载 awstats-6.4.exe 自安装版本./-*-------------------------------------------------------------------------------------*-/三. 安装 awstats1. 运行 awstats-6.4.exe2. 安装目录我设置 为: j:/awstats/3. #---------------------------------------------------do you want me to build a new awstats config/proifle file  options +execcgiallowoverride none order allow,deny allow from all #---------------------------------------------------5. 总结 apache httpd.conf 的设置#---------------------------------------------------################################################################ 避免对图片的请求出现在访问日志中setenvif request_uri /.gif image-requestsetenvif request_uri /.jpg image-requestsetenvif request_uri /.png image-requestsetenvif 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######################################################### awstatsalias /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 +execcgiallowoverride none order allow,deny allow from all #########################################################---------------------------------------------------6. 如果设置好的话, 重新启动 apache #---------------------------------------------------net stop apache2net start apache2#---------------------------------------------------7. 一切顺利的话, 在 apache 的 log 目录应该有这样格式的日志显示#---------------------------------------------------access_20050309.log#-------------------------------------------------------------------------------------------------------注: c:/program files/apache group/apache2/logs----------------------------------------------------8. 一切完成的话那就摆平 apache 方面的设置, 接着是 设置 awstats./-*-------------------------------------------------------------------------------------*-/六. 设置 AWStats1. 进入 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.orgUpdate 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_20050308.log"...Phase 1 : First bypass old records, searching new record...Direct access after last parsed record (after line 52)Jumped lines in file: 52Found 52 already parsed records.Parsed lines in file: 0Found 0 dropped records,Found 0 corrupted records,Found 0 old records,Found 0 new qualified records.C:/Perl/bin>----------------------------------------------------3. 这时在  J:/awstats/wwwroot/cgi-bin 下会多了一个 awstats032005.gi.2288.org.txt 的文本文件.4. 完成了.../-*-------------------------------------------------------------------------------------*-/附加: 在 AWStats 目录下有一个 DOC 目录, 里面有参考资料, 慢慢看, 还有很多用处, 我也是熟悉中.偶的 AWSTATS 地址: http://gi.2288.org:88/awstats/awstats.pl?month=07&year=2005&output=main&config=gi.2288.org&framename=index/****************************************************************/** author: Emerald** homepage: http://gi.2288.org:88/** Seo-Gi: http://seo.2288.org:99** sitename: 绿色学院 - Green Institute** date: 2005-3-9 23:06:50*/****************************************************************/

运维网声明 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-144176-1-1.html 上篇帖子: 站长经验:Apache日志分析工具Awstats的安装和配置 下篇帖子: 使用 awstats 做 vsFTP 記錄分析
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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