astats日志分析系统
Awstats是一个免费非常简洁而且强大有个性的网站日志分析工具。
功能:
[root@www /]# tar zxvf httpd-.tar.gz -C /usr/src/ [root@www /]# unzip awstats-7.0.zip [root@www /]# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi && make && make install
- --prefix:指定安装目录
- --enable-so:启用动态加载模块支持
- --enable-rewrite:启用网站重写功能
- --enable-charset-lite:启动字符集支持
- --enable-cgi:启用CGI脚本程序支持
[root@www httpd-]# ln -s /usr/local/httpd/bin/* /usr/local/bin/ //优化执行路径 [root@www ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@www ~]# vim /etc/init.d/httpd #chkconfig: 35 85 15 #description: Apache HTTP Server
[root@www ~]# chkconfig --add httpd [root@www ~]# chkconfig --level httpd on [root@www ~]# vim /usr/local/httpd/conf/httpd.conf ServerName www.aaa.com: //添加网站域名 [root@www ~]# httpd –t //检查配置文件错误 Syntax OK [root@www ~]# /etc/init.d/httpd start
[root@www ~]# netstat -anpt |grep tcp ::: :::* LISTEN /httpd [root@www ~]# elinks http://192.168.1.200 It works!
基于不同的域名创建虚拟Web主机
为两个站点创建网站的文档目录
[root@www ~]# mkdir /usr/local/httpd/htdocs/aaacom
[root@www ~]# mkdir /usr/local/httpd/htdocs/bbbcom
[root@www ~]# echo '<h1>www.aaa.com</h1>' > /usr/local/httpd/htdocs/aaacom/index.html
[root@www ~]# echo '<h1>www.bbb.com</h1>' > /usr/local/httpd/htdocs/bbbcom/index.html
修改配置文件httpd.conf和httpd-vhosts.conf
[root@www ~]# cd /usr/local/httpd/conf/extra/
[root@www extra]# vim httpd-vhosts.conf
NameVirtualHost
<VirtualHost >
DocumentRoot "/usr/local/httpd/htdocs/aaacom/"
ServerName www.aaa.com
ErrorLog "logs/www.aaa.com-error_log"
CustomLog "logs/www.aaa.com-access_log" common
</VirtualHost>
<VirtualHost >
DocumentRoot "/usr/local/httpd/htdocs/bbbcom/"
ServerName www.bbb.com
ErrorLog "logs/www.bbb.com-error_log"
CustomLog "logs/www.bbb.com-access_log" common
</VirtualHost>
[root@www extra]# cd ..
[root@www conf]# vim httpd.conf
Include conf/extra/httpd-vhosts.conf //将此行前面的"#"去掉
[root@www ~]# vim /etc/hosts
192.168.1.200 www.aaa.com www.bbb.com
[root@www ~]# /etc/init.d/httpd restart
[root@www ~]# elinks http://www.aaa.com
www.aaa.com
[root@www ~]# elinks http://www.bbb.com
www.bbb.com
二、
部署安装awstats日志分析系统
[root@www /]# unzip awstats-7.0.zip [root@www /]# mv awstats-7.0 /usr/local/awstats [root@www /]# cd /usr/local/awstats/tools/ [root@www tools]# ./awstats_configure.pl
----- AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try 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
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> /usr/local/httpd/conf/httpd.conf //httpd主配置文件路径
-----> Check and complete web server config file '/usr/local/httpd/conf/httpd.conf'
Warning: You Apache config file contains directives to write 'common' log files
This means that some features can't work (os, browsers and keywords detection).
Do you want me to setup Apache to write 'combined' log files [y/N] ? y //设置日志文件类型
Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
Add '<Directory>' directive
AWStats directives added to Apache config file.
-----> 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.aaa.com //统计的站点名称
往后默认配置按回车
修改awstats.www.aaa.com.conf配置文件
[root@www ~]# mkdir /var/lib/awstats [root@www ~]# vim /etc/awstats/awstats.www.aaa.com.conf
LogFile="/usr/local/httpd/logs/access_log" DirData="/var/lib/awstats"
创建数据库的存放目录,并更新数据库
oot@www ~]# /usr/local/awstats/tools/awstats_updateall.pl now //执行更新脚本 Running '"/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -update -config=www.aaa.com -configdir="/etc/awstats"' to update config www.aaa.com Create/Update database for config "/etc/awstats/awstats.www.aaa.com.conf" by AWStats version 7.0 (build 1.971) From data in log file "/usr/local/httpd/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: 2 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 2 corrupted records, Found 0 old records, Found 0 new qualified records.
创建周期性计划任务
[root@www ~]# crontab -e */ * * * * /usr/local/awstats/tools/awstats_updateall.pl now
创建网站跳转页
[root@www /] vim aws.html <html> <head> <meta http-equiv=refresh content="0; url=http://www.aaa.com/awstats/awstats.pl?config=www.aaa.com"> </head> <body><body> </html> [root@www /]# mv aws.html /usr/local/httpd/htdocs/ //将跳转页移动到网站根目录下 [root@www ~]# /etc/init.d/httpd restart 重启apache访问awstats主页
为AWSstats进行访问权限的控制
客户机地址限制
[root@www /]# vim /usr/local/httpd/conf/httpd.conf
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order deny,allow
Deny from 192.168.1.234 //拒绝IP为192.168.1.234的主机访问
</Directory>
[root@www /]# /etc/init.d/httpd restart
此时192.168.1.234客户机将无法访问www.aaa.com/aws.html
用户身份认证限制
首先使用htpasswd工具创建用户认证数据文件
[root@www /]# htpasswd -c /usr/local/httpd/conf/.awspwd xuhao
New password:
Re-type new password:
Adding password for user xuhao
[root@www /]# cat /usr/local/httpd/conf/.awspwd
xuhao:eE3EHFDzN4A5c
修改httpd.conf配置文件,添加用户授权
[root@www /]# vim /usr/local/httpd/conf/httpd.conf
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "AWStats Directory" //定义受保护的领域名称
AuthType Basic //设置认证的类型
AuthUserFile /usr/local/httpd/conf/.awspwd //设置用于保存用户账号、密码文件的路径
require valid-user //合法用户才能访问
</Directory>
[root@www /]# /etc/init.d/httpd restart
登录客户端访问测试
astats日志分析系统的更多相关文章
- ELK_日志分析系统Logstash+ElasticSearch+Kibana4
elk 日志分析系统 Logstash+ElasticSearch+Kibana4 logstash 管理日志和事件的工具 ElasticSearch 搜索 Kibana4 功能强大的数据显示客户端 ...
- [原创]ubuntu14.04部署ELK+redis日志分析系统
ubuntu14.04部署ELK+redis日志分析系统 [环境] host1:172.17.0.4 搭建ELK+redis服务 host2:172.17.0.3 搭建logstash+nginx服务 ...
- Docker搭建ElasticSearch+Redis+Logstash+Filebeat日志分析系统
一.系统的基本架构 在以前的博客中有介绍过在物理机上搭建ELK日志分析系统,有兴趣的朋友可以看一看-------------->>链接戳我<<.这篇博客将介绍如何使用Docke ...
- ELK + Filebeat 日志分析系统
ELK + Filebeat 日志分析系统 架构图 环境 OS:CentOS 7.4 Filebeat: 6.3.2 Logstash: 6.3.2 Elasticsearch 6.3.2 Kiban ...
- AWStats日志分析系统
1.什么是AWStats AWStats是一款功能强大且功能强大的免费工具,可以图形方式生成高级Web,流媒体,ftp或邮件服务器统计信息.此日志分析器用作CGI或命令行, 并在几个图形网页中显示您的 ...
- 苏宁基于Spark Streaming的实时日志分析系统实践 Spark Streaming 在数据平台日志解析功能的应用
https://mp.weixin.qq.com/s/KPTM02-ICt72_7ZdRZIHBA 苏宁基于Spark Streaming的实时日志分析系统实践 原创: AI+落地实践 AI前线 20 ...
- Elasticsearch日志分析系统
Elasticsearch日志分析系统 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.什么是Elasticsearch 一个采用Restful API标准的高扩展性的和高可用性 ...
- ELK日志分析系统简单部署
1.传统日志分析系统: 日志主要包括系统日志.应用程序日志和安全日志.系统运维和开发人员可以通过日志了解服务器软硬件信息.检查配置过程中的错误及错误发生的原因.经常分析日志可以了解服务器的负荷,性能安 ...
- Rsyslog+ELK日志分析系统
转自:https://www.cnblogs.com/itworks/p/7272740.html Rsyslog+ELK日志分析系统搭建总结1.0(测试环境) 因为工作需求,最近在搭建日志分析系统, ...
随机推荐
- LeetCode Kth Largest Element in an Array (快速排序)
题意: 在一个无序的数组中第k大的数是多少? 思路: 按照快排的思路,如果每次分成两段后,设为L和R.如果R>=k ,则答案在右边集合,否则在左边集合. 这里用了3位取中法.注意快排别给写死循环 ...
- Exploratory Software Testing
最近找到去年上半年看过一本关于测试方面书籍的总结笔记,一直放在我的个人U盘里,当时是用Xmind记录的,现在重新整理下分享给大家了! James A.Whittaker [美] 詹姆斯·惠特克(软件测 ...
- 兼容性所有浏览器的透明CSS设置
兼容所有浏览器的透明CSS设置: .transparent_class { filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0. ...
- vs2013常用快捷键收集
vs2013快捷键: 复制一整行代码: Ctrl+C剪切一整行代码: Ctrl+X删除一整行代码: Ctrl+L跳转到指定的行:ctrl+G 注释:组合键“Ctrl+K+C”取消注释:组合键“Ctrl ...
- Python编程小记
发现这种结构很实用: while True: expression .... if condition: expression break 好吧,我承认我是菜鸟-
- 我也谈谈 代码调用存储过程超时,SQL Server Management Studio里运行很快的问题
最近遇到了一个问题就是 一个执行速度很快的存储过程,在代码中调用的时候却超时了. 后来看到了两篇文章: 其中一篇是这样介绍的 今天同事用代码调用存储过程时超时,在SQL Server Manageme ...
- 关于typedef的用法总结(转)
不管实在C还是C++代码中,typedef这个词都不少见,当然出现频率较高的还是在C代码中.typedef与#define有些相似,但更多的是不同,特别是在一些复杂的用法上,就完全不同了,看了网上一些 ...
- UI学习笔记---第五天
target...action设计模式 代理设计模式 手势识别器 target...action设计模式 耦合是衡量一个程序写的好坏的标准之一,耦合是衡量模块与模块之间关联程度的指标 &quo ...
- Ionic基础——侧边栏ion-side-menus 以及ion-tap结合侧边栏详解
一. 侧边栏菜单 : ion-side-menus 侧边栏菜单是一个最多包含三个子容器的元素: 默认情况下,侧边栏菜单将只显示ion-side-menu-content容器的内容. 向左滑动时,将显示 ...
- 2015GitWebRTC编译实录9
2015.07.20 neteq 编译通过注意不要引用tools目录里的内容 [1347/1600 ] CXX obj /webrtc/modules/audio_coding/neteq/neteq ...