Linux installation Deployment Awstats Log Analysis System Instance

Source: Internet
Author: User

Awstats is an open log analysis system developed using the Perl language that analyzes access logs for Apache Web servers and can also be used to analyze log information such as Samba, VSFTPD, and IIS.

This article mainly explains how to install and deploy the Awstats on the Apache Web service station log analysis under Linux system.


Test Step One, install and deploy the Awstats analysis software.

One, install the Awstats package.

Unzip it directly into the/usr/local/awstats directory to complete the installation.

Use command: Mkdir-p/usr/local/awstats

Tar zxf awstats-7.3.tar.gz-c/usr/local/awstats

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/78/83/wKiom1Z-fmOjGc1tAAAqYAI5b3E464.jpg "title=" 1.jpg " alt= "Wkiom1z-fmojgc1taaaqyai5b3e464.jpg"/>


Set up the configuration file for the site to be counted.

With awstats_configure.pl, you can simplify this process by switching to the/awstats/tools directory and performing awstats_configure.pl

Use command: cd/usr/local/awstats/tools/

chmod +x awstats_configure.pl

./awstats_configure.pl

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/78/83/wKiom1Z-gLyzCA_aAAAvy0AGqJo065.jpg "title=" 2.jpg " alt= "Wkiom1z-glyzca_aaaavy0agqjo065.jpg"/>

1, specify the path to the httpd master configuration file

The httpd master configuration file path for this experiment is/usr/local/httpd/conf/httpd.conf

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/78/83/wKiom1Z-gjzzwHfEAABvpvXPS5I872.jpg "title=" 3.jpg " alt= "Wkiom1z-gjzzwhfeaabvpvxps5i872.jpg"/>

2, set the log type

y/n Select Y When selected, the HTTPD server logging format is automatically modified to "combined" so that more detailed Web access information can be recorded in the log.

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/78/82/wKioL1Z-hFPDaNjLAABq_pU8dew214.jpg "title=" 4.jpg " alt= "Wkiol1z-hfpdanjlaabq_pu8dew214.jpg"/>

3, create a profile for the specified Web site

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/78/83/wKiom1Z-heujdz96AAEKknw5fDs753.jpg "title=" 5.jpg " alt= "Wkiom1z-heujdz96aaekknw5fds753.jpg"/>

4, follow-up work, press two times enter key to exit the configuration tool


Third, modify the statistics configuration file for the site

Edit the configuration file, specify the log file to be used for analysis, and specify the storage statistics directory

Use command: Mkdir-p/var/lib/awstats

Vim/etc/awstats/awstats.www.yuanshuai.com.conf

Logfile= "/usr/local/httpd/logs/access_log"

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/78/83/wKiom1Z-iDOQOFayAAAptcP5ito393.jpg "title=" 6.jpg " alt= "Wkiom1z-idoqofayaaaptcp5ito393.jpg"/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/78/82/wKioL1Z-iFiSH0tNAAA9RvbgGOo341.jpg "title=" 7.jpg " alt= "Wkiol1z-ifish0tnaaa9rvbggoo341.jpg"/>


Four, perform log analysis, and set up cron scheduled Tasks

1. With the awstats_updateall.pl script, you can update all sites.

Use command: chmod +x awstats_updateall.pl

./awstats_updateall.pl Now

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/78/83/wKiom1Z-iZSDnFoHAADU7XGLjg8213.jpg "title=" 8.jpg " alt= "Wkiom1z-izsdnfohaadu7xgljg8213.jpg"/>

2, you can set the task schedule through the Crontab service

Use command: CRONTAB-E

*/5 * * * */usr/local/awstats/tools/awstats_updateall.pl now

/etc/init.d/crond start

Chkconfig--level Crond on

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/78/82/wKioL1Z-jPuRXW_GAAAyHjyFHwI658.jpg "style=" float: none; "title=" 10.jpg "alt=" Wkiol1z-jpurxw_gaaayhjyfhwi658.jpg "/>

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/78/82/wKioL1Z-jS-yu_17AABjCruqd4I192.jpg "title=" 9.jpg " alt= "Wkiol1z-js-yu_17aabjcruqd4i192.jpg"/>




Lab step two, access to the Awstats analysis system

one, visit the site http://www.yuanshuai.com /awstats/awstats.pl?config=www.yuanshuai.com

Note: Enter the site name that you set for my site name is www.yuanshuai.com so input.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/78/82/wKioL1Z-jyChY2_HAAH7XJURlQY331.jpg "title=" 11.jpg "alt=" Wkiol1z-jychy2_haah7xjurlqy331.jpg "/>


Second, optimize the path, can access www.yuanshuai.com/awb.html, access, simplify operation.

Use command: vim/usr/local/httpd/htdocs/awb.html

<meta Http-equiv=refresh content= "0;

Url=http://www.yuanshuai.com/awstats/awstats.pl?config=www.yuanshuai.com ">

<body></body>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/78/82/wKioL1Z-keHQf7HJAABwxqOkJKs490.jpg "title=" 12.jpg "alt=" Wkiol1z-kehqf7hjaabwxqokjks490.jpg "/>

3. Access http://www.yuanshuai.com/awb.html through the changed path

This article is from the "New Start" blog, so be sure to keep this source http://yuanshuai.blog.51cto.com/10539781/1728672

Linux installation Deployment Awstats Log Analysis System Instance

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.