AOLserver

 
The following is a script that installs you AOLserver 4.5 along with all necessary modules.
You can download a reviewed version here. Thanks a lot to Miguel Cardova for this excellent script review and the enhancements.
Make sure you installed PostgreSQL or Oracle FIRST!
This script assumes a DEBIAN / UBUNTU environment. It has been tested though under Redhat and fedora as well as OS X. Just use different commands. Use "apt-get" on debian/ubuntu, use YUM on redhat, install Developer Tools on "OS X".
Also make sure you have a compiler environment available along with a mailer daemon. :

apt-get install postfix imagemagick graphviz gcc patch subversion make unzip zip libbz2-dev zlib1g-dev cvs build-essential bin86
# yum install postfix ImageMagick
# Solaris
# pkg-get -i postfix imagemagick cvs graphviz "postgresql"

 Additionally make sure you can use "make". If you cannot, try "gmake". Though the line above should install make :-). 

Preparation
Run this script as root 

sudo su -
# Set the UMASK so permissions are more open
umask 022
# Which make to use
if test "x`which gmake`" = "x"; then
if test "x`which make`" = "x"; then
echo "Cannot find make or gmake on search path $(PATH)"
echo "Please install (g)make before continuing!"
exit -1
else
make="make"
fi
else
make=gmake
fi
# Which tar to use
if test "x`which gtar`" = "x"; then
tar=tar
else
tar=gtar
fi
# Test which wget to use
if test "x`which wget`" = "x"; then
if test "x`which curl`" = "x"; then
echo "Cannot find wget on search path $(PATH)"
echo "Please install wget before continuing!"
exit -1
else
wget="curl -L -O"
fi
else
wget=wget
fi
# Versions to use
TCL=tcl8.5.8
XoTCL=1.6.6
TCLLIB=1.12
# Path for the AOLserver installation
NS=/usr/lib/aolserver4
# Path for Postgres. Change it if you did not install PG according to our instructions for PostgreSQL 8.2
PG=/usr/local/pg82
# optional packages
INSTALL_VTMALLOC=0
INSTALL_DQD_UTILS=0
INSTALL_DAEMONTOOLS=1
INSTALL_TRF=1
INSTALL_SSL=0
SSL_PATH=/usr/lib/ssl

Get files
First clean your old AOLserver installation and get all the files

rm -rf ${NS}
rm -rf /usr/local/src/aolserver45
mkdir -p /usr/local/src/aolserver45
cd /usr/local/src/aolserver45
# Get all the files
$wget http://downloads.sourceforge.net/tcl/${TCL}-src.tar.gz
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co aolserver
echo "Getting aolserver modules ..."
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nssha1
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co -r v2_7 nsoracle
echo "Getting TDOM ..."
$wget http://www.tdom.org/files/tDOM-0.8.2.tgz
echo "Getting TCL modules ..."
$wget http://downloads.sourceforge.net/tcllib/tcllib-${TCLLIB}.tar.bz2
$wget http://downloads.sourceforge.net/tcl/thread2.6.5.tar.gz
$wget http://media.wu-wien.ac.at/download/xotcl-${XoTCL}.tar.gz
$wget http://www.pragana.net/tclmagick-simple-build.tar.gz
cvs -d :pserver:anonymous@cvs.openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/nsd-postgres.txt

Install TCL

$tar xfz ${TCL}-src.tar.gz
if test "${INSTALL_VTMALLOC}" = "1"; then
cd ${TCL}
cvs -z3 -d:pserver:anonymous@naviserver.cvs.sourceforge.net:/cvsroot/naviserver co vtmalloc
mv generic/tclThreadAlloc.c generic/tclThreadAlloc.c-orig
cp vtmalloc/tclThreadAlloc.c generic/
fi
cd ${TCL}/unix
./configure --enable-threads --prefix=${NS}
$make install

Compile AOLserver 
Install AOLserver and patch it for background delivery. 
Ignore all "ranlib: '....../lib....a': No such file" errors.

cd /usr/local/src/aolserver45/aolserver
$wget http://www.cognovis.de/aolserver45-driver.patch
patch -p0 <aolserver45-driver.patch
${NS}/bin/tclsh8.5 ./nsconfig.tcl
$make -i install
# Compile nsproxy
cd nsproxy
make install
# Remove the symbolic link to aolserver.
# If this is not a symbolic link but the full path to your aolserver
# Make sure it becomes a symbolic link by issuing
# mv /usr/local/aolserver /usr/local/aolserver<yourversion>
rm /usr/local/aolserver
ln -s ${NS} /usr/local/aolserver
# Install nssha1
cd /usr/local/src/aolserver45/nssha1
$make install NSHOME=${NS}

Prepare PostgreSQL integration

cd /usr/local/src/aolserver45
cp openacs-4/packages/acs-core-docs/www/files/nsd-postgres.txt ${NS}/bin/nsd-postgres
chmod 755 ${NS}/bin/nsd-postgres
cd nspostgres
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PG}/lib
$make install POSTGRES=${PG} ACS=1 NSHOME=${NS}

