Installation and Configuration of AWStats on Tomcat Web Server

Here are the steps in installing and configuring AWstats in Tomcat Web Server


1.    Download awstats.war from the internet
2.    Since Tomcat disabled by default the CGI executions, we need to enable it by renaming the file servlets-cgi.renametojar to servlets-cgi.jar
[Tomcat_installation_path] = /usr/local/apache-tomcat-5.5.20

#cd /usr/local/apache-tomcat-5.5.20/server/lib
#mv servlets-cgi.renametojar servlets-cgi.jar

3.    Install AWStats
Since it is already a .war file, no need to install it by hand, you just need to copy this file to [Tomcat_installation_path]/webapps folder

#cp awstats.war [Tomcat_installation_path]/webapps

It would create an [Tomcat_installation_path]/webapps/awstats folder after copied.

4.    Configure AWStats
Let say our domain is

#cd /etc
#mkdir awstats
#cd [Tomcat_installation_path]/webapps/awstats/WEB-INF/cgi-bin
#cp awstats.model.conf /etc/awstats/

5.    Edit awstats.conf
#vi /etc/awstats/

Look for the line in the configuration and change the values as shown below:

LogSeparator=” ”

6.    Update Site Statistics
Here you have two choices:
1.    Set AllowToUpdateStatsFromBrowser=1 in file, see above. This will allow updating from the web browser with:
2.    Using SSH, go to [Tomca_install]/webapps/awstats/WEB-INF/cgi-bin folder and run perl -update.
#/usr/local/awstats/wwwroot/cgi-bin/ -update
Create/Update database for config “/etc/awstats/” by AWStats version 6.6 (build 1.887)From data in log file “/var/log/httpd/www.freelinuxtutorials-combined_log”…
Phase 1 : First bypass old records, searching new record…
Direct access after last parsed record (after line 10471)
Jumped lines in file: 10471
Found 10471 already parsed records.
Parsed lines in file: 160
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 160 new qualified records.

7.View Site Statistics

Access it using your favorite browser. Type

8.Create crontab script in order to update the  log file analysis
#crontab –e

add this line

0 * * * * /usr/local/awstats/wwwroot/cgi-bin/ -update > /root/awstatsjob/awstats.log

9. You can follow “Installation of GeoIP Information for AWStats” documentation to have a country information on your web/mail/ftp statistics.

About the author


View all posts


  • of course like yⲟur web-site but yⲟu need to check the spelling on seᴠeral of yoսr posts.
    Many of them ɑre rife with spelling issues and I find іt vᥱry bothersome tⲟ teⅼl thhe truth
    oon the othеr һand I աill surely come back again.

  • Please let me know if you’re looking for a article writer for your blog. You have some really good posts and I believe I would be a good asset. If you ever want to take some of the load off, I’d really like to write some articles for your blog in exchange for a link back to mine. Please send me an email if interested. Cheers!

  • Great weblog right here! Also your web site a lot up fast! What host are you the usage of? Can I get your associate link on your host? I want my web site loaded up as quickly as yours lol

  • Well I truly liked reading it. This subject offered by you is very constructive for correct planning.

  • What i do not realize is in fact how you are now not actually much more smartly-appreciated than you might be right now. You are so intelligent. You already know thus significantly with regards to this subject, produced me individually imagine it from a lot of numerous angles. Its like men and women aren’t interested until it is one thing to do with Lady gaga! Your own stuffs outstanding. At all times maintain it up!

  • Excellent post. I used to be checking constantly this blog and I am impressed! Very helpful info specially the last phase 🙂 I maintain such info much. I was seeking this certain info for a long time. Thank you and best of luck.

Leave a Reply