I was playing about with Apache on my iMac and I noticed a little file tucked away in /etc/apache2/other called bonjour.conf. Intrigued I set about figuring out what it was for.
This file had some directives relating to an Apache module called mod_bonjour. The purpose of which is to register URLs with Apple’s Boujour service. This service lets systems and services publish their existence on a local area network so other systems and applications can find them without configuration. Boujour is just Apple’s marketing speak for Zeroconf style networking. It is also known as multicast DNS and is common on Linux and Apple systems.
Safari on MacOS even has a Bonjour menu that displays services or devices that are advertising themselves via the Bonjour service. An example of this is my QNAP NAS. I can always easily access the Admin interface of my NAS (and other services the NAS provides) because it advertises itself with Bonjour.
I thought that using Bonjour would be rather handy for advertising some web applications I had configured on my iMac to other systems on my home network. So I added them to the bonjour.conf configuration file like so:
RegisterResource “Confluence” “/confluence”
RegisterResource “TeamCity” “/teamcity”
Unfortunately after restarting Apache I was dismayed to discover that only the last RegisterResource directive seemed to be working (TeamCity), as it was the only resource showing up in the Bonjour menu in Safari.
However after a quick search for mod_bonjour with Google I discovered two posts detailing the problem. There is a bug in mod_bonjour.
Now I’m running Snow Leopard so I didn’t want to just use the patched binary Chuck provided, so I set about patching the Snow Leopard version of this module. Fortunately Apple provide the source code to this module on their open source site. So I took what appears to be the code from Snow Leopard, applied Chuck’s patch and produced a version for Snow Leopard.
In order to share this updated code with the wider Internet I’ve created a GitHub code repository for it. In order to build this code and update your Mac you will need the Apple Developer Tools installed.