Using Cronolog to split Apache logs under Linux

Source: Internet
Author: User
Tags apache log

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.