Linux under the Cronolog partition Apache log, big god mo shoot Bricks, rookie left a record, small white please silently reproduced. Not even the Linux login and VI edit, please close this page silently. Into the chase
Description: The light green bottom for the Linux command, the other for the note description.
Download Cronolog
wget "Http://download.chinaunix.net/down.php?id=3457&ResourceID =1851&site=1 "
#解压缩
TAR-XZVF cronolog-1.6.2.tar.gz
#进入目录
cd cronolog-1.6.2
#列出所有文件
ll
#configure
./configure--prefix=/usr/local/cronolog
#make
make
#安装
make install
#进入httpd的配置文件目录
cd/chinasofti/apache/conf/ Extra
#备份httpd的配置文件
CP httpd-vhosts.conf httpd-vhosts.conf.20150508
#编辑httpd的配置文件
vi httpd.conf
Modify the light yellow bottom section, note the red section of the log directory Oh!
<virtualhost *:80>
Documentroot/chinasofti/www/wwwroot/mywebdir
ServerName www.myweb.com
Serveralias www.myweb.com
<directory "/chinasofti/www/wwwroot/mywebdir/" >
Options-indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
Errorlog "|/usr/local/cronolog/sbin/cronolog /chinasofti/www/wwwroot/mywebdir/myweb_http_logs/ myweb.com-error_log_%y%m%d "
Customlog "|/usr/local/cronolog/sbin/cronolog /chinasofti/www/wwwroot/mywebdir/myweb_http_logs/ myweb.com-access_log_%y%m%d "Common
</VirtualHost>
Save exit.
#重启apache
Service httpd Restart
Check if the log split was successful
Using Cronolog to split Apache logs under Linux