awstats
一、首先修改httpd.conf   httpd-vhost.conf
把log模式由common改成combined
vi /usr/local/apache2/conf/httpd.conf
vi /usr/local/apache2/conf/extra/httpd-vhost.conf
/usr/local/apache2/bin/apachectl restart

二、安装Geo-IP
wget  
http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.3.tar.gz

wget
http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.30.tar.gz

wget  
http://search.cpan.org/CPAN/authors/id/G/GM/GMPASSOS/Geo-IPfree-0.2.tar.gz

cd /usr/local/src

tar zxvf GeoIP-1.4.3.tar.gzcdGeoIP-1.4.3./configuremakemake install tar zxvf Geo-IP-1.30.tar.gzcdGeo-IP-1.30perl Makefile.PLmakemake install
tar zxvf Geo-IPfree-0.2.tar.gzcd Geo-IPfree-0.2perlMakefile.PLmakemake install

三、安装awstats
1、下载并安装
wget  
http://downloads.sourceforge.net/awstats/awstats-6.7.tar.gz

tar zxvf awstats-6.7.tar.gz
mv awstats-6.7 /usr/local/awstats
cd /usr/local/awstats
cd /usr/local/awstats/tools
perl awstats_configure.pl

2、配置
vi /etc/awstats/awstats.www.web.cn.conf
DirData="/usr/local/apache2/htdocs/awstats/data"
DirIcons="/awstats/icon"
DirCgi="/usr/local/apache2/cgi-bin/awstats"
LogFile="/usr/local/apache2/logs/www.web.cn-access_log"

(1)多日志合并分析(例:新浪播客其中两台服务器2月6日的日志30.0206.vblog.log与31.0206.vblog.log)
LogFile="/opt/awstats/tools/logresolvemerge.pl/var/apachelogs/30.0206.vblog.log /var/apachelogs/31.0206.vblog.log|"

LogFile="/opt/awstats/tools/logresolvemerge.pl/var/apachelogs/*.0206.vblog.log|"
SiteDomain=
www.web.cn

HostAliases=
www.web.cn

AllowToUpdateStatsFromBrowser=1
Lang="cn"
LoadPlugin=”decodutfkeys”
LoadPlugin="geoip GEOIP_STANDARD/usr/local/share/GeoIP/GeoIP.dat"
#LoadPlugin="geoipfree"
#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD/usr/local/share/GeoIP/GeoLiteCity.dat"

注释:GeoIP.dat 跟geoipfree2者只能选一个,不能同时使用的!我选的是GeoIP.dat
加了GeoLiteCity.dat 貌似有反向的解析,整体的awstats会变慢。所以实验了一下,实际的应用不建议使用!
同时经过实际的测试geoipfree2的准确性太差,把国内的地址认为是美国的,所以还是使用GeoIP吧。

3、拷贝cgi、data、icon
cp -r /usr/local/awstats/wwwroot/cgi-bin//usr/local/apache2/cgi-bin/awstats
mkdir -p /usr/local/apache2/htdocs/awstats/data
chmod 777 /usr/local/apache2/htdocs/awstats/data
cp -r /usr/local/awstats/wwwroot/icon//usr/local/apache2/htdocs/web/awstats/icon

/usr/local/apache2/bin/apachectl restart

/usr/local/apache2/cgi-bin/awstats/awstats.pl -update-config=www.web.cn
在浏览器中打开以下网站

http://www.web.cn/cgi-bin/awstats/awstats.pl?config=www.web.cn

注释:
LogFile (APCHE CustomLog日志的绝对路径)DirData  (指定AWSTATS生成数据的存放目录,可以任意指定,但注意目录要具有读写权限,可以设置为777或755)DirCgi  (cgi的路径,是相对于网站根目录的绝对路径,我这里没有指定网站根目录是因为apache的配置默认有cgi-bin的缺省目录,我是拷贝到这个缺省目录中的)DirIcons  (icon的路径,是相对于网站根目录的绝对路径,这个就没办法了,只能放到每个要设定的虚拟域名网站的目录中了)SiteDomain (输入你的域名)HostAliases (主机别名,如果还有其他的二级域名或三级域名,请在此添加。)AllowToUpdateStatsFromBrowser (是否允许用户从浏览器中实时更新统计,这个功能在测试的时候很有用!)Lang="cn"(设置网页显示语言为简体中文。)

更新Geo-IP的2个免费数据库
mkdir -p /home/soft/awstats
cd /home/soft/awstats
wget
http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

