Using Awstats statistics to deploy Web site data in Tomcat

Source: Internet
Author: User

Because of the needs of the project, so these days on the use of Awstats to do some research, so this experience to share to everyone, hope can give you a glimmer of help, there are omissions in the place, pleading, thank you.

First explain the purpose and characteristics of Awstats, Awstats is an open source Perl-based Web statistics tool.

It can count the site's information mainly:

One, traffic, number of visits, page views, clicks, data traffic, etc.

Second, accurate to monthly, daily, hourly data

Third, the visitor country

Iv. Visitor IP

V. Statistics of Robots/spiders

Vi. duration of Visitors

Vii. statistical information on different files type

Viii. Statistics of Pages-url

Nine, guest operating system browser and other information

X. Other information (search keywords, etc.)

To get to the point, use the Awstats configuration method. The environment here is Linux (Red Hat) and TOMCAT7

  

Download AWStats http://sourceforge.net/projects/awstats/files/AWStats/7.3/awstats-7.3.tar.gz/download

  

Place the file in any directory on Linux for example:/opt

  

Extracting Files TAR–ZXVF awstats-7.3.tar.gz

  

Locate the Tomcat directory, modify the Conf/web.xml configuration file, and uncomment the CGI servlet and mapping

    

 <servlet> <servlet-name>cgi</servlet-name> <servlet- class  > <init-param> <param-name>debug</param-name> <param-value>0</ param-value> </init-param> <init-param> <param-name>cgiPathPrefix</param-name> < param-value>web-inf/cgi</param-value> </init-param> <init-param> <param-name> passshellenvironment</param-name> <param-value>/*  

  

Modify the <tomcat_home>\conf\context.xml configuration file to add the privileged property on the context

<context privileged= "true" ><!--other parts--></context>

  

Create the Awstats directory and the corresponding Web-inf directory under webapps/

  

Copy the Css,icon,js directory under the Wwwroot directory of the extracted Awstats directory to the Webapps/awstats directory of Tomcat

Will unzip the Awstats directory under the Wwwroot/cgi-bin so file copy to the Tomcat webapps/awstats/web-inf/cgi directory

  

Rename the Tomcat directory webapps/awstats/cgi/awstats.model.conf to awstats.< name-related information for your own domain >.conf

Modify the name of the awstats.< own domain related information >.conf file related configuration

#对应日志文件所在位置LogFile= "< own tomcat path >/logs/localhost_access_log.%yyyy-%mm-%dd.txt"# Site domain name SiteDomain= "< own site domain name >"#图标所在目录DirIcons= ". /icon "#国际化所使用的语言, default to " Auto "Lang=" cn "#国际化文件所在目录DirLang="./lang "# Htmlhtmlheadsection= "<div id=" header ">head example</div>" to be added in the header of the generated page At the end of the build page ask for htmlhtmlendsection= "<div align= ' right ' > @company </div>"#生成页面所使用的样式表, Awstas provides a default style sheet that allows you to customize the Awstats style stylesheet= "... /css/awstats_default.css "

  

Modifying the Conf/server.xml of the Tomcat directory

<valve classname= "org.apache.catalina.valves.AccessLogValve"directory= "Logs"  prefix= "Localhost_ Access_log. "suffix=". txt "pattern=" combined "filedateformat=" Yyyy-mm-dd "resolvehosts=" false "/>

Execute in the directory under tomcat7/webapps/awstats/web-inf/cgi./awstats.pl-update-config=localhost

Access URL View generated log page:http://< set access Ip>:<tomcat port >/awstats/cgi-bin/awstats.pl?config=< own Domain Information >

Page effect:

  

  

Description: Prior to the visit to execute the awstats.pl instructions, you can set the Linux as a timed task, easy to query.

The use of Windows is similar, I hope you can communicate together, progress together.

    

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.