3

Apache creates a new Thread for each request or more accurately, it re-uses a Thread from a pool of Threads but Node.js is essentially a single Thread. Would there be any complication in running a Node.js web app behind an Apache webserver? For example, can I have the following configuration?

http://mywebsite.com/wordpress <-- mod_php

http://mywebsite.com/bugzilla <-- mod_perl

http://mywebsite.com <-- points to the Node.js app

Is there any officially supported Apache plugin for Node.js?

What is the best way to implement this topology?

RHT
  • 4,974
  • 3
  • 26
  • 32

1 Answers1

2

You could set it up that way. You could use mod_proxy to reverse proxy the requests destined for Node.js. It would work, but if you're looking for a better option, I would suggest running Nginx on the front and reverse proxy your requests to a backend Apache for /wordpress and /bugzilla routes and then reverse proxy all other requests to the backend Node.js.

Daniel
  • 38,041
  • 11
  • 92
  • 73
  • 1
    nodejs <-- Nginx --> Apache --> PHP and PERL sounds like a nightmare to admin. Why not just put everything behind Nginx? – srquinn Apr 21 '13 at 14:04
  • 1
    @RHT - It's true that you could just have your PHP and Perl talk directly to Nginx and then reverse proxy everything else to the backend Node.js. That would save you from messing with Apache and from my experience it would be more resource friendly. – Daniel Apr 21 '13 at 23:46