The Toolkit for Online Communities
16679 Community Members, 1 member online, 2377 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : Install OpenACS on Debian with apt-get

Forum OpenACS Development: Install OpenACS on Debian with apt-get

Icon of envelope Request notifications

Posted by Ryan Gallimore on
I've tested this install on several systems and it makes the debian setup very easy:
# PostgreSQL
apt-get install postgresql postgresql-dev postgresql-doc
ln -s /usr/include/postgresql/ /usr/include/pgsql
ln -s /var/lib/postgres /usr/local/pgsql
ln -s /usr/include/pgsql /usr/local/pgsql/include
su postgres -c "/usr/lib/postgresql/bin/createlang plpgsql template1"
su postgres -c "createuser -a -d service1"
su postgres -c "createdb -E UNICODE service1"

# AOLServer
apt-get install aolserver4 aolserver4-nspostgres aolserver4-nssha1 aolserver4-nscache tdom

# OpenACS
useradd service1
groupadd web
mkdir /var/lib/aolserver
chown service1 /var/lib/aolserver
chgrp web /var/lib/aolserver
chmod 770 /var/lib/aolserver

su - service1
cd /tmp
wget http://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 service1
chmod -R 755 service1
chown -R service1.web service1

# Edit etc/config.tcl according to install docs

# Set openacs to start on boot

Hope this helps someone!
Posted by Jade Rubick on
Ryan: is this on Debian stable? Which version of Debian?
Posted by Alex Kroman on
This is actually how I've been setting up AOLServer at IBR. It only works on Debian Sarge.
Posted by Ryan Gallimore on
This worked for me on Debian Sarge stable only.
I followed your instructions for apt-get install aolserver4 but need more details on how to configure aolserver. The path is different from the current docs.

it installed at: /usr/lib/aolserver4
there was not log or /server/server1 folders so i created them and did chown and chmod on them
i edited the /usr/lib/aolserver4/bin/nsd-postgres to reflect the change from /usr/local/aolserver4 as follows:

export PATH=$PATH:/usr/local/pgsql/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib:/usr/lib/aolserver4/lib

exec /usr/lib/aolserver4/bin/nsd $*
I did the following:
cd /usr/lib/aolserver4/bin
cp /var/lib/aolserver/service1/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
chmod 755 nsd-postgres
I'm using the dotlrn-2.1.3.tar.gz instead of the openacs-5.1.5.tar.gz I wonder if there are some differences in the service1/packages/acs-core-docs/www/files/nsd-postgres.tx files?
i did: exec /usr/lib/aolserver4/bin/nsd-postgres -it /var/lib/aolserver/service1/etc/config.tcl -u service1 -g web -b myipaddress:8000 (where myipaddress had the actual ipadrees) AND It started the aolserver...it let me configure a new instance...yeah!

i'm interested in any comments and suggestions.

Posted by Jade Rubick on
Ryan, you rock. Would you mind putting this in the Wiki?


Posted by Matthew Geddert on

