Forum OpenACS Q&A: OpenACS/.LRN installer in FreeBSD 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
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: https://openacs.org/doc/openacs-5-1/unix-installation.html
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)
There are 2 other things to be aware of:
- 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
- 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.
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.
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.
- strategies for automatic restarts
- controlling automatic restarts
- compatibility with version 4.x.
- 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.
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 192.168.254.128)
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
thanks for your FBSD work. It has helped me greatly.
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!
See the following link:
Errot: ...."libpq.so.3" not found, required by 'nspostgres.so"
Any thing I miss ...the port is great!!