`

Apache Web Server: Log Analysis and Server Status

阅读更多

另有更易使用的apachetop和goaccess

 

wtop is really cool application for web server log analysis and to see server stats at a glance. It also has powerful log grepping capability. It is just like 'top' for your webserver.

It can find out number of searches or signups per seconds. It can also create histogram of response time. There is also another tool called logrep a powerful command-line program for ad-hoc analysis and filtering for log files. You can dig up lots of information using wtop tools.

You need Python version 2.5 to run wtop.

Download wtop

Type the following command:
$ cd /tmp
$ wget http://wtop.googlecode.com/files/wtop-0.5.6.tar.gz
$ tar -zxvf wtop-0.5.6.tar.gz
$ cd wtop-0.5.6
# python setup.py install

Configuring wtop

Once installed you can start using the tool immediately. You need to edit /etc/wtop.cfg file to setup parameters, Apache log files and other directives
# vi /etc/wtop.cfg
Sample configuration file:

[main]
LOG_ROOT=/var/log/lighttpd/cyberciti.biz/
LOG_FILE=access.log
DEFAULT_OUTPUT_FIELDS=ts,class,ipcnt,ip,msec,uas,url

# This must match your webserver log format. You MUST have at least %h, %r and %D
LOG_FORMAT=%h %l %u %t "%r" %>s %B "%{Referer}i" "%{User-Agent}i" %D

[wtop]
# max time before a request is logged in the "slow" column
MAX_REQUEST_TIME=5000
# minimum requests/second before a URL class appears in top mode
MIN_RPS=0.2 

[classes]
# you can extend these to make any classes you wish
home=^/(?:\?.*)?$
xml=\.xml(?:\?.*)?$
js=\.js(?:\?.*)?$
css=\.css(?:\?.*)?$
img=\.(?:png|gif|jpe?g|cur|ico|bmp)(?:\?.*)?$

[patterns]
# the generic pattern is applied if a line does not match any
# of the named classes. By default it uses the top-level directory.
generic=^/([^/\?]+)

# incomplete list of known web robots
robots = r'(?:nutch|MSRBOT|translate.google.com|Feedster|Nutch|Gaisbot|Snapbot|VisBot|libwww|CazoodleBot|polybot|VadixBot|Sogou|SBider|BecomeBot|Yandex|Pagebull|chudo|Pockey|nicebot|entireweb|FeedwhipBOT|ConveraCrawler|NG/2.0|WebImages|Factbot|information-online|gsa-crawler|Jyxobot|SentinelCrawler|BlogPulseLive|YahooFeedSeeker|GurujiBot|wwwster|Y\!J-SRD|Findexa|SurveyBot|yetibot|discoveryengine|fastsearch|noxtrum|Googlebot|Snapbot|OGSearchSpider|heritrix|nutch-agent|Slurp|msnbot|cuill|Mediapartners|YahooSeeker|GrabPERF|keywen|ia_archiver|crawler.archive.org|Baiduspider|larbin|shopwiki)'

Now simply type wtop at a shell prompt:
$ wtop$
See all human traffic, enter:
$ logrep -m top -h access.log
See response times for all MSNBot homepage hits:
$ logrep -m grep -g MSNBot -i home -o status,msec,url access.log
Display the current log for traffic to pages about wordpress or themes sent from google.com
$ logrep -m tail --f 'url~wordpress|themes,ref~google.com' access.log

分享到:
评论

相关推荐

    log4j-jul-2.12.1-API文档-中英对照版.zip

    Maven坐标:org.apache.logging.log4j:log4j-jul:2.12.1; 标签:apache、logging、log4j、jul、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 ...

    log4j-api-2.7-API文档-中文版.zip

    Maven坐标:org.apache.logging.log4j:log4j-api:2.7; 标签:apache、logging、api、log4j、jar包、java、中文文档; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化...

    Apache Http Server、Apache Tomcat、mod_jk

    Apache Http Server : Apache/2.0.63 Apache Tomcat : Apache Tomcat/5.5.27 mod_jk : jk2.0.4-win32

    log4j-core-2.17.1-API文档-中文版.zip

    Maven坐标:org.apache.logging.log4j:log4j-core:2.17.1; 标签:apache、logging、log4j、core、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 ...

    log4j-core-2.7-API文档-中文版.zip

    Maven坐标:org.apache.logging.log4j:log4j-core:2.7; 标签:core、apache、logging、log4j、jar包、java、中文文档; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性...

    apache http server在linux上的安装

    Apache HTTP Server 是一个流行的开源 Web 服务器软件,广泛应用于 Linux 平台上。本文将指导您如何在 Redhat Linux 5.6 X64 系统上安装 Apache HTTP Server 2.4.6。 在开始安装之前,需要安装一些必要的依赖项,...

    apache-web-server-lm.zip_Apache Web_Apache Web Server_apache

    apache web服务器的配置手册,方便搭建网站使用apache web服务器的人参考

    Apache Flume, Distributed Log Collection for Hadoop(第二版)

    Apache Flume, Distributed Log Collection for Hadoop,2015 第二版,Packt Publishing

    Apache FtpServer配置详解

    从零开始介绍Apache FtpServer,并一步一步教你配置Apache FtpServer,更高级的应用,教你用写代码控制Apache FtpServer及集成到自己的应用中 <!--ftp端口 --> <!--绑定的服务器IP地址,多网卡的时候使用...

    基于Apache Web Server的校友会捐赠网站的设计与开发.pdf

    "基于Apache Web Server的校友会捐赠网站的设计与开发" 本文主要介绍了基于Apache Web Server的校友会捐赠网站的设计与开发,旨在实现校友捐赠和捐赠管理等功能,以便于校友通过网站进行捐赠登记、捐赠查询、了解...

    Windows下仿造Apache Web Server

    Windows下仿造Apache Web Server,采用IOCP完成端口架构,能够处理html请求,解析php语言。 IOCP已用类封装好,可代码复用。

    Apache Web Server2.0.40.tar(Linux下使用)

    Apache Web Server2.0.40.tar(Linux下使用),不多说了,需要的就下载,反正不要积分……

    Apache Web Server V1.3.20完整安装版

    最流行的Web服务器软件。快速、可靠、可通过简单的 API 扩展,Perl/Python 解释器可被编译到服务器中,完全免费,...如果你需要创建一个每天有数百万人访问的 Web 服务器,Apache 可能是最佳选择。解压密码www.faji.com

    Apache Web Server for Linux V2.0.35

    最流行的Web服务器软件。Linux + Apache是目前免费服务器中的最佳拍挡。Apache快速、可靠、可通过简单的API扩展,Perl/Python解释器可被...如果你需要创建一个每天有数百万人访问的Web服务器,Apache可能是最佳选择。

    apache-log4j-extras-1.2.17-API文档-中文版.zip

    赠送jar包:apache-log4j-extras-1.2.17.jar; 赠送原API文档:apache-log4j-extras-1.2.17-javadoc.jar; 赠送Maven依赖信息文件:apache-log4j-extras-1.2.17.pom; 包含翻译后的API文档:apache-log4j-extras-...

    Apache Directory Server使用指南

    Apache Directory Server 使用指南 Apache Directory Server 是一个基于 Java 语言的开源 LDAP 服务器,由 Apache 软件基金会开发和维护。该服务器提供了一个完整的目录解决方案,包括目录服务器、目录工具和其他...

    Ansible-Docker-Apache:在DOCKER中使用APACHE WEBSERVER配置:whale:

    Ansible-Docker-Apache DOCKER中的APACHE WEBSERVER配置 :whale: 使用ANSI

    apache server 实用全书.ISO

    Apache Server 1.3.11 in source code and Windows binary format Apache Server 1.3.9 in source code and Windows binary format CGIWrap 3.6.4 in source code format Comanche 2.0 for UNIX and Windows ...

    Windows 7中将Django部署到Apache Web Server.docx

    Windows 7中将Django部署到Apache Web Server.docx

    Learning.Apache.Thrift.178588274

    Chapter 3: Running Your First Apache Thrift Service and Client Chapter 4: Understanding How Apache Thrift Works Chapter 5: Generating and Running Code in Different Languages Chapter 6: Handling Errors...

Global site tag (gtag.js) - Google Analytics