Install tdom
Note, if you use bash31 you need to apply a patch. See http://openacs.org/forums/message-view?message_id=369867 for details

For 64 bit systems append "--enable-64bit"
 

cd /usr/local/src/aolserver45/

tar xvfz tDOM-0.8.2.tgz
cd tDOM-0.8.2/unix
../configure --enable-threads --disable-tdomalloc --prefix=${NS} --exec-prefix=${NS} --with-aolserver=${NS} --with-tcl=/usr/local/src/aolserver45/${TCL}/unix
$make install
You might have to make sure that the pkgindex.tcl actually works. Therefore edit /usr/local/aolserver/lib/tdom0.8.2/pkgindex.tcl and put in a CR before the "load ..."

 
Install TCLlib
 
TCLlib contains mandatory code to work with OpenACS, mainly the mime:: namespace. 
 

cd /usr/local/src/aolserver45
$tar xvfj tcllib-${TCLLIB}.tar.bz2
cd tcllib-${TCLLIB}
./configure --prefix=${NS}
$make install
cd /usr/local/src/aolserver45

Install libthread

$tar xfz thread2.6.5.tar.gz
cd thread2.6.5/unix/
../configure --enable-threads --prefix=${NS} --exec-prefix=${NS} --with-aolserver=${NS} --with-tcl=/usr/local/src/aolserver45/${TCL}/unix
$make
$make install
cd /usr/local/src/aolserver45

Install XOTcl

$tar xvfz xotcl-${XoTCL}.tar.gz
cd xotcl-${XoTCL}/
export CC=gcc
./configure --enable-threads --enable-symbols --prefix=${NS} --exec-prefix=${NS} --with-tcl=/usr/local/src/aolserver45/${TCL}/unix
$make
$make install-aol
cd /usr/local/src/aolserver45

Install tclmagick

cd ${NS}/lib
tar xfz /usr/local/src/aolserver45/tclmagick-simple-build.tar.gz
cd /usr/local/src/aolserver45
 
 

Install TRF
for faster base encoding.

if test "${INSTALL_TRF}" = "1"; then
echo "Getting TRF ..."
cvs -z3 -d:pserver:anonymous@tcltrf.cvs.sourceforge.net:/cvsroot/tcltrf co -P trf
cd trf/
./configure --enable-threads --enable-symbols --prefix=${NS} --exec-prefix=${NS} --with-tcl=/usr/local/src/aolserver45/${TCL}/unix
$make
$make install
cd /usr/local/src/aolserver45
fi

Install TLS and OpenSSL
 
for https. assuming that OpenSSL is installed an available under /usr/local/ssl

if test "${INSTALL_SSL}" = "1"; then
wget http://downloads.sourceforge.net/tls/tls1.5.0-src.tar.gz
$tar xzpf tls1.5.0-src.tar.gz
cd tls1.5
./configure --with-ssl-dir=/usr --with-tcl=${NS}/lib --enable-threads --enable-shared --prefix=${NS} --exec-prefix=${NS}
$make install
cd /usr/local/src/aolserver45
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nsopenssl
cd nsopenssl
$make install OPENSSL=${SSL_PATH} AOLSERVER=${NS}
cd /usr/local/src/aolserver45
fi

Install dqd Utils
 
This is optional

if test "${INSTALL_DQD_UTILS}" = "1"; then
$wget http://dqd.com/~mayoff/aolserver/dqd_utils-1.7.tar.gz
export INST=${NS}
$tar xzf dqd_utils-1.7.tar.gz
cd dqd_utils-1.7
$make install
cd /usr/local/src/aolserver45
fi

Daemontools
This is optional as some distro's don't like it, though you should use it! 

if test "${INSTALL_DAEMONTOOLS}" = "1"; then
mkdir -p /package
chmod 1755 /package
cd /package
$wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
$wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno....
$tar xvfz daemontools-0.76.tar.gz
cd admin/daemontools-0.76
patch -Np1 -i ../../daemontools-0.76.errno.patch
package/install
cvs -d :pserver:anonymous@cvs.openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/svgroup.txt
mv openacs-4/packages/acs-core-docs/www/files/svgroup.txt /usr/sbin/svgroup
chmod 700 /usr/sbin/svgroup
fi

TCL Webtest

cd /usr/local/src/aolserver45
 
# get the full release form sourceforge
$wget http://downloads.sourceforge.net/tclwebtest/tclwebtest-1.0.tar.gz
$tar zxf tclwebtest-1.0.tar.gz
# get a patched version, which is often more than 70 times faster...
$wget http://media.wu-wien.ac.at/download/tclwebtest.tcl
# install it
mkdir -p ${NS}/lib/tclwebtest
cp tclwebtest-1.0/lib/* ${NS}/lib/tclwebtest/
cp tclwebtest.tcl ${NS}/lib/tclwebtest