`
isiqi
  • 浏览: 16035447 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

awstats安装流程

阅读更多
我是直接从网站上下的rpm,然后rpm -ivh的
然后直接安装到/usr/local/awstats
apache

日志格式要使用combined:

CustomLog " /var/log/httpd/access_log" combined

我是用的logrotate每天断日志,然后将以前的日志打包成gz存放,于是昨天的日志就是access_log.1.gz

添加主机(可以添加多个):

cd /usr/local/awstats/tools
perl awstats_configure.pl

Config file path ('none' to skip web server setup):
> /etc/httpd/conf/httpd.conf

Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

Your web site, virtual server or profile name:
> www.funbsd.net

Directory path to store config file(s) (Enter for default):
> /usr/local/etc/awstats

修改主机配置(/usr/local/etc/awstats/awstats.www.funbsd.net.conf),与httpd.conf保持一致:

#LogFile="gzip -d < log.gz |"
#LogFile="awstats/tools/logresolvemerge.pl *.log |"
LogFile="gzip -d < /var/log/httpd/access_log.1.gz |"
LogType=W
LogFormat=1
SiteDomain="www.funbsd.net"
HostAliases="funbsd.net www.funbsd.net 192.168.0.100"
DNSLookup=2

DirData="/var/lib/awstats"[这里我用的awstats目录里的data]
AllowToUpdateStatsFromBrowser=0
CreateDirDataIfNotExists=0
SaveDatabaseFilesWithPermissionsForEveryone=0
PurgeLogFile=0
ArchiveLogRecords=0
KeepBackupOfHistoricFiles=1

DefaultFile="index.htm index.html index.php"
SkipHosts="localhost REGEX[^192\.168\.]"
SkipFiles="REGEX[^\/images] REGEX[^\/css] REGEX[^\/scripts] REGEX[^\/awstats] REGEX[^*\.gif]"
Lang="auto"

#LoadPlugin="decodeutfkeys"
#LoadPlugin="hashfiles"
#LoadPlugin="geoip GEOIP_STANDARD"
#LoadPlugin="userinfo"
#LoadPlugin="hostinfo"

#Include ""

安装过程会自动在httpd.conf文件中添加下面的配置信息:

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/"
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

将缺省awstats.model.conf 命名成common.conf
修改其中的
LoadPlugin="decodeutfkeys"

重启Apache:

/usr/sbin/apachectl restart

统计旧的主机日志:

mkdir -p /var/lib/awstats [我配的就是/usr/local]
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=www.funbsd.net \
-update -Logfile=/var/log/httpd/www.funbsd.net.log[这里我的情况不同]
我直接:
/usr/local/awstats/tools/awstats_updateall.pl now -update -config=tdrd.org

定时统计所有主机日志:

0 * * * * /usr/local/awstats/tools/awstats_updateall.pl now -configdir=/usr/local/etc/awstats > /dev/null 2>&1
这里我的配置文件目录是/etc/awstats/
所以我的应该是10 8 * * * /usr/local/awstats/tools/awstats_updateall.pl now -update -config=tdrd.org > /dev/null 2>&1

测试:

我的是tdrd.org/awstats/awstats.pl?config=tdrd.org

plugin

awstats支持插件功能,以GeoIP为例:

网址:http://www.maxmind.com/app/perl?rId=awstats

cd /home/pkg
fetch http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
tar zxvf GeoIP.tar.gz
cd GeoIP-*; ./configure; make; make install

cd /home/pkg
fetch http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.27.tar.gz
tar zxvf Geo-IP-*.tar.gz
cd Geo-IP-*; perl Makefile.PL; make; make install

定时更新GeoIP库:

MAILTO=postmaster@funbsd.net
0 0 * * 0 cd /usr/local/share/GeoIP/ && fetch http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz && gunzip -f GeoIP.dat.gz

也可以从pkg安装各插件(参考配置文件PLUGINS一节):

pkg_add -r p5-URI.tbz
pkg_add -r p5-Encode-HanConvert.tbz
pkg_add -r p5-Storable.tbz
pkg_add -r GeoIP.tbz
pkg_add -r p5-Geo-IP.tbz
pkg_add -r p5-Net-XWhois.tbz

加载插件(/usr/local/etc/awstats/awstats.www.funbsd.net.conf):

LoadPlugin="decodeutfkeys"
LoadPlugin="hashfiles"
LoadPlugin="geoip GEOIP_STANDARD"
LoadPlugin="hostinfo"

我这里不能LoadPlugin="hostinfo"因为有东西没装上去

Error: Plugin load for plugin 'hostinfo' failed with return code: Error: Can't locate Net/XWhois.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . /usr/local/awstats/wwwroot/cgi-bin/lib /usr/local/awstats/wwwroot/cgi-bin/plugins /usr/local/awstats/wwwroot/cgi-bin/plugins) at (eval 5) line 1.

Setup ('/etc/awstats/awstats.tdrd.org.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory

后面又装了个qqhostinfo,用纯真数据库qqwry.dat来查ip比较符合中国现状

http://www.ieasy.org/reload/cat2/awstats_qqhosti.html

1。首先,点击这里qqhostinfo.pm下载插件。把它放在awstats/wwwroot/cgi-bin/plugins中。

2.下载上一篇blog提到的分析QQWry.dat的perl脚本。qqwry.pl放在同一目录。

3。去网上下载QQWry.Dat放在同一目录中,注意文件名一定要是QQWry.Dat

4。编辑你得awstats配置文件,大概在LoadPlugin="hostinfo"的后面增加一行

LoadPlugin="qqhostinfo"
但是qqwry.pl要改一下把其中dat的地方改成绝对路径
+++++++++++++++++++
apache 限制访问
htpasswd -c /var/www/htpasswd/awstats heater
htpasswd /var/www/htpasswd/awstats ruc
改http.conf
在最后面那个<Directory "/usr/local/awstats/wwwroot">
加上
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /var/www/htpasswd/awstats
Require valid-user
然后/usr/sbin/apachectl restart
+++++++++++++++++++++++++++++=
执行命令/usr/local/awstats/tools/awstats_updateall.pl now
-configdir=/etc/awstats
不过貌似得root执行?
每天定时执行就好
=======================================================================
相关资料的网页
AWStats: Apache/IIS的日志分析工具
——在GNU/Linux和Windows平台上的使用简介http://www.chedong.com/tech/awstats.html
Web服务器日志统计分析完全解决方案http://hi.baidu.com/yaobodi/blog/item/1d1e8913b962c6d0f6039e5d.html
AWStats 中文官方网站
获得先进统计表的免费的实时日志文档分析器.http://www.awstats.cn/
http://sourceforge.net/projects/awstats/
=======================================================================
分享到:
评论

相关推荐

    awstats安装软件及说明

    Advanced Web Statistics(AWStats)是一个免费的功能强大的服务器日志分析工具,它可以告诉你所有的Web统计数据,包括访问量、访问者数量、页面、点击、高峰时段、操作系统、浏览器版本、搜索引擎、关键字、机械访问...

    awstats安装

    awstats下载和安装: 此软件为perl脚本,机器上有perl环境就可以直接执行了。

    安装awstats分析apache日志.docx

    1 安装软件 1. 安装包下载地址:http://awstats.sourceforge.net/ 2. 上传awstats-7.0.tar.gz到/usr/local目录下。 3. 赋予执行权限。 #chmod +x awstats-7.0.tar.gz 4. 解压文件。 #tar zxvf awstats-7.0.tar.gz 5....

    awstats_配置详解

    awstats_配置详解

    AWStats日志分析工具在IIS6、IIS7的安装说明

    AWStats日志分析工具在IIS6、IIS7的安装说明 AWStats日志分析工具在IIS6、IIS7的安装说明 AWStats日志分析工具在IIS6、IIS7的安装说明

    awstats在win+apache环境下的安装与配置

    awstats在windows+apache环境下的安装与配置,包括很多在wwindows下需要注意的与linux不同的细节,以及最后的调试过程的注意事项

    awstats-7.3.tar.gz

    AWStats Official Web Site - Compile and generate advanced graphical web, ftp or mail statistics with a logfile analysis (For IIS, Apache,... distributed...

    Awstats v7.1.1 最好的TomCat统计插件

    最好的TomCat来访用户统计软件,安装简单,功能强大,支持中文。

    awstats分析网站日志

    利用awstats对日志进行分析 以网页的方式查看自己网站的流量 PV 等

    awstats手动更新旧记录

    awstats手动更新旧记录,来自网络,测试通过 附件为保存网页,也可到网上找相关同类文档 awstats手动更新旧记录,来自网络,测试通过 附件为保存网页,也可到网上找相关同类文档

    awstats统计工具

    Awstats是一个免费非常简洁而且强大有个性的统计工具。它可以统计您站点的如下信息: 一:访问量,访问次数,页面浏览量,点击数,数据流量等 二:精确到每月、每日、每小时的数据 三:访问者国家 四:访问者IP 五:...

    awstats 分析IIS日志

    awstats 检测IIS的日志文件,非常好用

    awstats-7.1 beta最新版本的awstats

    最新版本的awstats,不过是beta版本的,我已经在win和debian上测试了,速度比较快,因为分析的站点日志比较的大,貌似比7.0略快,而且很少出500错误,建议试试。

    awstats for windows

    awstats 分析apache的访问日志

    awstats-7.0.tar.gz

    awstats-7.0.tar.gz 非常好用的日志分析软件。

    awstats日志分割工具

    日志分割工具 ,工具有依赖,所以安装的时候:用yum localinstall 安装。具体使用方法可以baidu,网上博文,怎么没办法选择0积分呢?

    AWStats- 非常好用Apache,vsftp日志分析工具

    AWStats 是一个免费的强大而有个性的工具,带来先进的. 本日志分析器作为CGI或从命令行在数个图形网页中显示你日志中包含的所有可能信息. 它利用一部分档案资料就能经常很快地处理大量日志档案, 它能分析日志文件来自...

    awstats-IP纯真库软件包.rar

    AWStats+QQ纯真库IP解析插件安装,软件包内容包括:qqwry.dat(最新);qqwry.pl;qqhostinfo.pm;安装说明;安装说明内容:qqwry.pl;qqhostinfo.pm;awstats注配置文件的修改,及如何更新IP库等步骤

    Nginx 日志分析 AWStats + JAWStats 安装配置.docx

    Nginx 日志分析 AWStats + JAWStats 安装配置 Awstats 是一款基于 Perl 的 WEB 日志分析工具,而 JAWStats 是一款基于 PHP 的统计套件,旨在为 Awstats 提供更为精美图形界面。

    AWSTATS的简单安装及配置[参考].pdf

    AWSTATS的简单安装及配置[参考].pdf

Global site tag (gtag.js) - Google Analytics