node.jsmod-perlmod-php

Can Nodejs run behind Apache and is it supported?


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?


Solution

  • 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.