Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Bonjour is a lovely technology. I would like all my custom vhosts on my mac (Snow Leopard) to broadcast via bonjour. What is the best way to do this, without having to enable for every vhost separately?

share|improve this question
1  
Bonjour is lovely - seriously???? It's the first thing I disable on our Macs... –  Jon Rhoades Jan 26 '10 at 9:51
3  
Would you care elaborate? I find bonjour amazing. Why do you disable it? –  Ammar Feb 11 '10 at 0:51

3 Answers 3

I'm going to be making the assumption you're using the built-in Apache Server, so...

If you open up your httpd.conf you can usually see at the very bottom:

Include /private/etc/apache2/other/*.conf

The "other" directory contains both php.conf and bonjour.conf

Bonjour.conf has a few oddities though, for one, the default file does not include some of the possible options. As far as I know there are only three possible options:


RegisterDefaultSite

This broadcasts the main site, not a VHost, and uses the machine's name (As defined by "Computer Name" in the sharing prefs) as the Bojour service title.


RegisterUserSite

this takes one of three options:

<a username>
all-users
customized_users

The first two are self explanatory, but customized_users is rather clever; it checks if each user has made changes to the index.html in ~/Sites; if so, that user's page is broadcasted.


RegisterResource

This is probably the one you are looking for; it accepts two arguments, a service name and a path.

Ex:

RegisterResource HelloLan /

My suggestion:

I would try placing a RegisterResource in each VHost, although I don't use VHosts and so I haven't tried it myself.

I have heard the the mod_bonjour that is shipped by default has some issues with multiple RegisterResource options see here: http://deeperdesign.wordpress.com/2010/06/13/apples-mod_bonjour-is-broken-in-snow-leopard-so-i-fixed-it/.

Someone leaving a comment on the aforementioned page seemed to suggest VHost Bonjour is possible.

so best of luck!

share|improve this answer

Just to clarify, you want to register alternative A/CNAME records (eg: devsite1.local, devsite2.local, ...) for your machine so that other machines can access the virtual hosts you've created? There's no easy way to do this as the Bonjour API (unlike Avahi) doesn't allow arbitrary record names to be registered.

share|improve this answer

On debian i did:
a2enmod mod-dnssd
cat /etc/apache2/mods-enabled/mod-dnssd.conf

 # This is the config file for mod_dnssd.<br>
< IfModule mod_dnssd.c><br>
    DNSSDEnable On<br>
< /IfModule>

this applies to all vhosts at once.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.