Installation instructions :

create the dir where you'll put the front-end :
	=> mkdir piwi
copy the archive you just downloaded to it :
	=> cp piwi-latest.tar.gz piwi/
go to this dir :
	=> cd piwi/
------------------------------------------------------------------------
uncompress the full package to its destination directory.
        => tar -xzvf piwi-latest.tar.gz

  or if you have a really old tar that don't support 'z' :
        => gunzip piwi-latest.tar.gz
        => tar -xvf piwi-latest.tar
------------------------------------------------------------------------
change rights on sub-dir generated/ (must be writable for apache user)
	=> chown -R nobody.nobody generated/

  of course, if your apache user isn't 'nobody', group 'nobody', change as appropriate
  (wwwuser.nogroup on some distributions like Suse)
  (apache.apache on some distributions like MDK9.1, gentoo)
------------------------------------------------------------------------
change DB access properties in sub-dir Functions, file config.pl
	=> dbtype : 'mysql' OR 'Pg'
        => dbname : Prelude DB back-end DBname
	=> dbhost : localhost or DB server IP
        => dbport : port the DB server is listening on
	=> dboptions : leave empty if you don't know
	=> dblogin : username to connect with
	=> dbpasswd : corresponding password

in default config file, there is a mysql specific dboption : mysql_compress=1
it just compress data exchanged between localhost and the DB. usefull if slow link => if both front-end and DB are on the same host, no need of it

        => debug : set to 1 to have error messages displayed to screen (to debug only)
        => extension : contains the extension (with '.' before) of scripts (.pl is default)

        => ettercap_fp_db : path to ettercap OS fingerprint DB
        => ettercap_mac_db : path to ettercap MAC Vendor DB

        => HostName_Lookup : enable/disable hostname lookups

        => nb_resbypage   : default element number by page in Alert List (either AlertNb/page or GroupNb/page when grouping)
        => nb_resbygroup  : default alert number by group in Alert List when grouping (set to 0 to hide alerts)
        => nb_topattack*s : default elements listed in TopAttack*s pages

        => GMTdiff : As prelude stores all datetime in GMT internally, put it to 0 to display GMT, +2 if you are GMT+2, ...
------------------------------------------------------------------------
change apache config file (httpd.conf/apache2.conf) to make .pl files executable as CGI :
  here is the example to use with mod_perl enabled.
  Only write first line if Apache::DBI is installed on your system !!

     PerlModule Apache::DBI

     <Files *.pl>
       SetHandler perl-script
       PerlHandler Apache::PerlRun
       PerlSendHeader On
     </Files>

  without mod_perl :
     <Directory "/real_path_to_piwi_directory/">
       Options ExecCGI
       AddHandler cgi-script .pl
     </Directory>

  in both case, don't forget to put the following line :
     DirectoryIndex index.pl

 but please, never use something like that :
 
   ScriptAlias "/real_path_to_piwi_directory/" piwi
   
because apache would try execute any file as if they were scripts (including .css and images)

------------------------------------------------------------------------
Requirements :

	- a working prelude installation with DB back-end enabled (not necessary on the same host)
           tested under mysql v3.23/4.0.11 and PostgreSQL v7.3.x
	- linux 2.x or freebsd 4.7
	- apache 1.3.x or 2.x (reported to work with fnord too)
	- perl 5.6.x or + (tested with 5.6.x & 5.8.x)
	- DBI module
	- DBD module for mysql or Pg (PostgreSQL)
              Avoid DBD::mysql v2.9002, it won't work !!!!!
	- Date::Calc : for date calculations
                http://search.cpan.org/author/STBEY/
	- CGI

Optional modules :
	- Geo::IP : for Country resolution from IP address (both C lib and perl module)
		http://www.maxmind.com/app/linux

	GD back-end : (deprecated)
	- GD, GD::Text, GD::Graph & GD::Graph3d : for graphics generation & statistics
		http://www.boutell.com/ -> gd C lib (with png support !!!)
		http://stein.cshl.org/WWW/software/GD/ -> GD
		http://search.cpan.org/author/MVERB/ -> GD::Graph & GD::Text

	PS back-end : (prefered)
	- ghostscript with jpeg support (for graph generation from postscript .ps files)
	- PDF::API2 (perl module for PDF report generation)

	- mod_perl : to enable perl script caching
                http://perl.httpd.org/
	- Apache::DBI : to enable persistant DB connections
                http://search.cpan.org/author/ABH/

TO TEST YOUR INSTALLATION, GO DIRECTLY TO : $piwi_directory/test/index.pl
