Awastas Log Analysis tool to build a document

Source: Internet
Author: User
Tags geoip apache log install perl

Http://localhost/awstats/awstats.pl?config=wp


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "alt=" awstats-6.6.tar.gz "class=" Editor-attachment "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px Solid #ddd; "/>

1. Decompression

Tar zxvf awstats-6.6.tar.gz
MV Awstats-6.6/usr/local/awstats
cd/usr/local/awstats/tools/
Perl awstats_configure.pl


2. Installation

#由于脚本有所区别, the order of the content may be different, for informational purposes only

(1)
-----> Running OS detected:linux, BSD or Unix
Warning:awstats Standard directory in Linux OS is '/usr/local/awstats '.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/opt/awstats
To standard directory:
/usr/local/awstats
And then, run configure.pl from the this location.
Does want to continue Setup from this NON standard directory [YN]?

Then select Y to enter.

(2)
-----> Check for Web Server install

Enter full config file path of your WEB server.
Example:/etc/httpd/httpd.conf
Example:/usr/local/apache2/conf/httpd.conf
Example:c:\program Files\apache group\apache\conf\httpd.conf
Config file path (' None ' to skip Web server Setup):

For the first time, enter the Apache httpd.conf path, for example/opt/sina/apache/conf/httpd.conf
If you later use Perl awstats_configure.pl to generate the configuration file, you can enter none to skip.

(3)
-----> Check and complete Web server config file '/opt/sina/apache/conf/httpd.conf '
Warning:you Apache config file contains directives to write ' common ' log files
This means is some features can ' t work (OS, browsers and keywords detection).
Do you want me to setup Apache to write ' combined ' log files [y/n]?

Select Y to change the logging mode from Customlog/yourlogpath/yourlogfile common to more detailed customlog/yourlogpath/yourlogfile combined

(4)
-----> Update Model config file '/opt/awstats/wwwroot/cgi-bin/awstats.model.conf '
File awstats.model.conf updated.

-----> need to create a new config file?
Do you want me to build a new AWStats Config/profile
File (required if first install) [y/n]?

Create a new configuration file, select Y

(5)
-----> Define Config file name to create
What's the name of the your Web site or profile?
Example: Www.mysite.com
Example:demo
Your Web site, virtual server or profile name:
>

Enter the site name, such as WP, just to differentiate the site

(6)
-----> Define Config file path
In which directory does you plan to store your config file (s)?
Default:/etc/awstats
Directory path to store config file (s) (Enter for default):
>

Enter the Awstats configuration file to store the path, the general direct carriage will use the default path/etc/awstats

(7)
-----> ADD Update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/opt/awstats/wwwroot/cgi-bin/awstats.pl-update-config=sina
Or If you have several config files and prefer has only one command:
/opt/awstats/tools/awstats_updateall.pl now
Press ENTER to continue ...

Press ENTER to continue

(8)
A Simple config file has been created:/opt/awstats/etc/awstats.sina.conf
You should has a look inside to check and the change manually main parameters.
You can then manually the update your statistics for ' sina ' with command:
> Perl Awstats.pl-update-config=sina
You can also read your statistics for ' Sina ' with URL:
> Http://localhost/awstats/awstats.pl?config=wp

Press ENTER to finish ...

Press ENTER to end


4. Modify AWSTATS.SINA.CONF Configuration
Vi/etc/awstats/awstats.sina.conf

Modify Log Path
Search logfile

Change the Apache log path and file name to be analyzed.

#123服务器上的日志命名格式

Logfile= "/usr/local/apache2/logs/wp_access_%yyyy%mm%dd.log"

Create a new Awstats data directory based on the configuration file

Mkdir-pv/var/lib/awstats


Dirdata= "/var/lib/awstats"


5. Update the analysis report
Perl/opt/awstats/wwwroot/cgi-bin/awstats.pl-config=wp-update

If the error is prompted, the probable cause

Log not emptied

FIX: Stop Apache and empty the current log, or rename the previous log file

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

Ok!

6. View Analysis Report

Http://localhost/awstats/awstats.pl?config=wp


7. Configure IP Attribution Plug-in


The first thing to install is Perl-mcpan


Yum Install Perl-mcpan

perl-mcpan-e ' Install ' Geo::ip '    

perl-mcpan-e ' Install ' geo::ipfree '


Then modify the GeoIP path information in the configuration file

loadplugin= "GeoIP Geoip_standard/usr/share/geoip/geoip.dat"

loadplugin= "Geoip_city_maxmind Geoip_standard/usr/share/geoip/geolitecity.dat"


The attribution will be displayed the next time the Awstats update is in place


You can write the update command to a scheduled task


[email protected] ~]# cat/scripts/awstats_up.sh
Perl/usr/local/awstats/wwwroot/cgi-bin/awstats.pl-config=wp-update

[ [email protected]   ~]# crontab-l
*/5 * * * */scripts/awstatus_up.sh


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>



This article is from the "World" blog, make sure to keep this source http://xiajie.blog.51cto.com/6044823/1602701

Awastas Log Analysis tool to build a document

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.