For these examples, we assume you've built in: /usr/local/htdb
and that apache's at: /usr/local/apache

Recommended Settings:

	./configure --with-mysql --prefix=/usr/local/htdb

Database Setup:

	1) make sure you've got the mysql database software running
	   somewhere accessible to the web server that's going to be
	   running the HTDB-based CGI applications.

	2) add a new mysql account for user "htdb".
	
	3) reload the grant priviledges

		mysqladmin --user=root reload

	4) create the database tables needed by htdb, using the creation
	   script in doc/htdb/sql/htdb.sql

	   mysql --user=root < /usr/local/htdb/doc/htdb/sql/htdb.sql

FastCGI:

	If you're going to be running a site that does more than a
	handful of pages per minute, you'll want to upgrade your apache
	web server to include mod_fastcgi (download from fastcgi.com).
	If you're just playing around, and can accept the performance penalty
	of running in stand-alone cgi mode, do it.  It makes for
	a simpler installation.

	1) If you choose to use FastCGI includethe following in the "./configure" line.

	   --with-libfcgi=PATH_TO_LIBFCGI

Compiling:

	1) make

	2) sudo make install

Configuring HTDB:

	1) in /usr/local/htdb/etc/config.htdb, place the mysql username/passwords
	   created above into the appropriate places
	   (confDatabase[*]->username & confDatabase[*]->password)

	   NOTE: there are several other settings in the etc/config.htdb
	   file that you may want to change -  look for occurrences of
	   "**CHANGE ME**", and act accordingly!

	2) make the core htdb script and config files available to the webserver.

	   for instance, if the apache root directory is "/usr/local/apache", then..

		mkdir /usr/local/apache/htdb
		ln -s /usr/local/htdb/etc/*.htdb /usr/local/apache/htdb
		ln -s /usr/local/htdb/doc/htdb/examples/*.htdb /usr/local/apache/htdb

		make sure that this new directory and its contents are
		of permissions such that the web server can access them.

		(you may want to copy, not just link these files if you intend to do
		much editing of the distribution scripts)

Configuring Apache:

	1) see the code example in /usr/local/htdb/doc/htdb/primers/httpd.conf
	   copy and edit paths to suit your environment

	2) HUP your webserver

Did it work?

	using a web browser, access the URL:
		http://localhost:/htdb
	(substitute localhost for wherever you installed htdb)

Yes?

	play around with the .htdb files in /usr/local/apache/htdb
	look at everything in /usr/local/htdb/doc
	especially /usr/local/htdb/doc/htdb/primers/language_primer.txt

No?

	does it run from the command line?

	/usr/local/htdb/bin/htdb /usr/local/apache/htdb

	it may be that it cannot talk to the database - debug things in this order:

		* make sure that /usr/local/apache/htdb exists; & permissions are good
		* look inside /usr/local/apache/htdb/config.htdb and make sure that
		  all paths are sane, and that the database username and password
		  match the mysql account you set up
		* HUP the database - maybe the account didn't get picked up
		* send me email!

Fri Jan 20 13:08:38 PST 2006
del@adjective.com
