# Wake on Demand for Apache server in OS X 10.8 [closed]

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.

-

## closed as off topic by Zoredache, Sven♦, Michael Hampton♦, Scott Pack, HopelessN00b♦Sep 24 '12 at 11:28

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Wake on lan for an HTTP service is almost always too slow. Systems take 15-45 seconds to wake up if you are really lucky. Incoming connections will almost certainly timeout before the system will be ready to respond. Servers usually just need to stay online and never go to sleep. –  Zoredache Sep 11 '12 at 20:59

The correct solution to this problem (as @Zoredache pointed out) is to set the server to never sleep. There may be a way to kluge it to wake on demand, but it'll be slow, overcomplicated, and potentially unreliable.

Now about "Wake for Network Access": it doesn't wake for just any old network access, it wakes when it receives a specially-formatted "magic packet" telling it to wake up. Incoming HTTP requests are not in this format, so they won't do the job. (Note: actually, it's the TCP SYN packet that initiates the HTTP session that would have to be in this format... except that even that wouldn't work because your computer doesn't respond to ARP in its sleep, so the router wouldn't know how to send it the SYN...)

dns-sd -R "some arbitrary name" _http._tcp local 80 &