wget
http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz

gunzip GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
cp GeoLiteCity.dat /usr/local/share/GeoIP/
cp GeoIP.dat /usr/local/share/GeoIP/

cd /usr/local/share/GeoIP

测试AWSTATS
/usr/local/apache2/cgi-bin/awstats/awstats.pl -update-config=www.web.cn

如果不出现错误信息并且得到统计数据回显则成功!
访问地址:
http://www.web.cn/cgi-bin/awstats/awstats.pl?config=www.web.cn

设置crondcrontab -e增加:(可设置为每天零时进行更新)00 * * * /usr/local/apache2/cgi-bin/awstats/awstats.pl -update-config=www.web.cn

修改httpd.conf设置/usr/local/apache2/cgi-bin/awstats目录访问权限
这样就可以通过用户名和密码来限制可以访问的计算机了

vi /usr/local/apache2/conf/httpd.conf

/usr/local/apache2/cgi-bin/awstats">
AllowOverride authconfig
Order allow,deny
Allow from all

vi /usr/local/apache2/htdocs/cgi-bin/awstats/.htaccess
AuthType Basic
AuthName "请输入用户名和密码"
AuthUserFile /usr/local/apache2/
cgi-bin/awstats/passwords
Require valid-user
htpasswd -c /usr/local/apache2/
cgi-bin/awstats/passwordsadminsarg
重复输入2次密码

/usr/local/apache2/bin/apachectl restart

完工!

注释:perl awstats_configure.pl的过程
----- AWStats awstats_configure 1.0 (build 1.7) (c) Laurent Destailleur-----
This tool will help you to configure AWStats to analyze statistics for
one web server. You cantry to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file'/usr/local/apache2/conf/httpd.conf'

-----> Check and complete web server config file'/usr/local/apache2/conf/httpd.conf'

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

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

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
>
www.web.cn

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.www.web.cn.conf'
Config file /etc/awstats/awstats.www.web.cn.conf created.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.web.cn
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...

A SIMPLE config file has been created: /etc/awstats/awstats.www.web.cn.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.web.cn' with command:
> perl awstats.pl -update -config=www.web.cn
You can also read your statistics for 'www.web.cn' with URL:
>
http://localhost/awstats/awstats.pl?config=www.web.cn

Press ENTER to finish...

注释:
www.web.cn
是借用的,不是真的,是举个例子的!

注释:  当AllowToUpdateStatsFromBrowser (是否允许用户从浏览器中实时更新统计,这个功能在测试的时候很有用!)=1时 When this parameter is set to 1, AWStatsadds a button on report page toallow to "update" statistics from aweb browser. Warning, when "update" ismade from a browser, AWStats isrun as a CGI by the web server user definedin your web server (user"nobody" by default with Apache, "IUSR_XXX" withIIS), sothe "DirData" directory and all already existing historyfilesawstatsMMYYYY[.xxx].txt must be writable by this user. Change permissionsifnecessary to "Read/Write" (and "Modify" for Windows NTFSfile systems).

当这个参数设置为1,AWStats添加一个按钮toallow报告页“更新”统计一个浏览器。警告,当“更新”ismade从一个浏览器,AWStats运行CGI的作为一个网络服务器的用户definedin你的网络服务器(默认用户“没有人”与“IUSR_XXX”withIIS鞍鞯,制作出),因此这种“DirData”目录和所有已存在的历史filesawstatsMMYYYY[xxx]。txt必须可写的这个用户。改变权限ifnecessary“读/写”(“修改”对于Windows NTFS文件系统)。修改DirData权限777。

安装qq纯真库。

将3个文件复制到cgi-bin/awstats/plugins/下

修改qqhostinfo文件

require"/usr/local/apache2/cgi-bin/awstats/plugins/qqwry.pl";

修改qqwry.pl

my$ipfile="/usr/local/apache2/cgi-bin/awstats/plugins/QQWry.Dat";(注意dat是大写还是小写)

修改/etc/awstats/awstats.xkyx.com

加上LoadPlugin="qqhostinfo"

修改LoadPlugin="decodeutfkeys"

LoadPlugin="tooltips"

LoadPlugin="hashfiles"

LoadPlugin="geoipGEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"(可选是否删除在国际栏显示区别)

Update就行了显示在国家Location

