The Toolkit for Online Communities
17921 Community Members, 1 member online, 2456 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : OpenACS/.LRN installer in FreeBSD ports collection

Forum OpenACS Q&A: OpenACS/.LRN installer in FreeBSD ports collection

Icon of envelope Request notifications

FreeBSD ports for OpenACS and .LRN have been added to the ports collection.

Thanks to I.Tetcu, S. Lawrance and P.Lucistnik for reviewing and committing.

Ports make installing on FreeBSD a non-issue, just do:
cd /usr/ports/www/openacs && make install WITH_POSTCONFIG=yes
cd /usr/ports/www/openacs-dotlrn && make install WITH_POSTCONFIG=yes

(cd /usr/ports/www/openacs && make install, will allow you to inspect and run /usr/local/share/examples/openacs/post-config.sh later. This script configures Aolserver and Postgresql.)

How to get it?
- The ports collection ships with the next OS releases, starting with 6.0 around september

To get changes made after a "ports freeze" (such changes will not be in the release ISO; see schedule of release engineering: http://www.freebsd.org/releng/index.html):
- just update your ports collection
- or use http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/ to download tarballs
- or use the remote fetching of packages (instead of ports): pkg_add -r openacs (or pkg_add -r dotlrn)

Ports vs Packages
There are ports and packages. Ports are config files that tell FreeBSD what it needs to install a particular software. Packages are build from ports (by doing "make package" instead of "make install"). Package are mainly file lists with an install script (PRE/POST install), a deinstall script and some descriptions. Read 'man pkg_create'. This paradigm may be a little different in FreeBSD than in most Linux distros. A good place to pick up a lot about it: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html

Ports magic
All magic of ports like 'make fetch-recursive install package clean' is in: http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk

All dependencies (postgresql, aolserver, aolserver-openacs-pg, tdom, tclwebtest, tcl84-thread, etc.) are available but let me know if you are missing something.

Please submit bugs at http://www.freebsd.org/send-pr, with a cc to me. Put at least something like "[problem or patch] www/openacs: ..." in the one line summary, or contact me directly. If you know how please port it to netBSD/openBSD. If you want to be a maintainer for one of the ports, let me know.

- The ports/package collection will give you other possibilities like:
  * upgrading: http://www.onlamp.com/pub/a/bsd/2003/08/28/FreeBSD_Basics.html
  * tricks: http://www.onlamp.com/pub/a/bsd/2003/08/07/FreeBSD_Basics.html
  * search collection: cd /usr/ports && make search key=... (or http://www.freshports.org)
- A FreeBSD desktop distro: http://www.pcbsd.org
- A recent FreeBSD/Linux comparison: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-comparison
- The original thread on installing openACS with FreeBSD can be found here: http://openacs.org/doc/openacs-5-1/unix-installation.html

Posted by xx xx on
The install.sh script in CVS doesn't work on FreeBSD.

I fixed it on FreeBSD and made it work (thanks to Vinod) without daemontools.

If you want to try, you can download it here or email me ( here's the diff against HEAD today).

If you have tested please report it as comment under bug 1765.

Posted by xx xx on
I just found out that openacs and dotlrn are not packaged at: ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/www
The reason is that the openacs and dotlrn ports depend on daemontools which is nonpackageable due to license restrictions.

This means pkg_add -r openacs won't work and installing openacs just won't be a 10 min experience but a 60 min experience, since you'll have to use the port instead of the package. If needed, I can change the port to make it packageable on freebsd.org. As I said it is a license issue and building a package on a local station works as expected (but add daemontools as port not as package).

A workaround for a (major) decrease of installation time:
pkg_add -r bash
pkg_add -r readline
pkg_add -r aolserver-openacs-pg
pkg_add -r tdom
pkg_add -r tclwebtest
cd /usr/ports/www/openacs (or openacs-dotlrn)
make install

There are 2 other things to be aware of:

  1. There can always be bugs/enhancements that haven't made it into the port yet. All of FreeBSD's problem reports are listed at http://www.freebsd.org/cgi/query-pr-summary.cgi
  2. The port will drop the database and (re)creates an empty one. Eventhough there is a major warning to backup and do a pg_dump, I think I'll make dropping the database interactive in the future. For now, you can comment out the dropdb/dropuser statements in ./files/pkg-install.in if you want to.
Posted by Malte Sussdorff on
Not understanding the issue fully, but what is the recommended way for the things daemontools does in FreeBSD (I know in OS X we can use "launchctl" instead, maybe there is something equivalent in FreeBSD as well). Furthermore, why can't you make a dump of the database into yourserverhome/database-backups, just in case :).
Posted by Frank Bergmann on

I completely skipped daemontools for our ]project-open[ servers, both productio and development.

Instead, we're using /etc/inittab again:

- It basicly does the same (start and restart NSD)
- An unprivileged user can restart "his" NSD simply using "killall -9 nsd". A bit ugly, but it works perfectly.

- There is no way to temporarily suspend an NSD process without editing /etc/inittab. This is something you might want to do when you've got a very busy server etc.

- Get rid of daemontools. I always hated it. It doesn't follow a lot of *nix programming guidelines and doesn't even come with man pages.

The only thing I wonder is the bootup order of AOLServer because of security issues. I don't know _when_ exactly AOLServer changes the UID and GID of the process to the specified user/group.


Posted by xx xx on
Yes, to make openacs/dotlrn packageable on FreeBSD.org I need to get rid of daemontools (or at least make it optional).

There are some differences between linux and FreeBSD so we cannot use inittab.

The new rc.d system, a NetBSD invention, doesn't seem to support automatic respawning, so I probably need to go for a cron job. I don't think there is a way to temporarily stop such a job as easy as with daemontools. I'll look into this next week or so, but tips/examples are welcome.

BTW, a port/package is not supposed to leave files behind (like a pg_dump file) after a deinstall, but yes, a dump could be part of an interactive solution.

Posted by xx xx on
The aolserver sample script could be adapted, but I'm also interested in:
  • strategies for automatic restarts
  • controlling automatic restarts
  • compatibility with version 4.x.
  • things that daemontools handles nicely.
Posted by xx xx on
I will also take a look at the keepalive script.
Posted by xx xx on
  • Updated dotlrn version to 2.1.3.
  • Fixed aolserver rc.d script (for stop/start/restart/status).
  • Made entries in rc.conf to automatically start postgresql/aolserver after a reboot.
  • Daemontools is optional as is postconfig: make install WITH_POSTCONFIG=yes WITH_DT=yes
  • The keepalive script is not part of the installation. If you want, install Wget, symlink to /usr/bin/wget and follow the link above.
  • Fixes have been committed to the ports collection.
    It will take two weeks or so before packages at ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-current/ are updated, after which pkg_add -r openacs should be possible. FYI, you may need /usr/sbin/sysinstall for options or specify the complete url.

Posted by xx xx on
For development purpose you could use VMware.

Download VMware player and Freebsd 6.0 (minimal or developers) image:

Unpack image and configure the image (= 10 minutes): sysinstall --> configure -->
- root password. Default "thoughtpolice"
- networking add: sshd and interfaces (choose DHCP, remember your IP address: probably

Make sure your firewall is off or accepts all connections from vmware

Add and configure Freebsd port (= 10 minutes):
- (!) create user service0: pw useradd service0 -d /usr/local/pgsql
- add all packages needed: pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/Latest/openacs.tbz (5 minutes depending on your download connection)
- make sure postgresql and aolserver start at reboot:
ee /etc/rc.conf (add one a new line: postgresql_enabled="YES" ; exit with esc)
cp /usr/local/share/examples/aolserver/aolserver.sh.sample /usr/local/etc/rc.d/aolserver.sh
- configure openacs: sh /usr/local/share/examples/service0/post-config.sh XX POST-INSTALL
- restart server: shutdown -r now

- optional add browser: pkg_add -r lynx

Succes (= lifetime, hopefully ):
from terminal: lynx
from external browser:

Posted by xx xx on
I didn't update the port to 5.2.2. yet. Did installation requirements change due to xotcl for example?
Posted by Haynes Horne on
Aldert, are you still waiting for a reply on this question?
thanks for your FBSD work. It has helped me greatly.
Posted by xx xx on
Currently, I am not running openACS/.LRN servers, so I have asked Martin Matuska to update the ports and to take over maintainership.

The updates ports have now been committed to the FreeBSD ports tree! They work with FreeBSD 6.2 and use openACS 5.3.0, .LRN 2.2.1 and aolserver 4.5.

He has done a marvellous job and maintains his versions at http://www.matuska.org/martin/cgi/viewvc.cgi/ports/ (The post-config script may not work !).

Ask Martin if you have any questions.

It was fun to create a one-line installation procedure for openACS/.LRN on FreeBSD, but I am glad I found new blood to step up to the plate. Cheers!

Posted by xx xx on
Obviously, for regular download use the FreeBSD ports tree
Posted by robert gilaard on
Marvelous, will try it out shortly because I would love to host my solution on OpenACS and freebsd.
Posted by Martin Matuska on
I wrote an installation guide for installing OpenACS on FreeBSD from the current ports tree.

See the following link:

Posted by T.K. kang on
I tried to install with the instruction and ports by Martin Matuska. Things seems to be fine but I do get the error and could not get the Openacs system running:

Errot: ...."libpq.so.3" not found, required by 'nspostgres.so"

Any thing I miss ...the port is great!!

Posted by Martin Matuska on
This error happens if you upgrade PostgreSQL e.g. from 7.4 to 8.x and forget to reinstall aolserver-nspostgres. The library ending changes in this case. Please reinstall databases/aolserver-nspostgres
Posted by T.K. kang on
This is a specific installation?. How do I reinstall databases/aolserver-nspostgres? Thanks...