README FOR WWW-SQL
==================

This file only gives tips on compilation and installation, and a pointer to
the real documentation.  This program is a CGI program that preprocesses
HTML files and inserts information received from a MySQL database.  It is
similar to the comercial program W3-mSQL for the mSQL database system, with
the exception being that this is GPL'd, and uses the MySQL engine.

For more complete instructions and documentation of the commands, see
the file www-sql.html.

COMPILATION
===========
This package uses GNU autoconf, so the first thing to try would be typing
./configure.  If you are using PostgreSQL, you will need to add the argument
--with-database=pgsql.

If this program fails, and you are using MySQL, the reason is probably that
it can't find the MySQL.  Assuming you have the MySQL headers and libraries
installed, configure is probably not looking in the right place.  It looks
for libmysqlclient in the default library search path and
/usr/local/mysql/lib, and <mysql/mysql.h> in the default header search path,
and /usr/local/mysql/include.  If you have these files in a different place,
you must parse a few arguments to ./configure.

You can pass --with-mysql-headers=dir to set a directory which will allow
the header mysql/mysql.h to be found.  You can also pass --with-mysql-libs=dir
to set the location of the mysqlclient library.

If you are using PostgreSQL, you may have to use the arguments
--with-pgsql-headers=dir and --with-pgsql-libs=dir, which are similar to the
MySQL equivalents.

Now type make.  If compilation fails, it is probably because I haven't added
support for your system.  At present, it should compile without problems
on Linux, but should be easy to port to other systems.  I would like to hear
if it can be compiled on different systems.  If you can, a patch to make it
compile would be aprecciated (my email address is james@daa.com.au).  If you
are going to send me a patch, unified diffs are prefered (diff -u), but
context diffs are OK as well.


INSTALLATION
============
At present the list of detected cgi-bin directories is (in order searched)
  /home/httpd/cgi-bin
  /var/lib/httpd/cgi-bin
  /usr/local/etc/httpd/cgi-bin (this is used if none of the previous are found)
If your cgi-bin directory is located at another standard place, please notify
me so I can modify my configure script.

If your cgi-bin directory matches one of these, you only need to type
make install.  Otherwise, you must add the parameter CGI_DIR=dirname.

Now you must make a default user for www-sql.  For MySQL, use the following
commands:

  mysql -uroot -ppass mysql << EOF
  insert into user (Host, User, Password, Select_priv)
         values ("localhost", "nobody", "", "Y");
  EOF
  mysqladmin -uroot -ppass reload

substituting the correct root password.  This will give www-sql access to
all your databases.  If you want to be more secure, change the "Y" to a
"N" and add records to the db table, to grant access to individual
databases.

For PostgreSQL, run the following command from the shell prompt:
  createuser nobody
Now use the SQL GRANT function to give this user access to the various
PostgreSQL databases.  It is probably a wise decision not to give this user
permission to create databases and users.  Also, be careful what rights you
this user to sensitive tables.

For extra information, see the file www-sql.html.


COPYRIGHT
=========
This program may be distributed under the terms of the FSF's GPL version 2,
or a later version at your option.  Please see the file COPYING for more
information.  The software in the lib directory is from the GNU C library,
and is covered by the copyright in the file COPYING.LIB in that directory.

This software is Copyright (C) 1997 James Henstridge <james@daa.com.au>


