环境要求nginx编译需要--with-http_ssl_module./configure--prefix=/usr/local/nginx--sbin-path=/usr/sbin/nginx--conf-path=/etc/nginx/nginx.conf--error-log-path=/var/log/nginx/error.log--http-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx.pid--lock-..
分类:
其他好文 时间:
2017-01-06 17:28:41
阅读次数:
339
一、概念并发连接数客户端向服务器发起请求,并建立了TCP连接。每秒钟服务器链接的总TCP数量,就是并发连接数。请求数请求数指的是客户端在建立完连接后,向http服务发出GET/POST/HEAD数据包。拓展:服务器返回了请求结果后有两种情况:http数据包头包含Close字样,关闭本次TCP..
分类:
其他好文 时间:
2016-12-28 02:50:31
阅读次数:
217
上周学习了Linux,其中有使用crontab定时备份日志的内容,现把主要步骤记录如下: 首先需要备份的日志的源目录位于/opt/lampp/logs/access_log 备份到/tmp/logs下 备份文件加上时间戳date +%Y%m%d%H%M%S 以上是备份说明,下面分三步操作 一、she ...
分类:
系统相关 时间:
2016-12-27 18:04:53
阅读次数:
325
1. 获取ip awk ‘{print $1}’ /data/logs/access.log 2.得到独立ip数 awk ‘{print $1}’ /data/logs/access.log | sort | uniq | wc -l 3. 获取访问时间 grep -P ‘\[.*?]\’ -o / ...
分类:
其他好文 时间:
2016-12-25 20:50:25
阅读次数:
234
location~\.ico${log_not_foundoff;#access_logoff;}access_log表示匹配以.ico结尾的地址,访问日志是否开启。log_not_found表示没有发现该资源是否记录错误日志。
分类:
其他好文 时间:
2016-12-23 19:59:39
阅读次数:
162
log_not_found语法:log_not_foundon|off;默认值:log_not_foundon;配置段:http,server,location是否在error_log中记录不存在的错误。默认是。log_subrequest语法:log_subrequeston|off;默认值:log_subrequestoff;配置段:http,server,location是否在access_log中记录子请求的访问..
分类:
其他好文 时间:
2016-12-23 19:58:45
阅读次数:
153
nginx服务器日志相关指令主要有两条,一条是log_format,用来设置日志格式, 另外一条是access_log,用来指定日志文件的存放路径、格式和缓存大小,一般在nginx的配置文件中日记配置(/usr/local/nginx/conf/nginx.conf)。 nginx的log_form ...
分类:
其他好文 时间:
2016-12-21 18:37:38
阅读次数:
238
我们通过Logstash收集的Nginx Access log中已经包含了客户端IP的数据(remote_addr),但是只有这个IP还不够,要在Kibana的显示请求来源的地理位置还需要借助GeoIP数据库来实现。GeoIP 是最常见的免费 IP 地址归类查询库,同时也有收费版可以采购。GeoIP ...
分类:
其他好文 时间:
2016-12-17 13:47:31
阅读次数:
356
-v 0.6 版本 zcat access.log.*.gz | goaccess -v 0.8.3以上版本,nginx日志查看 zcat access.log.*.gz | goaccess --log-format='%h %^[%d:%t %^] "%r" %s %b "%R" "%u"' - ...
分类:
数据库 时间:
2016-12-16 14:22:22
阅读次数:
156
awk‘{IP[$1]++}END{for(iinIP)printIP[i],i}‘access.2016-12-09.log|sort-nr>/tmp/ewb.2016-12-09.logawk‘{IP[$1]++}END{for(iinIP)printIP[i],i}‘access.2016-12-10.log|sort-nr>/tmp/ewb.2016-12-10.logawk‘{IP[$1]++}END{for(iinIP)printIP[i],i}‘access.2016-12-11.l..
分类:
其他好文 时间:
2016-12-12 15:22:29
阅读次数:
170