Setup of Database and Java on www.maytech.net

This document describes the work carried out on 11/2/99-17/2/99 on www.maytech.net to install PostgreSQL 6.4.2, WebMacro and Apache 1.3.3.

PostgreSQL 6.4.2

Downloaded postgresql-6.4.2.tar.gz from ftp://ftp.postgresql.org/pub/ into /usr/src. Uncompressed and untarred it and renamed the resulting directory /usr/src/pgsql.

Created a postgres superuser (username:postgres, password:overTheMoon).

Followed INSTALL instructions in /usr/src/pgsql/INSTALL and used their defaults (i.e. installed the system to /usr/local/pgsql).

In step 22 of the INSTALL notes, I put the startup script in /etc/rc.d/rc.postgres rather than /etc/rc.d/init.d/postgres.init. I also updated rc.M to call rc.postgres.

JDK 1.1.7

Installed jdk-1.1.7-v1a from Blackdown. I downloaded the tar file, jdk_1.1.7-v1a-libc5-x86.tar.gz, into /usr/src and unpacked it into /usr/local/jdk117_v1a. I made a link from /usr/local/java to /usr/local/jdk117_v1a and soft links from /usr/local/bin to each member of /usr/local/java/bin . I set the CLASSPATH (in /etc/profile) to point to /usr/local/java/lib/classes.zip.

JSDK 2.0

Got jsdk20-solaris2-sparc.tar.gz from JavaSoft and put it in /usr/src and unpacked it into /usr/local/jsdk. Added /usr/local/jsdk/lib/jsdk.jar to the CLASSPATH.

JServ 1.0b1

Got apace-jserv-1.0b1.tar from Apache and put it in /usr/src.

At this point I had to install Apache 1.3.3 to get JServ to install.

Apache 1.3.3

Downloaded apache_1.3.3.tar from Apache and put it in /usr/src/. Untarred it there are followed the INSTALL instructions.

Apache can be configured to place its directories in places other than the defaults. The following table lists the default installation paths of Apache's (1.3.3) directories, along with a list of which of these directories already existed (from the 1.2.4 installation) and where they were placed:

DEFAULTS (PREFIX is /var/lib/httpd)  VALUES IN OLD (1.2.4) VERSION
========                             =============================
bindir = PREFIX/bin                  (none of these programs were installed)
sbindir = PREFIX/sbin                (only httpd in this dir was installed, and it was in /usr/sbin/)
libexecdir = PREFIX/libexec          (not installed under 1.2.x) 
mandir = PREFIX/man                  (installed in /usr/man/)
sysconfdir = PREFIX/etc              (installed in /var/lib/httpd/conf/)
datadir = PREFIX/share               (installed in /var/lib/httpd/)
includedir = PREFIX/include          (not installed under 1.2.x ???)
localstatedir = PREFIX/var           (no equivalent in 1.2.x ???)
runtimedir = PREFIX/var/run          (installed in /var/run)
logdiledir = PREFIX/var/log          (installed in /var/lib/httpd/logs/)

I configured Apache 1.3.3 to use the same directories as the previous installation if they existed (with the exception of sbindir. See below). The other directories (bindir, libexecdir, includedir, localstatedir) were created in their default place (i.e. under /var/lib/httpd).

Note that I did not set sbindir either so the installation created a sbin under /var/lib/httpd containing httpd. /var/lib/httpd/sbin/httpd is the path to the current httpd! Without creating this new sbindir JServ cannot detect the correct DSO components.

In short, I configured Apache with

./configure --prefix=/var/lib/httpd
	    --enable-module=most
	    --enable-shared=max
	    --mandir=/usr/man
	    --sysconfdir=/var/lib/httpd/conf
	    --datadir=/var/lib/httpd
	    --runtimedir=/var/run
	    --logfiledir=/var/lib/httpd/logs

I then ran make to build the package and make install to install it.

This installed the new directories mentioned above.

I altered /etc/rc.d/rc.httpd to be the start/stop script distributed with Apache 1.3.3 (see /var/lib/httpd/sbin/apachectl to view this script).

JServ 1.0b1 Cont.

I configured JServ with

./configure --with-jsdk=/usr/local/jsdk
	    --with-apache-install=/var/lib/httpd
	    --mandir=/usr/man
	    --sysconfdir=/etc/httpd/conf
	    --datadir=/home/httpd 

I then ran make to build the package and make install to install it. This installed documentation and library files under /usr/local/jserv.

Copied the following files from the src directory of the Apache-JServ distribution into /var/lib/httpd/conf and editted them:

I have made many changes (such as the number of servers spawned, etc) to /var/lib/httpd/conf/httpd.conf which you might like to review. I renamed the old versions of the conf files to *.conf.ver1.2. The *.default files were installed as part of Apache 1.3.3.

The installation set up an 'example' zone with one servlet: 'Hello'.

Webmacro 0.75.3

Downloaded webmacro.0.75.3.tgz from Webmacro.org into /usr/src. I uncompressed and untarred it and put the resulting directory in /usr/local/webmacro.

I altered /var/lib/httpd/conf/jserv.properties to define a new zone 'webmacro' and copied examples.properties (in the same dir) to webmacro.properties with suitable alterations. I altered /usr/local/webmacro/examples/WebMacro.properties to point to the correct template directory and to point errors to the Apache log directory (/var/lib/httpd/logs/webmacro.log).

Postgres JDBC drivers

This is distributed with the Postgres system. I followed the README in the src/interfaces/jdbc, viz make the stuff and put the resulting postgresql.jar in /usr/local/pgsql and add it to the CLASSPATH. I then did make examples to test the connection and all worked when I issued the command java example.basic jdbc:postgresql:web web bollocks (I had previously logged in as postgres and ran createuser to create the web user and ran createdb to create a database). The first 'web' is the name of the database (create your own) and the second 'web' is the (postgres) username. Always use the web database (unless you want your own).

CLASSPATH

Set CLASSPATH=.:/usr/local/java/lib/classes.zip:/usr/local/jsdk/lib/jsdk.jar:
/usr/local/webmacro/webmacro.jar:/usr/local/postgres/postgresql.jar