Forum OpenACS Development: OpenHosting Installation steps for OpenACS 5.1.5 and Postgresql 7.4.10 (FC4)
Thanks to daveb for assistance.
# OpenHosting Installation for use on OpenHosting VPS server running Fedora Core 4. # ver. 0.0.1 # Last Modified: Dec 21, 2005 # Author: Ryan Gallimore (rgallimore@viscousmedia.com) # # This is UNSTABLE. # # Rebuild your server from the control panel. set OPENACS_SERVICE_NAME=service1 export $OPENACS_SERVICE_NAME # PostgreSQL 7.4.10 su service postgresql stop yum remove postgresql cd /tmp wget http://easynews.dl.sourceforge.net/sourceforge/pgsql/postgresql-7.4.10.tar.bz2 tar xjvf /tmp/postgresql-7.4.10.tar.bz2 groupadd web useradd -g web -d /usr/local/pgsql postgres mkdir -p /usr/local/pgsql chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.4.10 chmod 750 /usr/local/pgsql su - postgres cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql exit chown root.root /etc/rc.d/init.d/postgresql chmod 755 /etc/rc.d/init.d/postgresql service postgresql stop chkconfig --add postgresql chkconfig --level 345 postgresql on chkconfig --list postgresql service postgresql start ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib ln -s /var/lib/pgsql /usr/local/pgsql ln -s /usr/bin /usr/local/pgsql/bin su - postgres createuser -a -d $OPENACS_SERVICE_NAME exit su - $OPENACS_SERVICE_NAME /usr/local/pgsql/bin/createdb -E UNICODE $OPENACS_SERVICE_NAME # Tcl yum remove tcl cd /usr/local/src wget http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.7-src.tar.gz tar xfz tcl8.4.7-src.tar.gz cd tcl8.4.7/unix ./configure --enable-threads make install # AOLServer cd /usr/local/src mkdir aolserver40r8 cd aolserver40r8 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co -r aolserver_v40_r8 aolserver cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nscache cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nspostgres cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nssha1 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co -r v2_7 nsoracle cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsxml wget http://www.tdom.org/tDOM-0.7.8.tar.gz tar xvfz tDOM-0.7.8.tar.gz in nsd/conn.c Line 843: result = Tcl_GetObjResult(interp); - connPtr = (Conn *) conn = itPtr->conn; + connPtr = conn = (Conn *) itPtr->conn; in nsd/unix.c comment out line 74 //pthread_kill_other_threads_np(); cd /usr/local/src/aolserver40r8/aolserver ./configure --prefix=/usr/local/aolserver40r8 --with-tcl=/usr/local/lib/ make install ln -s /usr/local/aolserver40r8 /usr/local/aolserver cd /usr/local/src/aolserver40r8/nscache make install cd ../nspostgres/ make install POSTGRES=/usr/local/pgsql ACS=1 INST=/usr/local/aolserver40r8 cd ../nssha1/ make make install cd ../tDOM-0.7.8/unix ../configure --enable-threads --disable-tdomalloc --prefix=/usr/local/aolserver40r8 --with-tcl=/usr/local/lib make install cd /usr/local/aolserver40r8/bin cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres chmod 755 nsd-postgres # OpenACS groupadd web useradd -g web $OPENACS_SERVICE_NAME mkdir /var/lib/aolserver chown -R $OPENACS_SERVICE_NAME /var/lib/aolserver chgrp -R web /var/lib/aolserver chmod -R 770 /var/lib/aolserver su - $OPENACS_SERVICE_NAME cd /tmp wget https://openacs.org/projects/openacs/download/download/openacs-5.1.5.tar.gz cd /var/lib/aolserver tar xzf /tmp/openacs-5.1.5.tar.gz mv /tmp/openacs-5.1.5 $OPENACS_SERVICE_NAME chmod -R 755 $OPENACS_SERVICE_NAME chown -R $OPENACS_SERVICE_NAME.web $OPENACS_SERVICE_NAME exit cd / ln -s /var/lib/aolserver/$OPENACS_SERVICE_NAME # Copy config files: # emacs /$OPENACS_SERVICE_NAME/etc/config.tcl # 1. edit hostname and address # 2. change homedir to /usr/local/aolserver40r8 # 3. change bindir to /usr/local/aolserver40r8/bin # We have to do this or libpq.so and nspostgres throws an error # and the db load fails. mv /usr/lib/libpq.so.4 /usr/lib/libpq.so.3 # Copy the init.d script to /etc/init.d/: # Adjust calls to service1 to your $OPENACS_SERVICE_NAME #!/bin/sh # # Start the AOLServer HTTP server. # NAME="OpenACS on service1" SERVICEPATH=/var/lib/aolserver/service1 PATH=/bin:/usr/bin:/sbin:/usr/sbin trap "" 1 start() { echo -n "Starting web server: $NAME" echo -e -n "\r" # give time for Postgres to come up sleep 2 exec /usr/local/aolserver/bin/nsd -it $SERVICEPATH/etc/config.tcl -u service1 -g web -b 1.2.3.4:80 & # For AOLserver 4 using privileged ports (usually < 1024), add the flag # -b youraddress:yourport echo "" } stop() { echo -n "Stopping web server: $NAME" killall nsd echo "" } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 2 start ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart}" exit 1 ;; esac echo -n -e "\c\r\n" exit 0 # End of openacs init.d script chmod u+x openacs-$OPENACS_SERVICE_NAME # avoid pid not found errors in the log chown root:web /usr/local/aolserver/log chmod 775 /usr/local/aolserver/log # Set openacs to start on boot # chkconfig --add openacs-service1 # chkconfig openacs-service1 on # # This fails with an 'openacs-service1 does not support chkconfig' Any ideas?
# for use on OpenHosting VPS server running Fedora Core 4
# (www.openhosting.com)
#
# ver. 0.0.3
# Last Modified: March 5, 2006
# Author: Ryan Gallimore (mailto:rgallimore@viscousmedia.com)
#
# This is UNSTABLE.
#
# Rebuild your server from the control panel.
emacs /etc/profile
# add:
export OPENACS_SERVICE_NAME=[your service name]
# OpenACS
groupadd web
useradd -g web $OPENACS_SERVICE_NAME
mkdir /var/lib/aolserver
chown -R $OPENACS_SERVICE_NAME /var/lib/aolserver
chgrp -R web /var/lib/aolserver
chmod -R 770 /var/lib/aolserver
su - $OPENACS_SERVICE_NAME
cd /tmp
wget https://openacs.org/projects/openacs/download/download/openacs-5.1.5.tar.gz?revision_id=271916
cd /var/lib/aolserver
tar xzf /tmp/openacs-5.1.5.tar.gz?revision_id=271916
mv openacs-5.1.5/ $OPENACS_SERVICE_NAME
chmod -R 755 $OPENACS_SERVICE_NAME
chown -R $OPENACS_SERVICE_NAME.web $OPENACS_SERVICE_NAME
exit
cd /
ln -s /var/lib/aolserver/$OPENACS_SERVICE_NAME
# PostgreSQL 7.4.10
su
service postgresql stop
yum remove postgresql
exit
cd /tmp
wget http://easynews.dl.sourceforge.net/sourceforge/pgsql/postgresql-7.4.10.tar.bz2
cd /usr/local/src
tar xjvf /tmp/postgresql-7.4.10.tar.bz2
useradd -g web -d /usr/local/pgsql postgres
mkdir -p /usr/local/pgsql
chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.4.10
chmod 750 /usr/local/pgsql
su - postgres
cd /usr/local/src/postgresql-7.4.10
./configure --without-readline --without-zlib
make all
make install
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
createlang plpgsql template1
createlang -l template1
createuser -a -d $OPENACS_SERVICE_NAME
exit
ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib
ln -s /var/lib/pgsql /usr/local/pgsql
ln -s /usr/bin /usr/local/pgsql/bin
echo "export LD_LIBRARY_PATH=/usr/local/pgsql/lib" >> ~postgres/.bash_profile
echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bash_profile
su - $OPENACS_SERVICE_NAME
/usr/local/pgsql/bin/createdb -E UNICODE $OPENACS_SERVICE_NAME
exit
# Set postgres to start on boot
cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
chown root.root /etc/rc.d/init.d/postgresql
chmod 755 /etc/rc.d/init.d/postgresql
service postgresql stop
chkconfig --add postgresql
chkconfig --level 345 postgresql on
chkconfig --list postgresql
service postgresql start
# Tcl
yum remove tcl
cd /usr/local/src
wget http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.7-src.tar.gz
tar xfz tcl8.4.7-src.tar.gz
cd tcl8.4.7/unix
./configure --enable-threads
make install
mv /usr/local/bin/tclsh8.4 /usr/local/bin/tclsh
# AOLServer
cd /usr/local/src
mkdir aolserver40r8
cd aolserver40r8
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co -r aolserver_v40_r8 aolserver
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nscache
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nssha1
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co -r v2_7 nsoracle
cvs -z3 -d:pserver:mailto:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsxml
wget http://www.tdom.org/tDOM-0.7.8.tar.gz
tar xvfz tDOM-0.7.8.tar.gz
in aolserver/nsd/conn.c
Line 843:
result = Tcl_GetObjResult(interp);
- connPtr = (Conn *) conn = itPtr->conn;
+ connPtr = conn = (Conn *) itPtr->conn;
in aolserver/nsd/unix.c
comment out line 74
//pthread_kill_other_threads_np();
cd /usr/local/src/aolserver40r8/aolserver
./configure --prefix=/usr/local/aolserver40r8 --with-tcl=/usr/local/lib/
make install
ln -s /usr/local/aolserver40r8 /usr/local/aolserver
cd /usr/local/src/aolserver40r8/nscache
make install
cd ../nspostgres/
make install POSTGRES=/usr/local/pgsql ACS=1 INST=/usr/local/aolserver40r8
cd ../nssha1/
make
make install
cd ../tDOM-0.7.8/unix
../configure --enable-threads --disable-tdomalloc --prefix=/usr/local/aolserver40r8 --with-tcl=/usr/local/lib
make install
cd /usr/local/aolserver40r8/bin
cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
chmod 755 nsd-postgres
# Copy config files:
# emacs /$OPENACS_SERVICE_NAME/etc/config.tcl
# 1. edit hostname and address
# 2. change homedir to /usr/local/aolserver40r8
# 3. change bindir to /usr/local/aolserver40r8/bin
# We have to do this or libpq.so and nspostgres throws an error
# and the db load fails.
# Search for libpq.so and copy it to /usr/lib/libpq.so.3
# e.g mv /usr/lib/libpq.so.4 /usr/lib/libpq.so.3
# Copy the init.d script to /etc/init.d/:
#!/bin/sh
#
# chkconfig: 2345 99 03
# description: Start the VM Demo OpenACS Server.
#
OPENACS_SERVICE_NAME=vmdemo
NAME="OpenACS on $OPENACS_SERVICE_NAME"
SERVICEPATH=/var/lib/aolserver/$OPENACS_SERVICE_NAME
IP=192.168.2.50
PATH=/bin:/usr/bin:/sbin:/usr/sbin
trap "" 1
start()
{
echo -n "Starting web server: $NAME"
echo -e -n "\r"
# give time for Postgres to come up
sleep 2
exec /usr/local/aolserver/bin/nsd -it $SERVICEPATH/etc/config.tcl -u $OPENACS_SERVICE_NAME -g web -b $IP:80 &
# For AOLserver 4 using privileged ports (usually < 1024), add the flag
# -b youraddress:yourport
echo ""
}
stop()
{
echo -n "Stopping web server: $NAME"
killall nsd
echo ""
}
case "$1" in
start)
sleep 3
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
echo -n -e "\c\r\n"
exit 0
# End of openacs init.d script
chmod u+x /etc/init.d/$OPENACS_SERVICE_NAME
# avoid pid not found errors in the log
chown root:web /usr/local/aolserver/log
chmod 775 /usr/local/aolserver/log
# avoid psql not found error
emacs /$OPENACS_SERVICE_NAME/packages/acs-tcl/tcl/00-database-procs.tcl
# Find db_pg_bin proc
# Insert first line: return /usr/local/pgsql/bin
# Set openacs to start on boot
chkconfig --add $OPENACS_SERVICE_NAME
chkconfig $OPENACS_SERVICE_NAME on
# Stop apache permanently
/etc/init.d/httpd stop
chkconfig --del httpd
# Start the server!
/etc/init.d/openacs-base start
# Done!
- use tcl 8.4.12 instead of tcl8.4.7
- use tdom 0.8.0 insted of tdom 0.7.8
- use aolserver 4.0.10 instead of 4.0.8
- nsxml and nsoracle are not used
For the configure of tcl, i would recommend to specify prefix and exec-prefix explicitly, such you can be sure that later configuration steps point to the correct tcl instance. Getting a mix of different tcl-versions can be hard to debug. I use most often a tcl installation within the aolserver/naviserver tree, to be sure not to conflict with with with other software distributions. With aolserver, i use for compiling tcl e.g.
./configure --prefix=/usr/local/aolserver --enable-threads
and /usr/local/aolserver/tcl8.4.12/unix for --with-tcl for all tcl dependent modules.
btw, you could add a wget+install step for xotcl.