$Id: README 643 2016-08-03 22:40:45Z bhockney $
(C) 2003-2016 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 and may be needed when you 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 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, 5.x or
later.  All production versions of MariaDB are also supported transparently.
Webfwlog has full IPv6 support, which requires MySQL 5.0 or later for database
logs.  MySQL uses a data type of varbinary(16) to support IPv6, but does not
include functions to convert between human-readable and binary addresses.  This
distribution includes functions to do this in both shared library (UDF) and
stored procedure form.  Using stored procedures requires MySQL 5.0 or later,
and using UDF's requires superuser privileges on the host running the MySQL
server.  See the INSTALL file for more information.

Using webfwlog with snort database logs requires MySQL 5.0 or later.  

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 database logs, you must set up your logging
program to log data to your MySQL server before you can set up webfwlog
to report on the data.  See the documentation for your logging program for
details on setting up your server to log data.  This distribution includes
support for database log formats for ulog, ulog2 and snort; other formats can
be used with a view mapping the columns and data types webfwlog expects,
which are based on those used by ulogd. See the mysql_data_table.sql file for
the required layout. MySQL 5.0 or later is required to use views.

You should run ANALYZE TABLE on your database tables 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.
