Home Page‎ > ‎

AW Status

Installation on Ubuntu Server

  • Download the awstats package from:
  • Extracted the package to /usr/local/
  • Making the symbolic link for easy access within the /usr/local directory
    • bash$  ln -s awstats-ver.sion awstats


Go into the tools directory inside of awstats and run the command below to do several setup actions.
bash$  sudo perl awstats_configure.pl
  • Running OS detected: Linux, BSD or Unix: y
  • Check for web server install: none
  • Need to create a new config file?: y
  • Define config file name to create: WEBSITE_NAME (ie. www.nuthawin.com)
  • Define config file path: ENTER (for default path /etc/awstats/)

Go to /etc/awstats and check configuration file (awstats.www.nuthawin.com.conf) the particular attention should be given to these parameters:

  • LogFile: It should be the full path of your server log file (You can also use a relative path from your awstats.pl directory, but a full path avoids errors).
    • "/usr/local/awstats/tools/logresolvemerge.pl /usr/local/awstats/logs/mysite/*.gz |" will merge all of the log files in that directory and generate statistics.
  • LogType: It should be "W" for analyzing web log files.
  • LogFormat:  is set to "1" (for "NCSA apache combined/ELF/XLF log format") or use a custom log format if you don't use the combined log format.
  • SiteDomain: parameter to the main domain name or the intranet web server name used to reach the web site to analyze (Example: www.nuthawin.com). If you have several possible names for same site, use the main domain name and add the others to the list in the 
  • HostAlias: Any other host alias other than the SiteDomain
  • DirData: "/var/lib/awstats" make sure that the user that execute the update can access this directory
  • DirIcons: "/awstatsicons" so that the icons will show up in the awstats page
Configure the apache2:
  • Copy the httpd_conf from the awstats tools into apache2 conf.d:
    • bash$  cp /usr/local/awstats/tools/httpd_conf /etc/apache2/conf.d/awstats.conf
  • Make sure the user www-data has access to /usr/local/awstats/wwwroot directory
    • bash$  sudo chown -R www-data /usr/local/awstats/wwwroot

Building/Updating the statistics database

The first log analysis should be done manually from the command line since the process may be long and it's easier to solve problems when you can see the command output (if you don't have Command Line access, skip to Step 2). The AWStats create (and update) statistics database command is:
bash$  sudo perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl --config=mysite --update

where mysite must be substituted with the domain/virtual host name you selected earlier during AWStats configuration. AWStats will read the configuration file awstats.mysite.conf (or if not found, awstats.conf) and create/update its database with all summary information issued from analyzed log file.

AWStats statistics database files are saved in directory defined by the DirData parameter in configuration file. When the create/update is finished, you should see a similar result on your screen:
    Create/Update database for config "/etc/awstats/awstats.www.nuthawin.com.conf" by AWStats version 6.9 (build 1.925)
    From data in log file "/var/log/access.log"...
    Phase 1 : First bypass old records, searching new record...
    Searching new records from beginning of log file...
    Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
    Jumped lines in file: 0
    Parsed lines in file: 850
    Found 0 dropped records,
    Found 1 corrupted records,
    Found 0 old records,
    Found 849 new qualified records.
  • Dropped records are records discarded because they were not "user HTTP requests" or were requests matching AWStats filters. If you want to see which lines were dropped, you can add the -showdropped option on the command line.
  • Corrupted records are records that do not match the log format defined by the "LogFormat" parameter in the AWStats configuration file. If you want to see which lines are corrupted, you can add the -showcorrupted option on the command line.
  • Old records are simply records that were already processed by a previous update session.
  • New records are records in your log file that were successfully used to build/update the statistics database.

To view the statistics from a browser, use the URL: http://www.myserver.mydomain/awstats/awstats.pl?config=mysite

For more detail installation and configuration, please follow this link: http://awstats.sourceforge.net/docs/awstats_setup.html