Awstats

From INIwiki
Jump to: navigation, search

Digg this!

Contents

Install on Linux(Redhat) for Apache with RPM

Ensure your apache has the perl module installed

Enabel CentOS plus repository

vi /etc/yum.repos.d/CentOS-Base.repo

Enable the repository with by changing enable to a 1 value

[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1  # <--- Modify Here
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4

Install DAG repository if needed. (RHEL 5x)

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

x64

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Install from RPM

yum install awstats

Build Config file

cp /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.inisec.com.conf

Modify the newly built file

vi /etc/awstats/awstats.inisec.com.conf

Find:

LogFile="/var/log/httpd/access_log"

Change to something like:

LogFile="/var/log/httpd/wiki.inisec.com-access_log"

NOTE: Use this command for several log files
LogFile="/usr/bin/logresolvemerge.pl /var/log/httpd/*.inisec.com-access_log |"

Find:

SiteDomain="localhost.localdomain"

Change to something like:

SiteDomain="inisec.com"

Find:

HostAliases="localhost 127.0.0.1"

Change to something like:

HostAliases="localhost 127.0.0.1 www.inisec.com wiki.inisec.com REGEX[^.*\.inisec\.com$]"

Allow access

vi /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
#       deny from all  #-- Comment out
        allow from all #-- Change from 127.0.0.1 to all
</Directory>

#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/

Manually run first build command

/usr/bin/awstats_updateall.pl now  -confdir="/etc" -awstatsprog="/var/www/awstats/awstats.pl"
This command is found in /etc/cron.hourly/00awstats

Restart Apache

service httpd restart

Check from web browser

http://www.inisec.com/awstats/awstats.pl?config=inisec.com

Geoip Addon

Geoip

Source:

http://grou.ps/emresokullu.blog/?p=321

Install on Windows for IBM Domino server

Until I can transfer this section of the faq use this link or this one

Foreword

Lotus Domino is a communications platform distributed by IBM
Awstats is a open source web statistics reporting package.

This install will focus on the Windows platform

Install

You will need to install a couple of packages onto windows so awstats will play nice (Links are located below in the downloads section).

  • Download AWStats from http://awstats.sourceforge.net
  • Extract AWStats.zip to a directory of your choice.
  • Create a directory called "awstats" under the %DOMINO_DATA_DIR%\domino\html directory on your server (for example, "d:\lotus\domino\data\domino\html\awstats").
  • Copy the "wwwroot\icon" directory from the awstats files to %DOMINO_DATA_DIR%\domino\html\awstats (for example: "d:\lotus\domino\data\domino\html\awstats\icon")
  • Copy the contents of the "wwwroot\cgi-bin" directory from the awstats files (and all subdirectories beneath it) to your %DOMINO_DATA_DIR%\domino\cgi-bin directory on the Notes server (for example, "d:\lotus\domino\data\domino\cgi-bin").
  • Also copy the contents of the "tools" directory from awstats to %DOMINO_DATA_DIR%\domino\cgi-bin (for example, "d:\lotus\domino\data\domino\cgi-bin") -- in other words, take all of the .pl files from awstats and put them in your "cgi-bin" directory.
  • From the Domino "cgi-bin" directory, make a copy of the awstats.model.conf file. Call it "awstats.domino.conf". If the file is marked as "Read-Only", you'll want to go to the file properties and uncheck that flag so you can edit it. Open the file in a text editor and make the following changes (please note that Windows users will not be able to read the file very well using Notepad because it uses Unix-style linefeeds, so you'll want to open it in Wordpad or Crimson Editor, or something like that -- I use VIM for windows):

Change the "LogFile" entry to be:

LogFile="perl ./logresolvemerge.pl d:/domino/weblogs/access*.log |"

where "d:/lotus/domino/weblogs" is the path to the log files you defined in step 1 (make sure you use "/" as a directory separator, even on Windows).

*Note* that the command ends with a vertical bar (pipe) character -- this is important.
Change "LogType" to W [hint to search in VIN you must be in read mode and use the / character followed by the text, case sensitive, IE: /LogType]
Change "LogFormat" to 1
Change "SiteDomain" to be the main domain name for this server (like "www.servername.com")
Change "DirIcons" to the relative HTTP path of your icon directory from step 5 above ("../awstats/icon" should work).
Optionally -- Use SkipHosts if you do not want to log your own access. IE: if you local LAN subnet was 192.168.100.0 then..
SkipHosts="127.0.0.1 REGEX[^192\.168\.100\.]
Additionally if you don't want to track your friend access who connects from a static ip 65.206.180.44 (public of course) you can use...
SkipHosts="127.0.0.1 REGEX[^192\.168\.100\.] REGEX[^65\.206\.180\.44]

Change "AllowToUpdateStatsFromBrowser" to "1" if you want to be able to update the stats from a browser (DANGER -- this could be resource intensive on a busy server); otherwise, if you will be doing updates programmatically, it should be "0".

optionally add the sample Notes file tracking report additions (see below) to the # EXTRA SECTIONS section near the bottom of the file.
  • If you don't have Perl installed on your server, download and install it. For Windows, you can use the free ActivePerl distribution. The install for ActivePerl does require a reboot on 2003 server, so don't install it on a live Domino server unless you're feeling brave.

Configuration

Run your initial update by opening a command prompt, navigating to the "cgi-bin" directory from above, and entering the following command:

perl awstats.pl -config=domino -update

Once you've run the update command and you have an index file, you can manually create a report as an HTML page by running the following commands from the command prompt in the "cgi-bin" directory:

perl awstats_buildstaticpages.pl -config=domino -dir=../html/awstats/

[This will build all stat pages for this month, run this from the "cgi-bin" directory:]

To schedule your static reports to be built on a regular basis, use your favorite scheduling program , I used windows scheduler to run a .bat file I created in the "cgi-bin" directory.

awstatupdate.bat file example...

perl awstats_buildstaticpages.pl -config=domino -dir=../html/awstats/ -update


Source

Domino Install: Julian Robichaux
http://awstats.sourceforge.net/docs/awstats_setup.html

Digg this!

Personal tools