3

My main application will be in Node.js. However, I'd also like a phpBB forums and a MediaWiki wiki, preferably served on the same Amazon EC2 server.

I am aware of DNode which seems to be a way for PHP and Node.js to communicate with each other. However, what I want to do is just handle certain directories to PHP - eg:

/ = PHP
/chat/ = Node.js
/forums/ = PHP
/wiki/ = PHP
apscience
  • 7,033
  • 11
  • 55
  • 89
  • See this http://stackoverflow.com/questions/6763571/advantages-of-a-reverse-proxy-in-front-of-node-js – Shiplu Mokaddim Oct 07 '12 at 10:12
  • Basically that means that you need to configure your server for the different services. If they need to be accessible via the same protocol and port, you need to either proxy or create a mesh-up of different servers that can handle it. – hakre Oct 07 '12 at 10:23

2 Answers2

2

Just as your example shows, you use PHP for your directories you have listed, and Node.js for the chat client. I don't see why you would be integrating your PHP code into the chat client. If anything, you might pass it data, and that can be done with json.

Eric Leroy
  • 1,830
  • 1
  • 18
  • 31
1

The usual approach to this would be to have one webserver hosting the site, and proxing requests from the other when it is needed.

For example you might use Apache with mod_php to handle the PHP and then the ProxyPass directive from mod_proxy to forward requests to Node.js for specific <Location>s.

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • +1 Apache Proxy will do the trick. See this example: http://hermanjunge.com/post/5111889893/coexistence-of-apache-and-node-js-in-server – Herman Junge Oct 07 '12 at 12:56