I want to use Node because it's swift, uses the same language I am using on the client side, and it's non-blocking by definition. But the guy who I hired to write the program for file handling (saving, editing, renaming, downloading, uploading files, etc.), he wants to use apache. So, I must:
-
Convince him to use Node (he's giving up little ground on that)
-
Figure out how to upload, download, rename, save, etc. files in node or
-
I must install apache and node on the same server.
Which is the most favorable situation, and how do I implement that?
Best Answer
Great question!
There are many websites and free web apps implemented in PHP that run on Apache, lots of people use it so you can mash up something pretty easy and besides, its a no-brainer way of serving static content. Node is fast, powerful, elegant, and a sexy tool with the raw power of V8 and a flat stack with no in-built dependencies.
I also want the ease/flexibility of Apache and yet the grunt and elegance of Node.JS, why can't I have both?
Fortunately with the ProxyPass directive in the Apache
httpd.conf
its not too hard to pipe all requests on a particular URL to your Node.JS application.Also, make sure the following lines are NOT commented out so you get the right proxy and submodule to reroute http requests:
Then run your Node app on port 8000!
Then you can access all Node.JS logic using the
/node/
path on your url, the rest of the website can be left to Apache to host your existing PHP pages:Now the only thing left is convincing your hosting company let your run with this configuration!!!