I was surprised to find that while there are a lot of good sites detailing steps for configuring a MacBook Pro to use MacPorts for installing apps for web development, that none of them worked for me. It turned out that MacPorts had an OS X 10.5, Leopard, problem that lead to the MacPorts Apache2 install failing. This prompted me to start documenting the steps that I’ve taken to build up my environment.

The basis for my steps started out with this great post from Garrick Van Buren. I basically followed his steps exactly, but encountered a problem when I tried to run “sudo port install” in step 6. When compiling, the output was this:

Undefined symbols:
  "_ap_ugly_hack", referenced from:
      _ap_ugly_hack$non_lazy_ptr in libmain.a(main.o)
  "_ap_prelinked_module_symbols", referenced from:
      _ap_prelinked_module_symbols$non_lazy_ptr in libmain.a(core.o)
  "_ap_prelinked_modules", referenced from:
      _ap_prelinked_modules$non_lazy_ptr in libmain.a(main.o)
      _ap_prelinked_modules$non_lazy_ptr in libmain.a(config.o)
  "_ap_http_input_filter_handle", referenced from:
      _ap_http_input_filter_handle$non_lazy_ptr in libmain.a(protocol.o)
  "_ap_preloaded_modules", referenced from:
      _ap_preloaded_modules$non_lazy_ptr in libmain.a(config.o)

After a bit of searching, I found an unexpected solution in the MacPorts trac system. The solution was to run the following commands “sudo port install gawk“, then “sudo port clean apache2“, and then “port install apache2“.  On to the next steps…