dongyutan1703
2012-07-24 15:29如何将Node.js服务器连接到Apache服务器?
I'd like to use Socket.io and Node.js 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:
- Put Node on same instance as Apache and proxy the two servers
- 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 MySQL 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.
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 如何对在同一服务器上运行的不同进程使用不同的域名
- web-services
- dns
- php
- node.js
- 2个回答
- 为什么所有这些新语言都有自己的Web服务器?
- webserver
- apache
- node.js
- 3个回答
- 如何在Apache服务器上运行没有端口号的nodejs
- apache
- codeigniter
- javascript
- node.js
- php
- 2个回答
- 处理Web服务器上载的文件而不先在本地存储?
- apache
- file-upload
- php
- node.js
- 4个回答
- 如何将Node.js服务器连接到Apache服务器?
- apache
- websocket
- php
- node.js
- javascript
- 3个回答