Forum OpenACS Q&A: OpenACS 4 on Mac OS X (and Darwin) HOWTO now available

The the OpenACS 4 on Mac OS X HOWTO document that I have been working on for sometime is now available. Feedback appreciated. file.tcl?file_id=217


Hi Walter, thanks for all of your efforts.

I'm curious whether or not you have any resources (yours or others) concerning *nix-style MTAs on MacOS X. My mail system of choice is qmail/nmh/exmh + fetchmail and I've been tossing about the idea of dumping my Linux deskside box and using an iBook for daily use.

I've done a quick Google search and it appears that perhaps MacOS X can support this stuff okay, but I know almost nothing about MacOS X and *BSD*. The last MacOS I used was System 7.1 on moldy old Mac IIsi (vintage 1991), so I'm a little behind the times 😉

I'd be really keen on this if I can run exmh, my favorite X Windows MUA natively on an iBook (I'm not interested in dual-booting since I've been doing that with Wintel/Linux for a while).


I've seen a mention of qmail on OS X, but that is about all I know
(can't remember where).

I'll use this post as an example to show how you can find *nix
software for Mac OS X or Darwin:

I've checked and http://, but haven't found mention of qmail
(well actually, there was one patch that was a year old for Mac
OS X Server).  Both are good resources for whether applications
have been ported.  Versiontracker is biased toward binary
distribution rather than the build process.

Fink (, is a package manager
system for Mac OS X and Darwin) didn't find anything for qmail...

You might want to check out
devel/darwin_ports/ for information about the BSD ports system
(another package management system) on Darwin.  2000+ (of
around 5000 BSD ports total) ports have been made available to
Darwin/Mac OS X.  Looking at the OpenACS 4/FreeBSD
installation guide I noticed that qmail came under the BSD ports

OpenPackages ( looks like
another flavor of the BSD ports collection...

And finally, you can just download the source for qmail and see if
it compiles.  Of course you need a copy of Darwin or Mac OS X
around to do this.  Since you haven't purchased a Mac yet, if you
are really curious you could try Darwin on x86 hardware (http:// if you have a box lying

All in all, if it is *nix based software there is pretty goddamn good
chance that it will either work with no changes or be ported soon.

Please keep me informed of what you find out.  Also if you get
any of this stuff working you may want to let the person that runs
this page know:

Oh yeah, sendmail ships with Mac OS X, you just have to flip a
switch in /etc/hostconfig (there is probably a GUI way to do this
too) and then do the normal sendmail configuration (yuck).

Good luck,

Hi Sean,

We manage to compile (without problems) postfix on OS X.

I still haven't tryied to play with qmail but maybe I should try and let you know.

Hope this helps.

Sorry ... here is the information on Mac OS X and Mailservers.

I bumped into fetchmail for OS X here (
network.php3).  Looks like a decent site for finding ported apps



Thanks guys, I'm doing my "due diligence" before I come to a decision whether or not I return to the Mac flock. I figure I still need to wait a while for native OS X version of Photoshop (plus I'd like a choice of iBook colors 😊 but if I can have qmail/nmh/exmh/fetchmail, Quicken, Emacs, and a web browser, that pretty much covers my "killer apps". I'll continue to look at those sites for more information.

Sadly, I'm on dialup PPP for the time being, so I doesn't look like I'll be trying Darwin on x86 anytime soon. Again, thanks for all the info, and if anyone gets qmail to work on a Mac, please post your success story here.


You wrote "Mac OS X (preferably 10.0.4 or later)" for the requirements.
I tried installing it on Mac OS X 10.1 5G48 (which classifies as 'later' for me), and it doesn't work. After messing around with some makefiles of aolserver (adding -flat_namespace), I got everything to work, except PostgreSQL. It compiles fine (using --without-shared or with shared when adding -flat_namespace, I tried both), but I can't create new databases:

% createdb test
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally
        before or while processing the request.
connection to server was lost
createdb: database creation failed

I'm able to connect to the HTTP-server, but it says it can't connect to the database (since openacs4 doesn't exist). Creating users works fine.
Anybody got a clue? Maybe there's a way to debug it? is down, so I can't check their FAQ - but I guess there's nothing helpful there anyways.

(first post here)

Well, I guess I'll change the requirements for the time being.
Thanks for catching this.  I don't have a copy of 10.1 (I'm not apart
of Apple's Developer network).

Unfortunately, I can't offer any advise on trying to get PostgreSQL
to work with 10.1.  I think you are correct that the PG community
is a more effective place to inquire (although there are several
people here that know there way around PG).  I've heard good
things about the PG Hackers mailing list.

You can always check the mirrors of,namely the one I connect to in The Netherlands: or

Hope this helps.

With the help of David A. Gatwood, I've been able to create a patch for PostgreSQL 7.1.3 and published it here.

Feel free to mirror it.

For aolserver, "export LDFLAGS=-flat_namespace" before compiling should be enough.

Sorry, that export-trick didn't do it. You have to change the following line in aolserver/include/

LDSO=$(LD) -bundle -undefined suppress
LDSO=$(LD) -bundle -flat_namespace -undefined suppress

Would you mind wrapping up the steps necessary to get PG and
AOLserver working under Mac OS X 10.1 as a subsection of the
original doc, please?

Adding it at the end of the file with a note under the requirements
section seems best.

Go ahead and add yourself as a co-author if you want and
update the "last modified" line, too.

If not, I'll try to get to it, but I don't have 10.1 to work with...


Dear Walter McGinnis

Just to tell you that I have been putting together a perfectly running testsite along your songlines - many thanx for the great work. I must confess that I was a bit surprised about the small number of packages available, once I had finished the installation. Is there anything that I did miss there? For instance, how would I go about installing the SKIN package? But all together you did a very useful compilation of wisdom about ACS on OS X. Great!
Kind regards


Posted by Walter McGinnis on

Your welcome. What version of OS X did you use?

The reason that you only got a small number of packages was that the cvs checkout was ONLY for the acs-core packages.

To get individual packages via cvs that are outside of acs-core (i.e. the essential packages to run OpenACS 4) do the following from yourserver/packages/:

bash-2.05$ cvs -z3 checkout the_package_you_want

The HOWTO needs an update for 10.1. I'll include this info along with alternativly grabbing OpenACS 4 alpha, etc.

BTW, if anyone wants to volunteer to do the update, please contact me.


I did use 10.0.4 Build 4Q12

I did try installing the packages from the official alpha tar ball, I guess, that these should work out perfectly, most very happy about the dependencies, but they all crashed while trying to install the datamodels. I will try the CVS checkout, following your advice.



Did you drop the original database and recreate an empty one
before your reinstalled the alpha release?  That is my first guess
as to why it failed for you.

In other words, use "dropdb openacs4" then redo the "createdb"
and "createlang" steps.

Also note that you will have to visit /acs-admin/apm/ after your
install to load any none acs-core packages as an additional


Is it fixed?

A very brief overview of PostgreSQL (and MySQL, too) can be
found on Apple's Development site (

You may need to register which is free, but you'll prompted to
sign up for pay levels of service.

I guess as an ADC member I should evangelize for OpenACS.

Before I do that I need a volunteer to run through the HOWTO
with Mac OS X.1 on a fresh system.  If you are willing to do this
please contact me!


about running OpenACS on 10.1 - it's doable, but i'd leave it out of the HOWTO untill (at least) postgress has been updated...

The HOWTO is still basically right, but the things I'd look at updating are -

  • I used the most current versions of zlib, readline and libiconv from their primary distribution sites. Did you link to the copies at for any particular reason? The only patching required to get them built was to do with the whole two-level namespace thing. More on that later...
  • I used postgresql 7.1.3 - this (postgres, not the version in particular) is where the main problem lies. Apart from linking / namespace problems, the distribution version of postgres is broken under 10.1 due to problems with the OSX SysV IPC implementation. There are patches floating round the 'net that let postgres run on POSIX IPC, but I'd wait for 7.1.4 which should (hopefully) have these patches rolled in. (for the interested, the patches are available here).
  • I used the 2.0.1 pgdriver. Perhaps we should try to get the new Makefile rolled into the OpenACS pgdriver distro - it should work for all architectures, as it just brings the pgdriver into the main AOLServer build environment in the same way as all the other modules we use. Who would be the right person to talk to about this?

The two-level namespace linking problems affect anything that uses shared libraries under 10.1. They're trivial to work around (force the linker to use the old single-level namespace with the -flat_namespace flag), and I'll roll a patch to do that for all of the packages used here once the postgres problems are fixed. Ideally the fixes will make it into the upstream packages sometime soon.

If anyone is interested and lacks the time / inclination to build it themselves, I'll pack a binary tarball of postgress and AOLServer for 10.1.

Dear Russel

Your tarball would be highly welcome. When and where may it be available?

Kind regards and many thanx


the "when" would be now, and the "where" would be at

This is just what I've been using for my own hacking, but it should be workable.

Read the README, and good luck!

Dear Walter

Many thanx, yesterday I did install your tarball in no time. There is
a small mistake in the initdb and postmaster sequence (the path
is /usr/local/pgsql/data and not /usr/local/bin/pgsql/data), but
otherwise everything did run smoothly.

Unfortunately I get the following mistake as first welcome: "
Request Error Server startup failed: Error during bootstrapping
invalid command name "db_qd_load_query_file" while executing
"db_qd_load_query_file $file" (procedure
"apm_bootstrap_load_queries" line 26) invoked from within
"apm_bootstrap_load_queries acs-tcl" AOLserver/3.3.1+ad13 on
http://localhost:8081 "

Any ideas what this might mean?

Kind regards and many thanx again (!)



Seems like you might have really meant to thank Russell for the

As far as your problem, I would recommend loading up your
server's error log in emacs.

When you get an invalid command error it is likely one of two

1. you are calling the command wrong (usually a mispelling).  I
don't think this is the problem here.

2. the file that the proc was supposed to be defined in failed to
load at system startup for some reason

Check your error log to see if packages/acs-bootstrap-installer/
tcl/40-db-query-dispatcher-procs.tcl loaded correctly.  If not, that
is probably where your real error lies.  Unless it is part of a set of
other errors.  What does your error log say?

Oh yeah.

If you aren't sure how to load your error log, skim http://

Are you working off the alpha tarball or the latest cvs?

Keep us posted,

Dear Walter

This seems to be the critical part of the error log. I am using the
alpha tarball. And I would love to install ACS on my lovely iBook...
Kind regards from a very cold Switzerland


[15/Nov/2001:21:39:59][323.-2147478600][-main-] Notice:
Loading packages/acs-tcl/tcl/xml-2-procs.tcl...
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Error: Server
startup failed: Error during bootstrapping
invalid command name "db_qd_load_query_file"
    while executing
"db_qd_load_query_file $file"
    (procedure "apm_bootstrap_load_queries" line 26)
    invoked from within
"apm_bootstrap_load_queries acs-tcl"
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Notice:
Sourcing files for postload...
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Notice: Done.
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Notice:
Executing initialization code blocks...
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Notice:
QD=Postload files to load:
[15/Nov/2001:21:39:59][323.-2147478600][-main-] Error:
invalid command name "db_qd_load_query_file"
    while executing
"db_qd_load_query_file $file"
    ("foreach" body line 2)
    invoked from within
"foreach file $files {
        db_qd_load_query_file $file
    ("foreach" body line 6)
    invoked from within
"foreach dir $dirs {
    set files [glob -nocomplain "${oacs_root}/$dir/*.xql"]

    ns_log Notice "QD=Postload files to load: $files"

    (file "/usr/local/web/openacs4/tcl/zz-postload.tcl" line 37)


I've fixed the paths in the install README - thanks for pointing that out.

The important part of the aolserver log is where 40-db-query-dispatcher-procs.tcl gets sourced and db_qd_load_query_file is meant to be getting defined. If you search in the error log you should find a section like

Notice: tcl: enabling .tcl pages
Notice: Loading OpenACS, rooted at /usr/local/web/openacs4
Notice: Sourcing /usr/local/web/openacs4/packages/acs- bootstrap-installer/bootstrap.tcl
Notice: Database API: The following pools are available: subquery main log
Notice: dbdrv: opening database 'postgres:localhost::openacs4'

Do you see any error messages between the "Sourcing /usr/..." and "Database API: ..." lines?

On a side note:

When posting error logs or any other preformatted text to the bboard it is good to switch "The above text is :" to "HTML" and then wrap the text in question in <pre> tags.

I recommend that you go to the end of your error log then reverse search (C-r) for 40-db-query-dispatcher- procs.tcl. In the latest cvs version this is where the db_qd_load_query_file command is defined. Did 40-db-query-dispatcher-procs.tcl load correctly (i.e. define all its procs) or did it result in an error?

Dear Russel, dear Walter You are so kind not to give up in trying to support me with my installation. I did follow your two hints but to no avail; perhaps you might have a look under ERRORLOG where I did put guess what? Kind regards Mischa

I guess we misled you.  The convention for tcl library files is to
log that they have started to be loaded and finished loading.
However, this is within  the toolkit proper, not the bootstrap
process.  So what Russell found and I confirmed is that there is
no notice in the error log for loading of 40-db-query-dispatcher-


Russell submitted a patch to log the bootstrap files in the SDM.

In the meantime,  I suggest that you do a cvs checkout of just the
acs-core packages.  If that works, then checkout the individual
packages that you want and set them up via the apm (i.e. /acs-
admin/apm).  If either of these things cause problems let us
know by posting a new thread specific to the problem.

Good luck,

Dear Russel, dear Walter

With the CVS checkout everything worked out flawlessly. Many
many thanks, you really did create a lot of pleasure for me.
Kind regards


Just a side note.. I am setting up OpenACS on a G4tiBook..  (Sean go for the G4 if you can..  worth the extra bucks!).. so far Aolserver and Postgres run fine..  download the developer tools from Apple (free registration) and Gnu/Darwin.  I will try and note my experiences written down for notes as well.


With the first release just around the corner, it would be great if
somebody (Walter?) spruced up the HOWTO article and
submitted for publication at Stepwise (
O'Reillynet is another possibility, but we might be better off
targeting O'Reilly for a more general article about OACS 4.
I submitted the original HOWTO to stepwise and O'Reilly's Mac
specific area (by email) awhile ago.  Never heard back from
either of them.

The HOWTO does need an update.  I believe Russell has
isolated some problems specific to 10.1 and later that need to
be addressed earlier in this thread.  Unfortunately, I'm not
available to do the update.  We need a volunteer.

Jamie, can you roll you notes back into the original document
and submit it to us via this thread?  That would be much

I assume somebody will be putting together some kind of press
release together for the upcoming OACS release. (Yes?) If so,
maybe we can resubmit the HOWTO with the press release or,
better yet, work some of the details of the press release into the
introduction to the HOWTO and turn it into an article. I'd be happy
to help with the writing part if I have a partner who can  handle
the technical details.
Jamie, what was your experience on the Titanium Powerbook?
I'm looking to do the same. It looks like doing it on OS 10.1 is
slightly more complicated than 10.0.4...
Here's my results so far. If you can offer help on the PATH issue, I'd appreciate it 😊 Okay, I'm attempting my installation onto a TiBook, with a pretty much fresh copy of OS 10.1. Report so far...
  • Hmm, looks like bash 2.05a comes after 2.05. I'll grab that.
  • Under Setup User Environments, I had to delete a couple of blank lines at the beginning of the .bash_profile file downloaded.
  • To save the .bash_profile under each of the user directories, you have to d o it under the sudo -s session.
    sudo -s
    (download file to Desktop)
    cd /Desktop    ?
    cp bash_profile.txt /Users/postgres/.bash_profile
    cp bash_profile.txt /Users/nsadmin/.bash_profile
    chown postgres.staff /Users/postgres/.bash_profile
    chown nsadmin.staff /Users/postgres/.bash_profile
  • After I've changed the login shell to bash, bash now works, but the PATH is not correctly set, even though it is in the .bash_profile. WHY? I'm not sure. Suspect, however, is the fact that when I cat or less the .bash_profile, I get ^M instead of character returns. Do I have to convert the file somehow after downloading it?
Yeah.  I suspect this is because you downloaded or edited tthe
file with GUI tool which uses the traditional Mac carriage return
symbol (thus the ^Ms), but the unixy side of things expects Unix
style carriage returns.  Drag. There is still a bit of a disconnect
between Aqua and the underlying Darwin way of doing things

Anyway, there are tools to convert back and forth.  However, I've
never used them.  I just open the file in emacs and replace ^M
with returns where needed.  I think this shall work in this case.

You could also explore TextEdit, I think it might have something
in its preferences for how to save files.

Good luck,

I edited it in pico instead of emacs and I was able to remove the
^M's. Strangely, it seems that emacs is smart enough that it
recognizes that this is a Mac file, and it keeps everything in "Mac
mode". What this means, frustrating enough, is that you can't
edit out the ^M characters. I guess it probably has some facility
for translating back and forth, but I couldn't figure it out, so pico
fixed the problem for now.
  • I'm downloading libxml2-2.4.16.tar.gz instead of 2.4.0
  • Perhaps the links should be for the directory instead of the the file?
  • Hmm, can't get libxml2 to compile. I tried both with the /usr/libexec/config.guess and .sub files and the original. The error I get is as follows:
    ld: -undefined error must be used when -twolevel_namespace 
    is in effect
    /usr/bin/libtool: internal link edit command failed
    make[2]: *** [] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive-am] Error 2
    This looks like the twolevel namespace problem Russell was talking about. Russell, any clues as to how I should work around this?
  • Looks like this might be the place to look: msg00182.html Ain't the web great? According to this article, you have to do the following:
    • export LDFLAGS="-flat_namespace -undefined suppress"
    • cp configure configure.orig
    • Edit configure:
      % diff configure.orig configure
      <     archive_cmds='$CC $(test .$module = .yes && echo -bundle 
      || echo
      -dynamiclib) $allow_undefined_flag -o $lib $libobjs 
      -install_name $rpath/$soname $(test -n "$verstring" -a 
      x$verstring !=
      x0.0 && echo $verstring)'
      >     archive_cmds='$CC $(test .$module = .yes && echo -bundle 
      || echo
      -dynamiclib) $allow_undefined_flag -flat_namespace -o $lib 
      $deplibs$linkopts -install_name $rpath/$soname $(test -n 
      "$verstring" -a
      x$verstring != x0.0 && echo $verstring)'
      Basically, you make that line look like the second line. Then compiling works fine.
  • Now I'm trying to compile PostgreSQL 7.2 I hope 7.2 support is better than 7.1.2
  • Postgres didn't compile immediately. I'm trying again after closing that terminal and opening it again. Maybe setting the environmental variable for libxml2 screwed it up or something... Okay, this time I'm getting different errors:
    /usr/bin/ld: Undefined symbols:
    /usr/bin/ld: warning unused multiple definitions of symbol _system
    port/SUBSYS.o definition of _system in section (__TEXT,__text)
    /usr/lib/libm.dylib(system.o) unused definition of _system
    /usr/bin/ld: warning unused multiple definitions of symbol _semctl
    port/SUBSYS.o definition of _semctl in section (__TEXT,__text)
    /usr/lib/libm.dylib(semctl.o) unused definition of _semctl
    /usr/bin/ld: warning unused multiple definitions of symbol _semget
    port/SUBSYS.o definition of _semget in section (__TEXT,__text)
    /usr/lib/libm.dylib(semget.o) unused definition of _semget
    /usr/bin/ld: warning unused multiple definitions of symbol _semop
    port/SUBSYS.o definition of _semop in section (__TEXT,__text)
    /usr/lib/libm.dylib(semop.o) unused definition of _semop
    make[2]: *** [postgres] Error 1
    make[1]: *** [all] Error 2
    make: *** [all] Error 2
  • http:// tells how to set up Postgres 7.1.2 on Mac OS 10.1, but that's not what I really want to do.
  • Hmmm, it looks like postgres 7.2 is supposed to install on OS 10.1 just fine. I found a web page that showed regression tests for OS 10.1...
  • Has anybody gotten 7.2 working on OS 10.1?
I installed Postgres 7.1.3, following the directions on the link I posted above. I also got Aolserver working by editing the Makefile, as described by Andreas.

I'm now trying to compile nsxml, and it doesn't seem to work. I copied the nsxml directory into the root directory, which is created by Aolserver. I followed the directions and edited the Makefile. On attempting to compile, here's what I get:

bash-2.05a# cd nsxml/
bash-2.05a# ls
Copyright LICENCSE  Makefile  Makefile~ README    ns_xml.c
bash-2.05a# make
cc -I../aolserver/include -D_REENTRANT=1 -DNDEBUG=1 -g -
fPIC -Wall -Wno-unused -dynamic -traditional-cpp -
ns_xml.o ns_xml.c
ns_xml.c:40: libxml/parser.h: No such file or directory
ns_xml.c:41: libxml/xmlmemory.h: No such file or directory
make: *** [ns_xml.o] Error 1

Any ideas?

I suspect you're mising libxml2 and libxml2-devel. They're available from

I can't give you any hints on compiling these on Mac OS X since I haven't had the pleasure of using that OS (yet!).

If you do have libxml2-devel installed, then the problem is that the nsxml Makefile is not properly pointing to your libxml2 include files. Hope that gets you started...

I spent a couple of hours this evening trying to get ns_xml to compile on Mac OS 10.1

It seems like the linking is what's not working, as Vinod suggested. I tried reinstalling libxml2, and it seemed to install fine. One comment made during the installation seemed interesting:

Libraries have been installed in:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment 
     during execution

See any operating system documentation about shared libraries 
more information, such as the ld(1) and manual pages.
I experimented with ranlib and libtool, and in fiddled with the Makefile and the .c file in all sorts of configurations, but I still couldn't get it to work. I exported the DYLD_LIBRARY_PATH environmental variable, and tried adding in the -LLIBDIR directive to the compilation process. Either I did it wrong, or there is something else I should be doing...?

Anyone here with more experience with with NetBSD and/or Mac OS 10.1? I'd really appreciate some help!

Well, I gave up on following the install guide, and instead tried
using Russell's binaries. Russell, THANK YOU! The entire
installation took about 30 minutes, including download time and

I am having some trouble compiling ns_xml in Jaguar (10.2.2) and nssha1 as well. I could compile AOLServer 3.5.1 and made it run. I am also running Oracle 9i developer release... Has someone had experience compiling those module under Jaguar?

Thank you in advance,