Use Awstats to collect website data deployed in tomcat

Source: Internet
Author: User

Due to the needs of the project, I have made some research on the use of AWStats over the past few days. So I will share my experiences with you and hope that I can provide you with some help and some omissions, thank you for your patience.

First, describe the usage and features of AWStats. AWStats is an open-source perl-based website statistics Tool.

It

I. Visits, visits, page views, clicks, data traffic, etc.

2. Accurate to monthly, daily, and hourly data

3. visiting countries

Iv. Visitor IP

5. Robots/Spiders statistics

Vi. Guest duration

VII. Statistics on different Files types

8. Pages-URL statistics

9. Visitor OS browser and other information

10. Other information (search keyword, etc)

 

Go to the topic and configure AWStats. The environment here is linux (Red Hat) and tomcat 7

  

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

  

Put the file in any directory in linux, for example:/opt

  

Decompress the file tar-zxvf awstats-7.3.tar.gz

  

Find the tomcat directory, modify the conf/web. xml configuration file, and cancel the comments of cgi servlet and mapping.

    

<servlet> <servlet-name>cgi</servlet-name> <servlet->org.apache.catalina.servlets.CGIServlet</servlet-> <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></param-value> </init-param> <load-on-startup>5</load-on-startup></servlet> <servlet-mapping> <servlet-name>cgi</servlet-name> <url-pattern>/cgi-bin

 

  

Modify the <Tomcat_HOME> \ conf \ context. xml configuration file and add the privileged attribute to the Context file.

<Context privileged = "true"> <! -- Other part --> </Context>

 

  

Create awstats directory and corresponding WEB-INF directory under webapps/

  

Copy the decompressed css, icon, and js directories under the wwwroot directory of the awstats directory to the tomcat webapps/awstats directory.

 

Copy the decompressed awstats directory under wwwroot/cgi-bin to the tomcat webapps/awstats/WEB-INF/cgi Directory.

  

Rename webapps/awstats/cgi/awstats. model. conf In the tomcat directory to awstats. <name of your domain name>. conf

 

Modify the configuration of awstats. <name of your own Domain Name>. conf file

= "<Your tomcat path>/logs/localhost_access_log.%yyyy-mm-domaindd.txt" = "<your site Domain Name>" = ".. /icon "" auto "=" cn "= ". /lang "=" <div id = "header"> Head Example </div> "=" <div align = 'right'> @ company </div> "= ".. /css/awstats_default.css"

 

  

Modify conf/server. xml in the tomcat directory

<Valve className="org.apache.catalina.valves.AccessLogValve"="logs"  prefix="localhost_access_log." suffix=".txt"="combined" fileDateFormat="yyyy-MM-dd" resolveHosts="false"/>

 

Run./awstats. pl-update-config = localhost in the tomcat7/webapps/awstats/WEB-INF/cgi Directory

 

Access the URL to view the generated log page: http: // <set access ip address >:< tomcat port>/awstats/cgi-bin/awstats. pl? Config = <your own domain name information>

 

Page effect:

  

  

Note: before access, run the awstats. pl Command. You can set it as a scheduled task in linux to facilitate query.

 

 

The usage on windows is similar. I hope you can communicate with each other and make progress together.

    

 

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.