Two tools for monitoring Apache logs

Source: Internet
Author: User
Tags mkdir postgresql apache log

Two tools for monitoring Apache logs

Apache Log analysis Tool Webalizer Awstat

Prepare webalizer-2.23-05-src.tgz awstats-7.0.tar.gz perl-5.16.3.1603.tar.gz

Install Apache

[Root@lly ~]# Mkdir/mnt/cdrom

[root@lly ~]# mount/dev/cdrom/mnt/cdrom Mounted optical drive

[Root@lly ~]# cd/mnt/cdrom/server/

[Root@lly server]# RPM-IVH apr-1.2.7-11.el5_3.1.i386.rpm

[Root@lly server]# rpm-ivh postgresql-libs-8.1.11-1.el5_1.1.i386.rpm (Apr-util belongs to this package)

[Root@lly server]# RPM-IVH apr-util-1.2.7-7.el5_3.2.i386.rpm

[Root@lly server]# rpm-ivh httpd-2.2.3-31.el5.i386.rpm (Installation httpd, dependent on apr-1.2.7-11.el5_3.1.i386.rpm and RPM-IVH postgresql-libs-8.1.11-1.el5_1.1.i386.rpm or installed with Yum)

[root@lly server]# Service httpd start (starting httpd)

Install Webalizer

[Root@lly ~]# tar zxvf webalizer-2.23-05-src.tgz-c/usr/local/src/

[Root@lly ~]# cd/usr/local/src/webalizer-2.23-05/

[Root@lly webalizer-2.23-05]# less INSTALL (view installation instructions)

[root@lly webalizer-2.23-05]#./configure--sysconfdir=/etc (default installation, installation to usr/local directory, indicating configuration file to/etc directory)

[Root@lly webalizer-2.23-05] #make

[root@lly webalizer-2.23-05] #make Install

[root@lly webalizer-2.23-05]mkdir/var/www/html/log (create log file as output directory for Webalizer analysis results, as mentioned in the following script)

Assuming that the Web server host name is www.test.com, the statistics site domain name is www.test.com, the access log is/var/log/httpd/access_log, we will webalizer the results of the analysis output to/var/www/html/ Log below.

Then we can create a script for log monitoring.

But the script only executes once, Webalizer will produce a record, want to monitor its periodic information, need to carry out the scheduled task, so add the scheduled task first

[Root@lly WEBALIZER-2.23-05]CD

[Root@lly ~]# Vi/etc/crontab

Add a directory that can also modify the scheduled task, which is changed to Cron.web

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.