Tomcat installs Webalizer (can count Tomcat Web Access)
Install tomcat slightly (in Tomcat 6 For example, 7 basically the same)
# Apt-get Install Webalizer
Modify the Tomcat log format
# vi/var/lib/tomcat6/conf/server.conf (plus rotatable= "false" at the end of the file)
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"
prefix= "Localhost_access_log" suffix= ". txt" pattern= "common"
Resolvehosts= "false" rotatable= "false"/> (take care to remove prefix= "Localhost_access_log." The last "."
)
The default is:
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"
prefix= "Localhost_access_log" suffix= ". txt" pattern= "common"
Resolvehosts= "false"/>
: Wq
# Service Tomcat6 Restart
# Mv/var/www/weblizer/var/lib/tomcat6/webapps/usage
# vi/etc/webalizer/webalizer.conf
Logfile/var/log/tomcat6/localhost_access_log.txt
Outputdir/var/lib/tomcat6/webapps/usage
: Wq
Start Weblizer
# Weblizer
If the following information appears, you can access the page (http://ip:8080/usage) and then execute Webalizer
[Email protected]:~/.ssh# Webalizer
Webalizer v2.01-10 (Linux 3.5.0-23-generic) Locale:en_us. UTF-8
Using Logfile/var/log/tomcat7/localhost_access_log.txt (CLF)
Using Default GeoIP Database
Creating Output In/var/lib/tomcat7/webapps/usage
Hostname for reports is ' hudsonL09 '
History File not found ...
No Valid Records found!
If the following information is present, you can access the
[Email protected]:~/.ssh# Webalizer
Webalizer v2.01-10 (Linux 3.5.0-23-generic) Locale:en_us. UTF-8
Using Logfile/var/log/tomcat7/localhost_access_log.txt (CLF)
Using Default GeoIP Database
Creating Output In/var/lib/tomcat7/webapps/usage
Hostname for reports is ' hudsonL09 '
History File not found ...
Generating report for June 2015
Generating Summary Report
Saving history information ...
Records in 0.50 seconds
Visit: Http://ip:8080/usage
This article is from the "Linux" blog, so be sure to keep this source http://yangzhiming.blog.51cto.com/4849999/1662009
Tomcat Installation Webalizer