在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
相关文章
- 腾讯云 centos 7.6 rpm 安装mysql8.0
- CentOS 8 中配置阿里云的 yum 源
- RHEL 7 & CentOS 7禁用IPV6
- 虚拟机+centOS挂载ISO步骤
- CentOS 7.2 (mini) 里iptables防火墙怎么关闭?
- SpringBoot2项目部署到Linux(Centos)Log日志输出问号
- Memcached 笔记与总结(1)Linux(CentOS 6.6) 和 Windows(7)下安装与配置 Memcached (1.4.24)与 Memcached 基础命令
- 【Linux】Centos防火墙常用操作命令
- CentOS配置远程日志服务器
- CentOS 7 安装配置zabbix 3.2.8
- CentOS SVN强制用户提交时写日志
- 通过YUM升级centOS内核,以便安装docker
- CentOS 加载/挂载 U盘 (转)
- 于CentOS 6.5编译器安装Git 1.8
- CentOS 7 sshd 链接被拒绝问题,端口改变成2200
- 转载-centos网络配置(手动设置,自动获取)的2种方法
- Centos 7配置nginx反向代理负载均衡集群
- linux(centos)下安装PHP的PDO扩展