Installing OpenACS 4.5

References

The main reference that I used to install this CMS is Installing on Unix/Linux.

To install OpenACS you need to have the AOLserver and Postgres installed.
Although both of these applications are available as debs there is version of AOLserver available from OpenACS that has been patched by the OpenACS crew. Therefore rather than install the debian AOLserver I chose to install the version from OpenACS which is found here and is a tar.gz file that is 3.7 MB in size. After looking at the bboard I found that someone had produced debs for the aolserver that included the patches for OpenACS. They are found here and may well be useful to those people running debian on pc's. I have since installed OpenACS on an i86 based pc running debian and didn't have a great deal of success using those packages, so I would recommend just building from the patched source.

From the Unix/linux install guide we see that there are a couple of other packages that are needed to get OpenACS up and running. I installed these packages using apt:

   $apt-get install perl-suid tcl8.3-dev libxml2-dev

Setting up up postgres for OpenACS

The installation document goes through building postgres from source. I chose to just install postgres from apt and use the debian binary of postgres. I also installed postgresql-dev so I would have the headers available if they were needed when compiling the OpenACS patch AOLserver source. The plpgsql language has already been created by default in debian postgres (to see that connect to postgres and run the query "SELECT * FROM pg_language;").

First off I had to create a database user for OpenACS. If the user you are currently logged in as doesn't have createruser privilleges you will have to log in as the postgres user. As I had previously set up postgres to require authentication for users to connect to it I needed to create the nsadmin user with a password and to have it encrypted.

john@squelchy:/var/www/downloads/CMS-source-packages/openacs$ createuser -P -E nsadmin

Enter password for user "nsadmin":

Enter it again:

Shall the new user be allowed to create databases? (y/n) y

Shall the new user be allowed to create more new users? (y/n) y

Password:

CREATE USER

Note: see here for some notes about enabling authentication in postgresql.

The next step was to change the nsd-postgres script so that:

export PATH=$PATH:/usr/lib/postgresql/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/postgresql

Setting Up the aolserver

First unpack the aolserver with openacs patches that we downloaded previously to /usr/local:

   $ cd /usr/src/

   $ sudo tar zxvf /home/john/Downloads/aolserver3.3ad13-oacs1-beta-src.tar.gz

   $ cd aolserver

Then I had to set the nsadmin user on the system.

   $ sudo groupadd nsadmin

   $ sudo groupadd web

   $ sudo useradd -g nsadmin -G web -d /usr/local/aolserver nsadmin

   $ passwd nsadmin

This creates the system user nsadmin and adds them to the nsadmin and web group and sets their home directory as /usr/local/aolserver and then sets a passwd for nsadmin.

The next step was to create nsadmin's home directory.

   $ sudo mkdir -p /web /usr/local/aolserver

   $ sudo chown -R nsadmin.web /usr/local/aolserver /web /usr/src/aolserver

   $ sudo chmod 775 /usr/local/aolserver /web

Now log in as nsadmin and change to the home directory.

   $ su nsadmin

   $ cd

Check what shell nsadmin uses.

   $ echo $SHELL

If you are using the bash shell copy the default bashrc and bash_profile file to nsadmins home directory.

   $ cp /etc/skel/.bash* .


Make sure that the .bash_profile file is set up to include the .bashrc file and the open the .bashrc file in an editor and add the following lines to the bottom of the script.

export PATH="$PATH:/usr/lib/postgresql/bin"

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/postgresql"

Then log out of nsadmin and log back in. You can check whether the variables have been added to your shell with echo $PATH.

Note: That if the env command shows that the shell for the user is .sh rather than bash so when you log in the only file that sh looks for environment variables are /etc/profile and .profile so you have to make sure the environment variables are set in the .profile file in nsadmins home directory. I didn't realise this at first and used the .bash_profile and .bashrc files which you use for the bash shell and then couldn't figure out why the environment variables that I had added as per the installation instructions where not appearing when I used the env command.

Note: For more information on PATH and LD_Library_Path see Rutes Unix Administration manual.

