Debianhelp.co.uk


Analog - www logfiles Analizer Installation and Configuration in debian

What is analog ?

Analog is a program to measure the usage on your web server. It tells you which pages are most popular, which countries people are visiting from, which sites they tried to follow broken links from, and all sorts of other useful information

Analog Features

Analog shows you the usage patterns on your web server. It's
Ultra-fast
Scalable
Highly configurable
Reports in 32 languages
Works on any operating system
Free software

Download analog

http://www.analog.cx/download.html

Analog Documentation

http://www.analog.cx

Analog How-to

http://www.analog.cx/how-to/index.html

Installing analog in Debian

# apt-get install analog

Reading Package Lists... Done
Building Dependency Tree... Done
Suggested packages:
 apache httpd rmagic
The following NEW packages will be installed:
 analog
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1247kB of archives.
After unpacking 4477kB of additional disk space will be used.
Get:1 http://ftp.uk.debian.org stable/main analog 2:5.32-14 [1247kB]
Fetched 1247kB in 9s (125kB/s)
Preconfiguring packages ...
Selecting previously deselected package analog.
(Reading database ... 35889 files and directories currently installed.)
Unpacking analog (from .../analog_2%3a5.32-14_i386.deb) ...
Setting up analog (5.32-14) ...

This will install analog in your system.

Configuring analog

Main configuration file for analog is analog.cfg.By default analog configuration file is located at /etc/analog.cfg.

Default configuration file looks like below

# Configuration file for analog 5.32
# See http://www.analog.cx/
#
# Here are a couple of configuration commands to get you started. Add any more
# you like from the Readme.
#
# Lines starting with # are comments.
#
# There is a much more extensive configuration file in examples/big.cfg
#
# If you need a LOGFORMAT command (most people don't -- try it without first!),
# it must go here, above the LOGFILE commands.

# This sets analog to process the apache log files. If you use a web server
# other than apache, you will need to tell analog where the web server
# keeps its log files.
LOGFILE /var/log/apache/access.log
LOGFILE /var/log/apache/referer.log
LOGFILE /var/log/apache/agent.log
# apache2 uses this file instead
LOGFILE /var/log/apache2/access.log

# LOGFILE /old/logs/access_log.*
# OUTFILE Report.html
# HOSTNAME "[my organisation]"
#
# You probably don't need to change anything below this until you are
# experienced.
#
# ERRFILE errors.txt
# REQINCLUDE pages
REQLINKINCLUDE pages
REFLINKINCLUDE *
REDIRREFLINKINCLUDE *
FAILREFLINKINCLUDE *
SUBBROW */*
SUBTYPE *.gz,*.Z

From the above configuration file we need to modify how to fit in to our needs.You need to modify the following values
# keeps its log files.
LOGFILE /var/log/apache/access.log
LOGFILE /var/log/apache/referer.log
LOGFILE /var/log/apache/agent.log
# apache2 uses this file instead
LOGFILE /var/log/apache2/access.log

apache or any other logfiles location you need to enter here

# LOGFILE /old/logs/access_log.*

# OUTFILE Report.html

output file where do you want to store

example

OUTFILE /var/www/testhtdocs/analog/index.html

# HOSTNAME "[my organisation]"

hostname you need to enter here

example

HOSTNAME YOUR-DOMAIN.NAME

After changing all these values you need to run analog manually enter the following command

#/usr/bin/analog

after finishing this your output file will be stored the location we have mentioned above and you can access using using web browser like

http://your domain name/analog/index.htm

To have an Analog report regularly e-mailed to you, add something like one of the following lines to your Crontab (the text below should all be placed on a single line):

59 23 * * 7 /usr/bin/analog +O- +a | /usr/bin/mail -s "Weekly Stats"

This will cause your Virtual Server to send you an e-mail each Sunday night at 11:59pm containing your Analog analysis report in ASCII format.

If you want to know more about how to use crontab click here

If you want to know more about the configuration file and how to customize check analog Readme file.

Configuring analog for Virtual hosts

One of the great things about Analog is that it can easily be used to offer different customised output to multiple virtual hosts on the same server.

This is an obvious asset if you host several domains on your server and want to offer all your customers the benefit of daily/weekly/monthly Analog stats, but not all of them require the same level of reporting or the same 'look'.

For more configuration steps just click here