awstats 配置相关推荐

  1. WAMP 下 awstats 配置

    1.配置好wamp apache 支持Perl 可以参见前面的文章<WAMP Apache 配置 Perl> 2.下载awstats-7.8 https://awstats.sourcef ...

  2. tomcat日志分析工具awstats配置

    Awstats是一个免费非常简洁而且强大有个性的统计工具. 配置环境:windows xp.tomcat 6.0.26.Awstats 6.95.ActivePerl-5.12.2.1202 一.下载 ...

  3. awstats linux日志分析,Linux/Centos服务器安装配置日志分析Awstats

    Awstats是用perl语言编写的web日志分析软件,可用于Apache.IIS.Nginx访问日志分析,界面友好.功能强大,支持中文显示. LAMP环境下Awstats安装:wget http:/ ...

  4. awstats linux日志分析,(总结)Linux下使用awstats分析Nginx的日志详情

    系统环境为CenoOS 5.6,详细请参考之前的日志<CentOS 5.x使用yum安装Nginx+PHP(FastCGI)+MySQL生产环境>. Awstats 是目前最流行的日志分析 ...

  5. 王高利:awstats

    一.前言 二.awstats 简介 三.awstats 特点 四.awstats 运行原理 五.awstats 安装与配置详解 六.awstats 执行日志分析 七.awstats 进行多站点日志分析 ...

  6. awstats 简单日志分析

    1.下载awstats (确保perl 语言已经安装) wget http://jaist.dl.sourceforge.net/project/awstats/AWStats/7.2/awstats ...

  7. rhel5.5下安装awstats实现网站流量监控

    Awstats是一个免费的并且简洁强大的统计工具.它可以统计您站点的诸多信息,比如流量.流量来源.Robots/Spiders的统计.访客操作系统浏览器等等信息.是非常实用的,本文将用工作中的实战向您 ...

  8. web 日志分析工具 awstats 简单安装

    awstats安装使用 awstats是一个开源的日志分析工具,用perl编写.感觉还不错,把安装记录写下,也许有人用的到. 可以分析大部分标准日志数据,如apache的,nginx的都可以 首先下载 ...

  9. Awstats配置说明

    作为一个基于Perl并以日志作为网站流量分析的工具,Awstats在设计上表现了强大的应用性. 1.原理 每个服务器可以建立很多个网站,每个网站有一个日志存储地址,Awstats通过被统计的网站的配置 ...

最新文章

  1. ICCV 2019论文投稿数破纪录,中科院、清华名列前茅,苹果垫底
  2. cross_val_score的使用
  3. JZOJ 5463. 【NOIP2017提高A组冲刺11.8】证书
  4. Lingoes 2.8 手动去广告步骤
  5. 相对湿度计算软件_空调工程负荷详细计算方法(附有实例)
  6. Java多线程系列(五):线程池的实现原理、优点与风险、以及四种线程池实现
  7. Qt文档阅读笔记-QSslConfiguration官方解析与实例
  8. CSS常用单词-弹性盒(专业版)
  9. 304 ajax,ajax中304缓存处理
  10. matlab 0到正无穷求和,1/k!k从0到无穷求和是多少
  11. Ubuntu 普通用户无法启动Google chrome
  12. 容器精华问答 | Docker是否比虚拟技术要好?
  13. 软件定义网络入门学习笔记3-学习第一个ryu app-simple_switch_13.py
  14. sqrt mysql_详解MySQL中的SQRT函数的使用方法_MySQL
  15. smartbi mysql_如何修改smartbi自带的mysql的root用户的密码
  16. 第二届“梧桐杯”复赛开战在即,邀您观赛!
  17. MAINTAIN翻译软件测试,maintain是什么意思_maintain的翻译_音标_读音_用法_例句_爱词霸在线词典...
  18. app 上架到苹果应用商店
  19. 杰理之内部flash【篇】
  20. C语言全网最详细的分支和循环语句讲解

热门文章

  1. PCA 的数学原理和可视化效果
  2. 用linux下的C语言编程万年历,shell编程万年历月历和对应c语言程序.docx
  3. 虚拟主机有Linux么
  4. tornado 上传文件
  5. mysql单表查询与多表查询小练习
  6. 20230403英语学习
  7. 国家互联网信息办公室发布《区块链信息服务管理规定》
  8. 计算机存储器的种类有哪些,计算机存储器的种类和特点
  9. 实战项目:Python还可以计算农历,这个操作你知道了吗?
  10. 20145209刘一阳《网络对抗》Exp6信息搜集与漏洞扫描