title: How to connect Node.js server to Apache server?
body: <p>I'd like to use <a href="http://socket.io" rel="nofollow">Socket.io</a> and <a href="http://nodejs.org/" rel="nofollow">Node.js</a> 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. </p>
  
  <p>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:</p>
  
  <ol>
  <li>Put Node on same instance as Apache and proxy the two servers</li>
  <li>Put Node on a separate instance</li>
  </ol>
  
  <p>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 MySQL database and that would require some PHP code, yes/no? Also, how is the message received on my PHP page? Via a <code>$.post</code> to a url like this, <code>http://mysite/receiver.php</code> that would be resolved by my Apache server?</p>
  
  <p>I'd be happy to see either comments or code to help me understand this better.</p>