zoukankan      html  css  js  c++  java
  • 在Centos中使用goaccess查看Nginx日志

    在Nginx的配置文件中配置一下access日志:

     log_format access ‘$remote_addr – $remote_user [$time_local] “$request” ‘‘$status $body_bytes_sent “$http_referer” ‘‘”$http_user_agent” $http_x_forwarded_for’;
     access_log  /usr/local/openresty/nginx/logs/access.log;

    安装一下goaccess:

    yum -y install glib2 glib2-devel ncurses ncurses-devel geoip geoip-devel

    cd /usr/local
    wget http://tar.goaccess.io/goaccess-0.9.2.tar.gz
    tar zxvf goaccess-0.9.2.tar.gz
    cd goaccess-0.9.2
    ./configure --enable-geoip --enable-utf8
    make && make install
    make clean


    3. GoAccess 使用方法
    进入 Nginx 日志所在目录

    命令行直接查看
    cd /usr/local/openresty/nginx/logs

    goaccess -f access.log

    出来图了,日志格式选 NCSA

    http://www.fancycoding.com/log-analyse-using-goaccess/

    禁止IP访问:
    iptables -I INPUT -s 222.35.67.155 -j DROP
    恢复IP访问:
    iptables -D INPUT -s 222.35.67.155 -j DROP

    查看网卡:

    nload -m eth1

  • 相关阅读:
    ceph概述
    docker网络
    ceph部署
    K8s集群搭建(二)
    K8s架构
    K8s集群搭建(一)
    Kubernetes介绍
    虚拟化网络管理(二)
    virt-manager创建虚拟机
    C#中TransactionScope的使用方法和原理
  • 原文地址:https://www.cnblogs.com/littlehb/p/4630112.html
Copyright © 2011-2022 走看看