Linux与Windows系统下cronolog轮询安装与配置
时间:2007-07-31 来源:ajiangg
- Version 1.6.2 released 2002-01-24 (gzip'ed tar file)
- Version 1.6.1 released 1999-12-20 (gzip'ed tar file)
Win 32 version (ZIP file) - Version 1.6 released 1999-12-16 (gzip'ed tar file)
- Version 1.5b9 released on 4 June 1998 (gzip'ed tar file)
- Version 1.4 released 20 December 1996 (gzip'ed tar file)
- 如果有Windows的要下Win_32_version(ZIP file) Linux习惯用哪种包就用哪种.
- 2. 在Linux 下安装cronolog
- tar zxvf cronolog-1.6.2.tar.gz
- cd cronolog-1.6.2
- ./configure (注意:默认是安装在/usr/local下 cronolog的命令在/usr/local/sbin下,这个要清楚)
- make ; make install
3.在Windows下安装cronolog
在Windows下很简单,直接把cronolog.exe解压Copy到apache目录下的bin目录中.
4.配置都是一样的格式,不过要注意Linux和Windows下斜杠的方向.
Linux下
例:cronolog命令在/usr/local/sbin 下 日志文件在 /usr/local/apache2/logs/下
在FormatLog附近加入两句:
CustomLog "|/usr/local/sbin/cronolog logs/access_%Y%m%d.log" combined
ErrorLog "|/usr/local/sbin/cronolog logs/error_%Y%m%d.log"
Windows下
例:cronolog命令在apache的bin中 日志文件在D:/logs
CustomLog "|bin/cronolog D:/logs/access_%Y%m%d.log" combined
ErrorLog "|bin/cronolog D:/logs/error_%Y%m%d.log"
(注意:斜杠方向都在Linux下是一样的,不跟Windows的习惯一样)
如果有虚拟主机,虚拟主机也要配置,例如:
<VirtualHost *:80>
ServerName www.domain.com
CustomLog "|bin/cronolog.exe D:/logs/access_%Y%m%d.log" combined
ErrorLog "|bin/cronolog.exe D:/logs/error_%Y%m%d.log"
</VirtualHost>
5.重启服务就可以看到生成了一个新的日志文件.