Apache2 日志用 cronolog 实现日志轮循

1. 下载安装

mkdir -p /root/soft
cd /root/soft
wget -c http://cronolog.org/download/cronolog-1.6.2.tar.gz
tar -zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure
make
make install
cd ../


2. 在Apache2配置文件中修改: vim /usr/local/apache2/conf/httpd.conf

mkdir -p /home/apache_log
CustomLog "|/usr/local/sbin/cronolog /home/apache_log/%Y-%m-%d" combined env=!dontlog


3. 重启Apache2

/usr/local/apache2/bin/apachectl restart

你可能感兴趣的:(职场,apache2,休闲,cronolog,日志用,实现日志轮循)