$Id: README,v 1.17 2009/10/12 19:31:10 bhockney Exp $
(C) 2003-2009 by Bob Hockney <zeus@ix.netcom.com>

Setup information for MySQL for use with webfwlog.

This program is distributed under the terms of the GNU GPL.


This directory contains a script to set up your MySQL database for use
with webfwlog.  The script will prompt you to answer some questions and for
input needed to set up your MySQL server for use with webfwlog.  The
setup script will create a MySQL script specific to your installation, and
you can then save the MySQL script, view it, or run it.  You must run setup
the first time you install webfwlog and you should run it whenever you upgrade
webfwlog or upgrade your MySQL server.

To run the setup script cd into the directory containing setup and type:

./setup

After running the MySQL script created by the setup script be sure to
update your ulogd.conf as needed and restart the ulogd daemon if you are
using ulogd, and also edit your webfwlog.conf file as needed.

Reading the rest of this file is recommended before running the setup script.

PREREQUISITES

Webfwlog requires MySQL >= 3.23.52 or any production version of 4.x or 5.x.

Before running this script you should have your MySQL server installed and
running, and you will need to have login credentials for an admin user for
MySQL such as 'root' (separate from the system root user).  You will also
need to choose a MySQL user name and password for webfwlog to use.
The user will be created if it does not exist.  This should be a separate user
not shared with any other application and SHOULD NOT BE AN ADMIN USER.
Webfwlog does not need admin rights on MySQL to have full functionality.

If you want to use webfwlog with logged data in a ulogd database, you must
set up ulogd to log data to your MySQL server before you can set up
webfwlog to report on the data.  See the ulogd package for details on setting
up a ulog table.  NOTE: webfwlog can handle internet addresses in ip_saddr and
ip_daddr that are either integers or dotted-quad strings saved using the 
--with-mysql-log-ip-as-string option of ulogd.  However, better performance
with webfwlog will be achieved if ip addresses are stored as integers.
Also, you should run ANALYZE TABLE on your ulog table periodically to
improve performance.

DATA LAYOUT CONSIDERATIONS

The recommended data layout is to have the webfwlog tables stored in a
separate database.  You can use the setup script to create new webfwlog tables
in their own database, which will be created if it does not exist, and can also
use it to copy existing webfwlog tables to a different database if you are
upgrading or change your mind later.

It is also recommended to have the ulog table in its own database.  You can
use the setup script to copy your ulog table to a different database, or to
create a new ulog table with a different name in the same database.  The
existing ulog table will not be dropped so you will need to do this manually
if you no longer need the old ulog table.

You should back up your data before copying your tables.
