AWStats日志分析

AWStats日志分析AWStats日志分析系统介绍1.AWStats日志分析系统(1)Peri语言开发的一款开源日志分析系统(2)可用来分析Apache、Samba、Vsftpd、IIS等服务器的访问日志(3)信息结合crond等计划任务服务,可对日志内容定期进行分析部署AWStats日志分析系统1.安装AWStats软件包2.为要统计的站点建立配置文件3.修改站点统计配置文件…

大家好,又见面了,我是你们的朋友全栈君。

AWStats日志分析系统介绍

1.AWStats日志分析系统

(1)Peri语言开发的一款开源日志分析系统

(2)可用来分析Apache、Samba、 Vsftpd、 IIS等服务 器的访问日志

(3)信息结合crond等计划任务服务,可对日志内容定期进行分析

部署AWStats日志分析系统

1.安装AWStats软件包

2.为要统计的站点建立配置文件

3.修改站点统计配置文件

4.执行日志分析,并设置crontab计划任务

访问AWStats分析系统

1.查看统计页面

2.设置网页自动跳转,方便访问

具体操作:

1.安装DNS和HTTP服务软件包

[root@localhost ~]# yum install bind httpd -y

2.DNS配置

(1)主配置文件

[root@localhost ~]# vim /etc/named.conf 

AWStats日志分析
(2)区域配置文件

[root@localhost ~]# vim /etc/named.rfc1912.zones 

AWStats日志分析

(3)区域数据配置文件

[root@localhost ~]# cd /var/named/
[root@localhost named]# ls
data  dynamic  named.ca  named.empty  named.localhost  named.loopback  slaves
[root@localhost named]# cp -p named.localhost kgc.com.zone
[root@localhost named]# vim kgc.com.zone 

AWStats日志分析

(4)开启DNS服务

[root@localhost named]# systemctl start named

3.HTTP配置

(1)配置文件

[root@localhost named]# vim /etc/httpd/conf/httpd.conf

AWStats日志分析

AWStats日志分析

(2)关闭防火墙,开启服务

[root@localhost named]# systemctl stop firewalld.service 
[root@localhost named]# setenforce 0
[root@localhost named]# systemctl start httpd

4.Windows 10配置

(1)在win10主机上更改下DNS地址

AWStats日志分析

(2)在浏览器上访问域名,保证能够进行对Apache访问

AWStats日志分析

5.此时可以查看下日志文件,可以看出是来自IP地址为多少的主机来进行的访问

