awstats 安装
来自 http://www.cnblogs.com/fnng/archive/2012/08/31/2666175.html
Awstats是一个非常简洁而且强大的统计工具。它可以统计您站点的如下信息:
一:访问量,访问次数,页面浏览量,点击数,数据流量等精确到每月、每日、每小时的数据
二:访问者国家、访问者IP、操作系统、浏览器等
三:Robots/Spiders的统计
四:纺客持续时间
五:对不同Files type 的统计信息
六:Pages-URL的统计
七:其它信息(搜索关键字等等)
http://awstats.sourceforge.net/ awstats官方网站
http://www.perl.com/ perl官方网站
[root@localhost awstats]# ls
awstats-7.0.tar.gz perl-5.16.1.tar.gz
安装perl
Awstats基于Perl的WEB日志分析工具,网上关于它的介绍还是比较多的,因为是基于perl开发的,在管在windows还是linux下都需要先安装perl环境。所以,我们先安装perl 。其实,还需要一个apache环境,在上一节中已经进行了安装讲解。
[root@localhost awstats]# tar xvfz perl-5.16.1.tar.gz 解压
[root@localhost awstats]# cd perl-5.16.1 进入目录
[root@localhost perl-5.16.1# rm -f config.sh Policy.sh
[root@localhost perl-5.16.1]# sh Configure -de
[root@localhost perl-5.16.1]#make 编译
[root@localhost perl-5.16.1]# make test
[root@localhost perl-5.16.1]# make install 安装
config.sh Policy.sh 为以前安装时的配置文件,新安装或升级安装时需要将其删除。
sh Configure -de 安装使用默认配置,一般而言将会 ok
make test 执行make命令, 然后make根据test目标规则, 执行规定的操作。
安装完成后 perl 所在目录为 /usr/local/lib/perl5, perl 执行文件在 /usr/local/bin 中。
安装awstats
解压awstats
[root@localhost awstats]# tar xvfz awstats-6.4.tgz
[root@localhost awstats]# mkdir /etc/awstats
[root@localhost awstats]# mkdir /var/lib/awstats
上面创建的两个目录都将在后面的配置中用到,一个用于存放站点日志分析的配置文件,一个用于存放日志数据信息。
[root@localhost awstats]# cp -R ./awstats-7.0 /usr/local/
-R 表示复制目录及目录内的所有项目到/usr/local/目录下
[root@localhost test]# mv awstats-7.0 awstats 进行一个重命名,便于操作而已。
配置awstats
[root@localhost tools]# pwd
/usr/local/awstats//tools
Awstats的配置有自带的配置工具awstats_configure.pl ,首先用vi打开configure.pl文件,看看第一行有关perl运行环境的配置是否正确。
[root@localhost tools]# vi awstats_configure.pl
#!/usr/bin/perl
.............
[root@localhost tools]# pwd
/usr/local/awstats/tools
[root@localhost tools]# perl awstats_configure.pl 运行配置文件
Do you want to continue setup from this NON standard directory [yN] ? 你是否安装非标准目录【y / n】? .............. file (required if first install) [y/N] ? 文件(如果需要先安装)【y / n】? ............ your web site ,virtual server or profile name: 你的网站服务器名或文件名 >demo ............ directory path to store config file(s) (enter for default): 目录路径存储配置文件(填写默认值) > /etc/awstats ........... 然后,两个回车配置完成。
awstats_configure.pl工具会自动修改您的apache配置,在apache的配置文件httpd.conf文件中自动修改下面信息
[root@localhost conf]# pwd
/usr/local/apache/conf
[root@localhost conf]# vi httpd.conf
awstats_configure.pl自动在httpd.conf文件最底部添加了以下内容:
# Directives to allow use of AWStats as a CGI # 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/" # # This is to permit URL access to scripts/files in AWStats directory. # <Directory "/usr/local/awstats/wwwroot"> Options None AllowOverride None Order allow,deny Allow from all </Directory>
awstats_configure.pl还将根据安装过程中您的回答(要分析的网站名称)信息,自动生产 /etc/awstats/awstats.index.conf文件
[root@localhost awstats]# pwd
/etc/awstats
[root@localhost awstats]# ls
awstats.index.conf
[root@localhost awstats]# vi awstats.index.conf 配置下面文件
................ LogFile="/usr/local/apache/logs/access_log" 改为apache的日志文件 ....
这样就完成了awstats的安装与配置工作。
分析日志
[root@localhost cgi-bin]# pwd
/usr/local/awstats/wwwroot/cgi-bin
[root@localhost cgi-bin]# chmod +x awstats.pl 加可执行权限
[root@localhost cgi-bin]# perl /awstats.pl -update -config=demo (刚才输入的网站服务器名)
Create/Update database for config "/etc/awstats/awstats.index.conf" by AWStats version 7.0 (build 1.971) From data in log file "/usr/local/apache/logs/access_log"... Phase 1 : First bypass old records, searching new record... Searching new records from beginning of log file... Jumped lines in file: 0 Parsed lines in file: 3 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 3 corrupted records, Found 0 old records, Found 0 new qualified records.
在浏览器里输入:
http://localhost/awstats/awstats.pl?config=demo
然后就可以看到生成的日志报告了
在打开的统计日志页面默认没有“立即更新”按钮,需要在生成的配置文件中开启
AllowToUpdateStatsFromBrowser=1 默认为0
点击立即更新可能是权限问题,修改日志文件和http服务的属主、属组相同.
Error: Couldn't open file "/var/lib/awstats/awstats092012.192.168.1.38.tmp.5138" for write: Permission
denied
Setup ('/etc/awstats/awstats.192.168.1.38.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
有可能与到下面的错误提示,不管你有没有遇到,反正我是遇到了!:
Not Found The requested URL /awastats/awastats.pl was not found on this server. ----------------------------------------------------------------------------- Apache/2.2.3 (CentOS) Server at 192.168.0.105 Port 80
上面的错误一直没找到原因,于是,找了另一种办法来访问日志文件。
[root@localhost cgi-bin]# pwd
/usr/local/awstats/wwwroot/cgi-bin
[root@localhost cgi-bin]# perl awstats.pl -update -config=demo -output -staticlinks >/var/www/html/awastats.html
这样我们把日志文件保存到apache 服务器下面,名为awastats.html
在浏览器里输入:
http://localhost/awstats.html
一样可以访问日志文件噢!
转载于:https://blog.51cto.com/dyland/1065122
awstats 安装相关推荐
- Linux下Apache日志分析工具--AWStats安装使用
source:http://blog.sina.com.cn/s/blog_5ce0e67e0100baf5.html http://doc.linuxpk.com/28437.html 1.事先安装 ...
- win32 awstats 安装记 by Emerald 绿色学院 - Green Institute
win32 awstats 安装记 by Emerald 绿色学院 - Green Institute 一. awstats 简介 二. 下载 awstats 三. 安装 awstats 四. 下载和 ...
- Apache Awstats 安装配置系列 (4)之 Awstats 安装 配置
awstats安装配置 1. 下载awstats http://www.awstats.org/ 2.解压缩到 D:\awstats-7.4 3.初始化配置环境 进入 D:\awstats-7.4\t ...
- Awstats安装配置
1.安装 2.apache日志统计 3.plugin 4.合并日志 5.分析其它日志 5.1.ftp日志 5.1.1.proftp 5.2.mail日志 本文用到的软件 AWStats 6.9 fin ...
- AWStats安装笔记
安装方法很简单,这里不再缀述,网上有很多教程,基本按提示下来就可以正常完成. 下面说一下自己安装时遇到的一些问题和解决方法: 1.apache cgi模块问题 有些编译安装的apache环境,可能没有 ...
- awstats安装和配置
1.下载&&安装 http://awstats.sourceforge.net/ tar .. && cd -. && perl awstats_con ...
- awstats 安装与配置
2019独角兽企业重金招聘Python工程师标准>>> http://www.chedong.com/tech/awstats.html 转载于:https://my.oschina ...
- web 日志分析工具 awstats 简单安装
awstats安装使用 awstats是一个开源的日志分析工具,用perl编写.感觉还不错,把安装记录写下,也许有人用的到. 可以分析大部分标准日志数据,如apache的,nginx的都可以 首先下载 ...
- AWStats+QQ纯真库IP解析插件安装
从这里下载基本的组件 http://download.csdn.net/download/debugcs/4360307# 1.把qqhostinfo.pm,QQWry.dat,qqwry.pl 放到 ...
最新文章
- SQL SERVER 判断是否存在并删除某个数据库、表、视图、触发器、储存过程、函数
- mysql主流版本2020_mysql高级2020.7.12-2020.7.13
- mac使用bootcamp安装win7遇到的一些坑
- opendir php 中文,php的opendir是什么意思?
- 基于ENVI的landsat8辐射定标和大气校正
- 使用APP inventor来制作一个属于自己的蓝牙串口软件
- iOS SQLite 读书笔记
- python裂缝检测_通过opencv-python检测裂缝
- 评价效率DEA方法原理
- 【OKR目标管理】价值分析
- 如何坚持看书、跑步、写作?
- linux版vmware无法导入ovf,vmware 虚拟机导入OVF出现路径错误
- springboot 中的 文件、短信、邮件、token 工具类
- 视频流TS打包方式详解
- JSP网站开发技术两种模式介绍
- docker manifest 使用实战
- Origin学生版的获取方法和安装方法
- HTML之select下拉框:默认值设置
- Matlab/Simulink 中示波器背景和线条颜色更改与图片保存方法
- 计算机视觉辅助系统价格,驾驶辅助系统计算机视觉技术
热门文章
- Springboot08-项目单元测试(接口测试)
- placeholder的样式设置
- web服务的搭建 windows server 2008
- c语言题中的一些陷阱
- 《Java疯狂讲义》(第3版)学习笔记 2 - Java语言的运行机制
- CentOS 6.x使用yum快速安装MySQL 5.5
- c/c++ c++ file c++/stl/boost 判断文件目录是否存在
- linux--vi 和vim 的区别
- 手动挡应该这么换挡!这么多年都被驾校坑了!
- zabbix-proxy3.0.4编译安装