Compiling the AOLserver

   $ cd /usr/src/aolserver

   $ ./conf-clean

   $ echo "postgresql" > conf-db

   $ echo "make" > conf-make

Then edit the pgdriver/makefile and uncomment all the lines in the Debian Linux with deb AOLserver & PostgreSQL section and comment out the other PGLIB and PGINC lines. Make sure that NSINC points to /usr/src/aolserver/aolserver/include/. Also make sure you comment out the lines in the REDHAT section.

Now we can compile aolserver

   $ ./conf

After a bit of time depending on your cpu speed the compilation will finish. Now to test it out.

   $ cd

Edit the sample-config.tcl file so that the httpport points to something other that port 8000 which is my case is used by apache. If you aren't running apache you can leave it as is. Then set the hostname to whatever you hostname is and the address to 127.0.0.1.

set httpport 9000

set hostname sydney.wilderness.org.au

set address 127.0.0.1

Now to start the aolserver using the sample configuration file.

   $ ./bin/nsd -t sample-config.tcl

A few error messages will appear, just press enter and then check that it is working.

   $ lynx localhost:9000

You should be greeted with the default aolserver index.html page.

Stop the aolserver

   $ killall nsd

Now, according to the installation manual, it was time to get the Open ACS software up and running.

Installing OpenACS

First step was to download the OpenACS software which is a 7292 KB tar.gz package found here. I chose to install the latest OpenACS which was 4.5, which was why I had installed aolserver 3.3 rather than 3.2. I downloaded the package to /tmp.

Create a /web directory that is owned by nsadmin and untar the source there.

   $ cd /web

   $ tar zxvf /tmp/openacs-4-5-release.tgz

   $ mv openacs-4 openacs

Create a database for openacs

   $ createdb openacs

Then download the nsd-postgres script into /tmp/ and then copy the script to ./bin/nsd-postgres and make it executable.

   $ cp /tmp/nsd-postgres.txt bin/nsd-postgres

   $ chmod 700 bin/nsd-postgres

Then edit the script so that the PATH and LD_LIBRARY_PATH just point to $PATH and $LD_LIBRARY_PATH respectively as we have already set the correct environment variables in the shell.

Now we have to configure the aol server.

Downloaded the openacs4.tcl.txt to /tmp. I then changed this script to set the database that I was using, postgres and also entered the password for nsadmin as I was requiring authentication to access the postgres database. I then set the httpport to 9000 as the default port of 8000 was already being used by apache.

I then set the:

hostname: www.habbers.com

address: 203.53.14.43

server: openacs

db_name: openacs

servername: habbers

Ok after a lot of stuffing around trying to connect I realised, courtesy of turning the debugging on and looking at the log/openacs-error.log, that I didn't compile the postgres driver in when I first built the aolserver. I had to delete everything in /usr/local/aolserver and recompile.

The next problem was that I that nsadmin wouldn't authenticate. To fix that quickly I had to change the pg_hba.conf to let users on the localhost connect without a password. As this will break the Bricolage Content Management System that I have installed I will have to either figure out how to get the AOL server to successfully authenticate nsadmin, which authenticates fine using psql openacs or edit the pg_hba.conf file so nsadmin isn't required to authenticate. Ok to fix the authentication issue so that authentication was required for the bric but not openacs I had to edit the /etc/postgresql/pg_hba.conf file to include the following lines in the file

local openacs trust

local all md5

and comment out the default out the default authentication line

local all ident sameuser

Note That the "local openacs trust" line should be in front of the "local all md5" line.

I then saved the file and restarted postgres and then restarted the aolserver

   $ su

   # /etc/init.d/postgresql restart

   # exit

   $ ./bin/nsd-postgres -t openacs4.tcl

Finally when I entered localhost:9000 in my browsers URL the Installer OpenACS page was loaded. I read the instructions and then clicked on next.

The first step was to install the kernel data into the openacs database.

To do that was as simple as just clicking on create and after a little bit the OpenACS kernel data was installed.

I then clicked on next to install the OpenACS core services.

I then had to create a system-wide admin, enter some user details and Open ACS was installed. Now to do some tweaking so that it runs as a daemon and to set up backups and fine tune postgres.