Mac OS X Mountain Lion does not have a Web Sharing box in the Sharing system prefs menu. It is thoroughly discussed on the web that the Apache server is available, and that it can be turned on manually in the command line, or by using a convenient Prefs Pane. That works while the computer is awake. But, when my computer goes to sleep, the server stops working, even though Wake for Network Access is checked in the Energy Saver Pref Pane. From the discussion on Bonjour, I see that this problem probably results from the fact that Apache isn't registered with Bonjour. Does that sound likely? If not, please make some suggestions. The connection is via hard-wired ethernet.
If registration with Bonjour is the problem, I'd like to know how to register it. You gave a nice description of dns-sd, and the command description says dns-sd -R Name Type Domain Port [TXT...] (Register a service)", but I don't know what to use for "Name" or "Type", or the format of the domain. I tried some dns-sd -B searches and found nothing I could use as a model, and it doesn't show up in Bonjour Browser.
Any suggestions would be appreciated.