[root@localhost ~]# cd /var/log/httpd/
[root@localhost httpd]# cat access_log 
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET / HTTP/1.1" 403 4897 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /noindex/css/bootstrap.min.css HTTP/1.1" 200 19341 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /noindex/css/open-sans.css HTTP/1.1" 200 5081 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /images/poweredby.png HTTP/1.1" 200 3956 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /images/apache_pb.gif HTTP/1.1" 200 2326 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.woff HTTP/1.1" 404 241 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.woff HTTP/1.1" 404 245 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.woff HTTP/1.1" 404 253 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.woff HTTP/1.1" 404 243 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.woff HTTP/1.1" 404 247 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.woff HTTP/1.1" 404 259 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.woff HTTP/1.1" 404 239 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.woff HTTP/1.1" 404 249 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.woff HTTP/1.1" 404 261 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.ttf HTTP/1.1" 404 240 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf HTTP/1.1" 404 252 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.ttf HTTP/1.1" 404 244 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.ttf HTTP/1.1" 404 242 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.ttf HTTP/1.1" 404 246 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf HTTP/1.1" 404 258 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.ttf HTTP/1.1" 404 238 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf HTTP/1.1" 404 248 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf HTTP/1.1" 404 260 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.woff HTTP/1.1" 404 251 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf HTTP/1.1" 404 250 "http://www.kgc.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.124.129 - - [23/Oct/2019:22:23:41 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
192.168.124.129 - - [23/Oct/2019:22:23:42 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"

6.远程共享并挂载

[root@localhost ~]# smbclient -L //192.168.100.7/
Enter SAMBA\root's password: 
OS=[Windows 10 Home China 18362] Server=[Windows 10 Home China 6.3]

	Sharename       Type      Comment
	---------       ----      -------
	ADMIN$          Disk      远程管理
	C$              Disk      默认共享
	D$              Disk      默认共享
	IPC$            IPC       远程 IPC
	LAMP-C7         Disk      
	Users           Disk      
	脚本          Disk      
Connection to 192.168.100.7 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
NetBIOS over TCP disabled -- no workgroup available
[root@localhost ~]# mount.cifs //192.168.100.7/LAMP-C7 /abc/
Password for root@//192.168.100.7/LAMP-C7:  
[root@localhost ~]# cd /abc/
[root@localhost abc]# ls
apr-1.6.2.tar.gz       cronolog-1.6.2-14.el7.x86_64.rpm  LAMP-php5.6.txt
apr-util-1.6.0.tar.gz  Discuz_X2.5_SC_UTF8.zip           mysql-5.6.26.tar.gz
awstats-7.6.tar.gz     httpd-2.4.29.tar.bz2              php-5.6.11.tar.bz2
[root@localhost abc]# 

7.解压缩包并移动安装包存放位置

[root@localhost abc]# tar zxvf awstats-7.6.tar.gz -C /opt/
[root@localhost abc]# cd /opt/
[root@localhost opt]# mv awstats-7.6/ /usr/local/awstats
[root@localhost opt]# cd /usr/local/
[root@localhost local]# ls
awstats  bin  etc  games  include  lib  lib64  libexec  sbin  share  src
[root@localhost local]# cd awstats/
[root@localhost awstats]# ls
docs  README.md  tools  wwwroot
[root@localhost awstats]# cd tools/
[root@localhost tools]# ls
awstats_buildstaticpages.pl  dolibarr            maillogconvert.pl   xslt
awstats_configure.pl         geoip_generator.pl  nginx
awstats_exportlib.pl         httpd_conf          urlaliasbuilder.pl
awstats_updateall.pl         logresolvemerge.pl  webmin

8.更新数据

[root@localhost tools]# ./awstats_configure.pl 

> /etc/httpd/conf/httpd.conf
> file (required if first install) [y/N] ? y
> www.kgc.com

9.HTTP配置文件

[root@localhost tools]# cd /etc/httpd/conf
[root@localhost conf]# vim httpd.conf 

AWStats日志分析

10.进入awstats.www.kgc.com.conf配置文件

[root@localhost conf]# cd /etc/awstats/
[root@localhost awstats]# ls
awstats.www.kgc.com.conf
[root@localhost awstats]# vim awstats.www.kgc.com.conf

AWStats日志分析

DirData=”/var/lib/awstats”                               //awstats默认不存在(需要创建)

[root@localhost awstats]# cd /var/lib/
[root@localhost lib]# ls           查看没有awstats
创建后在查看
[root@localhost lib]# mkdir awstats

9.重启HTTP服务,在Windows10上进行访问

[root@localhost lib]# systemctl restart httpd

搜索:http://localhost/awstats/awstats.pl?config=www.kgc.com,会发现数值都是0,并且没有柱状图

AWStats日志分析

10.更新数据

[root@localhost lib]# cd /usr/local/awstats/
[root@localhost awstats]# ls
docs  README.md  tools  wwwroot
[root@localhost awstats]# cd tools/
[root@localhost tools]# ls
awstats_buildstaticpages.pl  dolibarr            maillogconvert.pl   xslt
awstats_configure.pl         geoip_generator.pl  nginx
awstats_exportlib.pl         httpd_conf          urlaliasbuilder.pl
awstats_updateall.pl         logresolvemerge.pl  webmin
[root@localhost tools]# ./awstats_updateall.pl now           //更新数据

11.计划性任务更新数据,并启动

[root@localhost tools]# crontab -e
*/5 * * * *     /usr/local/awstats/tools/awstats_updateall.pl now

[root@localhost tools]# systemctl start crond

12.再去Windows10中进行访问,会有柱状图显示

AWStats日志分析

13.优化网络地址,方便记忆

[root@localhost tools]# cd /var/www/html/
[root@localhost html]# ls
[root@localhost html]# vim aws.html

<html>
  <head>    
    <meta http-equiv=refresh content="0;url=http://www.kgc.com/awstats/awstats.pl?config=www.kgc.com">
  </head>
  <body></body>
</html>

14.在浏览器输入:
http://www.kgc.com/aws.html

AWStats日志分析

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/160203.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • “儿子,千万别帮老婆做家务!”爸爸写的这封信火了

    文 | 十二朵女王 · 主播 | 维维 儿子,明天就是你的婚礼了。 我必须提醒你,一旦结了婚,你就有了自己的新家,我和你妈不用你操心,你只用竭尽全力照顾好你自己…

  • 关于java的书籍文献_参考文献解释

    关于java的书籍文献_参考文献解释一、SpringCloud1.服务发现EurekaEureka的高可用ConsulConsul安装与使用Consul常用命令Consul高可用2.服务提供者3.服务消费者RibbonFeign4.熔断器HystrixHystrixDashboardTurbine5.配置中心6.APIGateway二、使用Docker构建微服务1.Docker介绍2.Docker的安装3.Docker的常用命令4.Dockerfile

  • microsoft azure是什么软件_识潮App苹果Store全国前五

    microsoft azure是什么软件_识潮App苹果Store全国前五系统文章:基础认识:WindowsAzure(三):结构WindowAzure(二):开发和发布一个Azure程序Azure(一):简介入门教程:WindowsAzure(四-7)::诊断功能WindowsAzure(四-6):WindowsAzureDrive–本

  • pycharm怎么运行django项目_django怎么用

    pycharm怎么运行django项目_django怎么用原文转载自:http://www.cnblogs.com/Leo_wl/p/5824541.html本文面向:有python基础,刚接触web框架的初学者。  环境:windows7   python3.5.1   pycharm专业版   Django1.10版  pip3一、Django简介  百度百科:开放源代码的Web应用框架,由Python语言编写……  

  • teleport怎么用_telelist怎么用

    teleport怎么用_telelist怎么用teleport使用说明浏览器下载网页:只能浏览主页和少数网页,其它不能浏览,容量几百kbteleport下载项目一能完全离线看网页,7328多文件9个JPG文件,大小134Mteleport下载项目二部分网页采集内容和项目一基本一致,但大几兆部分网页需要项目二(复制站点)才能浏览,项目一看不到图片项目二比项目一耗时多,但要全面视频教程https…

  • mac如何查看已连接wifi的密码「建议收藏」

    mac如何查看已连接wifi的密码「建议收藏」可以通道mac自带的“钥匙串访问”功能查看。选择需要查询的wifi名称,右击选择“将密码拷贝到剪贴板”,输入管理员密码后,密码就拷贝好了。找个地方粘贴即可看到密码

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号