Thanks a lot for this! I had a bear of a time compiling aolserver with the sarge version of debian-amd64 (the name of the distribution that works for amd64 processors as well as xeon's with 64 bit extensions). This made it trivial, which is very, very nice indeed.

People that care about security might want to add aolserver4-nsopenssl to their list of packages to install or run:

apt-get install aolserver4-nsopenssl

A note about the configuration that is different from the docs, since aolserver is installed in /usr/lib/aolserver4 you need to change:

  • "homedir" in etc/config.tcl to /usr/lib/aolserver4
  • when you move nsd-postgres you need to move it to /usr/lib/aolserver4/bin instead of /usr/local/aolserver/bin. You also need to change the last line of that file to:
    exec /usr/lib/aolserver4/bin/nsd $*
  • If you use daemontools to keep aolserver alive you need to change etc/daemontools/run to exec /usr/lib/aolserver4/bin/nsd-postgres instead of exec /usr/local/aolserver/bin/nsd-postgres

Lastly, nslog attempts to create a ${homedir}/log/nspid.service1 the apt-get install does not create this log directory. So in order to remove those errors you should:

mkdir /usr/lib/aolserver4/log
chown root:web /usr/lib/aolserver4/log
chmod 775 /usr/lib/aolserver4/log
Posted by Nick Carroll on
You might also want to use runit instead of daemontools. I've had problems using apt-get to install daemontools, and have found that runit is a worthy replacement.

root$ apt-get install runit
root$ mkdir -p /service
root$ cd /service
root$ ln -s /var/lib/aolserver/service1/etc/daemontools/ service1
root$ runsvctrl up /service/service1

Posted by Ryan Gallimore on
Nick: this looks interesting and I followed your directions but received this error:
$ runsvctrl up /service/service1
runsvctrl: warning: /service/service1: unable to open supervise/control: file does not exist
Am I missing a file somewhere? Thanks
Posted by Nick Carroll on
Ryan, did you create the soft link from /services/service1 to /var/lib/aolserver/openacs/etc/daemontools/ ?
Posted by Nick Carroll on
The other problem could be a permission problem. You need to have root access to start the runit services.
Posted by Ryan Gallimore on
Nick: figured it out - wrong paths in daemontools/run. runit seemed to start once, but it didn't bring up aolserver after I killed it. After reboot, I get the following error:
root$ runsvctrl up /service/service1
runsvctrl: warning: /service/service1: supervise not running.
Is there a boot script that needs to be run?
Posted by Nick Carroll on
Ryan as far as I know there is no boot script needed. It was fairly straightforward when I installed it on Ubuntu Breezy Badger.

That message looks like a daemontools message, and they aren't usually very helpful in general. You could try removing the "supervise" directory in openacs/etc/daemontools, and rebooting. I'm not sure if you had previously installed daemontools and that the supervise directories are incompatible between daemontools and runit.

Posted by Nick Carroll on

A late response... I just started getting the same error as you on a fresh installation.

You need to get the runit service running before you can control it with runsvctrl. To do this do the following as root:

root$ runsvdir /service

You can now use runsvctrl to control the service.

root$ runsvctrl up /service/service1

The runsvdir should create the supervise directory that is missing as stated in your error message.


Posted by Nick Carroll on
Just found out that there is a script called runsvdir-start that is packaged with the runit deb package. If you execute the script it will start up runsvdir on the /var/service directory, which is created when you install runit using apt-get. So no need to create /service, just place the softlink of your openacs daemontools directory in /var/service.
Posted by Ryan Gallimore on
I've never tested the apt-get install with dotLRN so I'm not sure if config.tcl is different. Not sure exactly what problems you're having if aolserver is starting up. You don't need to add the -b youraddress:yourport switch to nsd-postgres unless you want to use port 80.

Post some more details and I'll see if I can help.

Posted by Jade Rubick on
Please be sure to update the above Wiki page with what you find out...
Posted by Carl Robert Blesius on
Thanks to the Debian install wiki I was able to get a new OpenACS site running on multiple ports in less than an hour (including the time it took me to tar/compress move, and untar/uncompress around 1+gb of files from my old server to the new).

We should probably make a decision on runit vs. daemontools though and add a section on postfix (which seems to have already ousted qmail around here).

I found the daemontools install to be simple as pie, because of a convenient package called daemontools-installer:

blesius:~# apt-get install daemontools-installer
blesius:~# build-daemontools

(I selected the standard DJB locations in the install dialog and sym linked the daemontools directories and I was finished)

Any others happy with runit as a daemontools replacement? In the interest of packaging and simple install it makes sense, but I would like to hear a little more anecdotal evidence before using it in production and adding it to the documentation.


P.S. Unless there are objections I am going to add a section on postfix.

Posted by Nick Carroll on
I actually still prefer to use daemontools, and will probably keep using it.

I use postfix over qmail as it is far easier to configure.