Use awstats to analyze web logs in linux

Source: Internet
Author: User
In the access log file access_log of the httpd service, a large amount of client access information is recorded. By analyzing this information, you can know the access to the WEB site in a timely manner. For experienced administrators, you can write shell scripts to perform on-demand information in the access_log file...

In the access log file access_log of the httpd service, a large amount of client access information is recorded. By analyzing this information, you can know the access to the WEB site in a timely manner.

For experienced administrators, you can write shell scripts to collect on-demand statistics on the information in the access_log file. a simpler method is to use a mature log analysis program, complete Automated log analysis and statistics.

We recommend an open-source log analysis tool awstats.

The following is the process of adding the awstats log analysis page.

1. decompress and release the awstats package, and execute the awstats_configure.pl script in the directory for installation.

After the awstats_configure.pl script is executed, an interactive process is started.

During this process, the awstats installation directory, httpd service configuration file path, log format, and other system environments will be checked. The following procedure is for reference only.

1) select "y" to change the log record format of the httpd service to "combined" to record more details.

2) select "y" to create a new configuration file.

3) define the name of the target website for log analysis (take benet.com as an example)

4) define the storage directory of the awstats configuration file (/etc/awstats by default)

 

5). add a cron scheduled task (the task cannot be automatically added during script installation. press enter to continue)

 

6) press enter to exit the installation script

 

2. modify the awstats. www. benet. conf configuration file.

Find the correct location of the "LogFile" configuration line

[Root @ www tools] # vi/etc/awstats/awstats.www.benet.com. conf

3. create a database storage directory and update the database

Awstats analyzes logs using the awstats. pl script. each operation automatically adds the newly added content to the statistics database.

 

4. set a cron scheduled task to run the log analysis program periodically.

5. view the analysis report in the web browser

Again we visit the web page: http://www.benet.com/awstats/awstats.pl? Config = www.benet.com to go to the awstats log analysis report page.

 

This article is from the "Hello" blog

Related Article

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.