Search · Index

II.3.5 Quick Install of OpenACS

Setup user

Especially for incoming e-mail, each webserver should run with it's own user. We are going to use the service name "service0" throughout this script to denote a couple of things needed to run your webserver "www.service0.com": 

  • username to run the service
  • username in the database
  • database name in postgresql
  • service name for aolserver

First add the unix user:

export SERVICE0=service0
sudo useradd $SERVICE0
sudo mkdir /var/lib/aolserver/$SERVICE0/
sudo chown -R $SERVICE0.web /var/lib/aolserver/$SERVICE0
sudo usermod -g web $SERVICE0
sudo usermod -d /var/lib/aolserver/$SERVICE0 $SERVICE0

Now it is time to prepare the database for the OpenACS System:


Make sure to have PostgreSQL installed 

/usr/local/pgsql/bin/createuser -s $SERVICE0 -U postgres
/usr/local/pgsql/bin/createdb -E UNICODE -U $SERVICE0 $SERVICE0


Make sure to have Oracle installed 

sqlplus system@XE
SQL> create tablespace $SERVICE0
datafile '/usr/lib/oracle/xe/oradata/XE/$SERVICE0.dbf'
size 50M
autoextend on;

SQL> create user $OPENACS_SERVICE_NAME identified by password default tablespace $OPENACS_SERVICE_NAME
SQL> grant connect, resource, ctxapp, javasyspriv, query rewrite to questaims;
SQL> revoke unlimited tablespace from questaims;
SQL> alter user questaims quota unlimited on questaims;
SQL> exit;

After the user is setup, login as this user and get the source files. Furthermore configure the config file.

 sudo su - $SERVICE0 

If you do this directly from OpenACS you can run:

cvs -d :pserver:anonymous@cvs.openacs.org:/cvsroot co -r oacs-5-3 openacs-4

mv openacs-4/* . 

If you want to use SVN you can run

svn co https://svn.cognovis.de/openacs/branches/oacs-5-3 .

If you are working within cognovis and start a new client project do the following

export REPOS=https://svn.cognovis.de/
svn mkdir $REPOS/$SERVICE0 $REPOS/$SERVICE0 $REPOS/$SERVICE0/branches $REPOS/$SERVICE0/tags -m "Creating clientname directory structure"
svn copy $REPOS/openacs/branches/oacs-5-3 $REPOS/$SERVICE0/trunk
svn co $REPOS/$SERVICE0/trunk .
Now you have your checkout, time to configure

cp etc/config.tcl etc/`whoami`.tcl perl -pi*.bak -e "s/service0/`whoami`/g" etc/`whoami`.tcl perl -pi*.bak -e "s/service0/`whoami`/g" etc/daemontools/run perl -pi*.bak -e "s/config/`whoami`/g" etc/daemontools/run

This will get the latest openacs from the current release branch into your service name. If you need certain packages to come from HEAD you can still update them later.

As root make sure the system is under daemontools control:

# Logout to become root again exit sudo ln -s /var/lib/aolserver/$SERVICE0/etc/daemontools /service/$SERVICE0 sudo svgroup web /service/*

You are now configured to start your OpenACS installation on unless some other server has been running there.

If you want to install .LRN issue the following command:

su - $SERVICE0
cp packages/dotlrn/install.xml .
svc -du /service/`whoami`

You can verify that your server is running by looking at /var/lib/aolserver/$SERVICE0/log/error.log

If you want to edit your config files, here is their location

  • /var/lib/aolserver/SERVICE0/etc/SERVICE0.tcl
    This contains the configuration parameters and is usually referred to as "config" file.
  • /var/lib/aolserver/SERVICE0/etc/daemontools/run
    If you made changes to the IP Address and the port you will need to edit this file:
    • add the "-b" switch to match your ip address and port right after "nsd-postgres", before the "-it ..." part

Last but not least make sure incoming E-Mail will work (for a full installation overview look at incoming_email. First add your domain to the virtual_domains in /etc/postfix/main.cf then execute the following commands:

echo "@www.$SERVICE0.com $SERVICE0" >>/etc/postfix/virtual
mkdir /web/$SERVICE0/mail
chown $SERVICE0.web /web/$SERVICE0/mail
postmap /etc/postfix/virtual
/etc/init.d/postfix restart

Now it is time to setup the backup and keepalive correctly. First edit /var/lib/aolserver/$SERVICE0/etc/keepalive/keepalive-config.tcl to include your server.

Then copy /var/lib/aolserver/$SERVICE0/etc/backup.sh to /var/lib/aolserver/$SERVICE0/etc/backup-$SERVICE0.sh and edit it to reflect your environment.

Last but not least login as $SERVICE0 and edit the crontab

su - $SERVICE0
export EDITOR=emacs
crontab -e

File in the following data, replaceing service0 where occuring.


# m h  dom mon dow   command
02 4 * * *           /var/lib/aolserver/service0/etc/backup-service0.sh
*/7 * * * *          /var/lib/aolserver/service0/etc/keepalive/keepalive-cron.sh

Webservices Support (TWiST)

To support webservices there exists the tool called "TWiST". To download and install it onto your server the following steps need to be taken:

cd /var/lib/aolserver/service0/tcl
svn checkout http://twsdl.googlecode.com/svn/tags/twist-0.9.9 twist-0.9.9
mv twist-0.9.9 twsdl

Then you need to edit your config file at /var/lib/aolserver/SERVICE0/etc/SERVICE0.tcl by adding the following in the modules section:

ns_section ns/server/${server}/modules
ns_param twsdl tcl