How to connect Node.js server to Apache server?
===

I'd like to use [Socket.io][1] and [Node.js][2] to do push notifications. The end goal is to do something similar to what Stackoverflow does with their commenting to notify people of new comments. 

My site is in PHP and runs on Apache on an EC2 instance. I've heard that Apache doesn't handle concurrency well so I'm interested in using Node to handle the hopefully large # of simultaneous, persistent connections. I guess there are two solutions:

 1. Put Node on same instance as Apache and proxy the two servers
 2. Put Node on a separate instance

In either case, I don't know how the connection between these two servers looks programmatically. For example, while WebSockets/Node handles the sending/receiving of messages, I need to store these messages in my database and that would require some PHP code, yes/no? Also, how is the message received on my PHP page? Via a `$.post` to a url like this, `http://mysite/receiver.php` that would be resolved by my Apache server?

I'd be happy to see either comments or code to help me understand this better.

 


  [1]: http://socket.io
  [2]: http://nodejs.org/