Apache日志轮询工具cronolog

Apache的日志配置
Apache日志轮询工具cronolog
cd /home/zxin10/tools
rz
tar xf cronolog-1.6.2.tar.gz 
cd cronolog-1.6.2
 ./configure 
make
make install
安装成功:
[root@c601 cronolog-1.6.2]# ll /usr/local/sbin/cronolog
-rwxr-xr-x 1 root root 40446 Feb  3 12:55 /usr/local/sbin/cronolog


cronolog日志轮询配置说明
[root@c601 cronolog-1.6.2]# cd /application/apache/conf/extra/
[root@c601 extra]# vi httpd-vhosts.conf
(在站点下添加如下配置)
    CustomLog "|/usr/local/sbin/cronolog /app/logs/access_www_%Y%m%d.log" combined
例如:
<VirtualHost *:80>
    ServerAdmin 31333741@qq.com
    DocumentRoot "/var/blog"
    ServerName blog.etiantian.org
    ServerAlias etiantian.org
    ErrorLog "logs/blog-error_log"
    #CustomLog "logs/blog-access_log" common
    CustomLog "|/usr/local/sbin/cronolog /app/logs/access_www_%Y%m%d.log" combined
</VirtualHost>
#创建日志轮询的目录
[root@c601 extra]# mkdir -p /app/logs
#在浏览器端访问网站,查看测试结果。
[root@c601 extra]# tail -f /app/logs/access_www_20180203.log 
192.168.0.101 - - [03/Feb/2018:13:15:20 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
192.168.0.101 - - [03/Feb/2018:13:15:20 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
192.168.0.101 - - [03/Feb/2018:13:15:20 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
192.168.0.101 - - [03/Feb/2018:13:15:20 +0800] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值