
scr_ipfm (C) Copyright 2003 Krzysztof Gibas <sdas (at) gibas org>
                                - current maintainer
                       2001 Gonthar <gonthar (at) moon net pl>
                                - developed scr_ipfm-0.1

Translated by: ukasz Szemis <osse (at) nobopoco ltd pl>

1. What is scr_ipfm ?
   a) features
   b) downloading
2. Installing ipfm
3. Installing scr_ipfm
4. Configuration


1.What is scr_ipfm?

scr-ipfm is a script written in php, used to graphically show amount of data 
downloaded by users in local network. To do that, it uses logs generated by 
ipfm program (ipfm is available at the address: http://robert.cheramy.net/ipfm/).

The homepage of a scr_ipfm  project is available at http://scripfm.sf.net/


scr_ipf was tested on server with:
       - linux system
       - apache - 1.3.x as well as 2.0.x
       - php 4.3.x and php 5.0.x
       	  - for security reasons I recommend enabling safe_mode option and
	    setting register_globals = Off. New versions of php have this
	    settings by default
	  - also I recommend installing genious module for apache - mod_security,
	    it marvelous secures from the XSS attacks.
       - ipfm v0.12.0pre1

It shouldn't be any problem to run this script under other platforms working with 
php. There are known problems running scr_ipfm with php version 4.0.6.

a) scr_ipfm fetaures:
These are some features of:
       - sorting by field in, out, host and total
       - aggregated data of downloaded amount of data
       - daily, monthly, annually, global and 'by host'statistics

b) downloading
Newest version is avaible at the project homepage:
http://gibas.org/sdas/scr_ipfm/

or directly by CVS:
cvs -d :pserver:anonymous@sdas.eu.org:/home/cvs login
    [password is empty]
    cvs -d :pserver:anonymous@sdas.eu.org:/home/cvs get scr_ipfm
    cvs -d :pserver:anonymous@sdas.eu.org:/home/cvs logout

2. Installing ipfm:

    $ wget http://robert.cheramy.net/ipfm/archive/devel/0.12/ipfm-0.12.0pre1.tgz
    $ tar -xzvf ipfm-0.12.0pre1.tgz
    $ cd ipfm-0.12.0pre1
    $ ./configure

In case error occurs:
[...]
configure: error: You need libpcap in order to use ipfm

You have to download and install libcap library. It can be found at
http://www.tcpdump.org

    $ make
    $ su root
    # make install
    If you don't have /var/log/ipfm directory create it :
    # mkdir /var/log/ipfm

3. Installing scr_ipfm:

I assume that ipfm is installed in system, and the statistics are generated.
You should have a downloaded and unpacked scr_ipfm srcitp too.(if you are reading
this file, it is probably done).


    a) At the beginnig you should swap ipfm configuration file (on my system
       it was at /usr/local/etc/ipmf.conf), with the one from scr_ipfm package
       (ipfm.conf-sample).

       #mv /usr/local/etc/ipfm.conf /usr/local/etc/ipfm.conf-orig
       #cp ipfm.conf-sample /usr/local/etc/ipfm.conf

    b) Restart ipfm to reload configuration file

       #killall -HUP ipfm

    c) Move files from package to directory avaible through internet, for ex.:

       #cp scr_ipfm-0.45/ /usr/local/apache/htdocs/scr_ipfm/

    d) From now, if everything was done good, statistics should be avaible
       from internet.

    Warning: All files in directory where ipfm saves logs, should have the same
	     format, ie: ipfm-global-[year]-[month]-[day].log
	     
4. Configuration:

Configuring scr_ipfm  mainly depends on editing conf.php file.

     a) $version
	 Variable $version specyfies version of scr_ipfm. Its value is shown
	 at net page - in bottom table.

     b) $host_allow
         Variable $host_allow stores ip adresses of host/net from which acces to
	 statistics will be proceeded. Adressec can be separated with an coma,
	 semicolon, or space.

	 example:
	 $host_allow = "192.168.1.9 223.80.45.0,80.80.80.15"

     c) $ipfm_log_dir
         Variable $ipfm_log_dir shows in which directory scr_ipfm has to search for
	 logs generated by ipfm. In this directory there should be none subdirectories
	 or any files with other name than the one defined in ipfm.conf file.

	 example:
	 $ipfm_log_dir = "/var/log/ipfm"

     d) $default_stats
         Variable $default_stats sets which statistics should be shown on first place on
	 page. It accpets one of these values: daily, dayinmonth, monthly, monthinyear,
	 yearly, yearinglobal, glonbal.

	 example:
	 $default_stats = "monthly";

     e) $default_theme
        This variable sets default theme that will be loaded when statistics is open.
	This is file style.css from directory themes/

     f) $auto_refresh
        Shows after what period of time (in seconds) site will be automatically refreshed.
     
Rest of the settings concerning generated pages can be set in style.css file.

$Id: README,v 1.19 2003/11/08 01:04:46 gibas Exp $
