使用AWstats分析Nginx访问日志

软件下载地址:http://awstats.sourceforge.net/

我下载的是稳定版本awstats-6.95.tar.gz

先上传下载文件到服务器上我习惯放在/opt下面

一、解压软件包:

tar zxvf  awstats-6.95.tar.gz

然后放到/usr/local/下面

mv awstats-6.95 /usr/local/awstats

二、接着执行 tools 目录中的 awstats_configure.pl 配置向导,创建一个新的统计

[root@www tools]# perl awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.8) (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):

>none     #因为是分析nginx日志

Your web server config file(s) could not be found.

You will need to setup your web server manually to declare AWStats

script as a CGI, if you want to build reports dynamically.

See AWStats setup documentation (file docs/index.html)

-----> 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  # 没有发现web 配置文件创建一个 选择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.test.com  #你网站访问的网址

-----> 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):

>  # 默认的配置文件路径/etc/awstats回车即可

-----> Create config file '/etc/awstats/awstats.www.test.com.conf'

Config file /etc/awstats/awstats.www.test.com.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.test.com

时间: 2024-08-22 15:21:05

使用AWstats分析Nginx访问日志的相关文章

Python 分析Nginx访问日志并保存到MySQL数据库实例_python

使用Python 分析Nginx access 日志,根据Nginx日志格式进行分割并存入MySQL数据库.一.Nginx access日志格式如下: 复制代码 代码如下: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_f

利用awstats分析nginx日志

今天打算分析下nginx日志,要分析nginx日志,我们可以通过shell脚本和第三方软件awstats进行分析,在此我们选择的是通过第三方软件awstats进行分析. 要使用awstats分析nginx日志,我们要安装awstats,而在安装awstats之前,我们需要先来介绍下awstats是什么? 一.awstats是什么 awstats是一个免费非常简洁而且强大有个性的基于Perl语言的WEB日志分析工具. 它可以统计网站的如下信息: 1):访问量.访问次数.页面浏览量.点击数.数据流量

10分钟精通Nginx访问日志分析统计

简介 很多个人站长在搭建网站时使用nginx作为服务器,为了了解网站的访问情况,一般有两种手段: 使用CNZZ之类的方式,在前端页面插入js,用户访问的时候触发js,记录访问请求. 利用流计算.或离线统计分析nginx的access log,从日志中挖掘有用信息. 两种方式各有优缺点: CNZZ使用起来比较简单,各种指标定义清楚.但这种方式只能记录页面的访问请求,像ajax之类的请求是无法记录的,还有爬虫信息也不会记录. 利用流计算.离线计算引擎可以支持个性化需求,但需要搭建一套环境,并且在实时

nginx安装awstats分析Nginx日志

AWStats 是一个免费的强大的日志分析统计工具,所以安装来分析Nginx的日志,记录一下.  代码如下 复制代码   #下载awstats和修改好的配置文件 wget -c http://dl.dropboxusercontent.com/u/809946/soft/awstats-7.2.tar.gz wget -c http://dl.dropboxusercontent.com/u/809946/conf/awstats.imcat.in.conf tar -zxvf awstats-

《ELK Stack权威指南(第2版)》一3.1 Nginx访问日志

第3章 场 景 示 例 前面虽然介绍了几十个Logstash插件的常见配置项,但是过多的选择下,如何组合使用这些插件,依然是一部分用户的难题.本章将列举一些最常见的日志场景,演示针对性的组件搭配,希望能给读者带来启发. 本章介绍的场景包括:Nginx访问日志.Nginx错误日志.Postfix日志.Ossec日志.Windows系统日志.Java日志.MySQL慢查询日志.Docker容器日志. 3.1 Nginx访问日志 访问日志处理分析绝对是使用ELK stack时最常见的需求.默认的处理方

elk收集分析nginx access日志

elk收集分析nginx access日志 首先elk的搭建按照这篇文章使用elk+redis搭建nginx日志分析平台说的,使用redis的push和pop做队列,然后有个logstash_indexer来从队列中pop数据分析插入elasticsearch.这样做的好处是可扩展,logstash_agent只需要收集log进入队列即可,比较可能会有瓶颈的log分析使用logstash_indexer来做,而这个logstash_indexer又是可以水平扩展的,我可以在单独的机器上跑多个in

详解用ELK来分析Nginx服务器日志的方法_nginx

所有ELK的安装包都可以去官网下载,虽然速度稍慢,但还可以接受,官网地址:https://www.elastic.co/ logstash 在Logstash1.5.1版本,pattern的目录已经发生改变,存储在/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-0.1.10/目录下,但是好在配置引用的时候是可以对patterns的目录进行配置的,所以本人在Logstash的根目录下新建了一个patterns目录.而配置目

Linux定时切割Nginx访问日志并删除指定天数前的日志记录

说明: 操作系统:CentOS 站点1:bbs .111cn.net 站点2:sns .111cn.net Nginx安装路径:/usr/local/nginx Nginx配置文件路径:/usr/local/nginx/conf/nginx.conf 站点1配置文件路径:/usr/local/nginx/conf/vhost/bbs.111cn.net.conf 站点2配置文件路径:/usr/local/nginx/conf/vhost/sns.111cn.net.conf 目的: 1.对站点1

nginx访问日志并删除指定天数前的日志记录配置方法_nginx

说明: 操作系统:CentOS 站点1:bbs.jb51.net 站点2:sns.jb51.net Nginx安装路径:/usr/local/nginx Nginx配置文件路径:/usr/local/nginx/conf/nginx.conf 站点1配置文件路径:/usr/local/nginx/conf/vhost/bbs.jb51.net.conf 站点2配置文件路径:/usr/local/nginx/conf/vhost/sns.jb51.net.conf 目的: 1.对站点1和站点2的n