jlengstorf / code.lengstorf.com

A blog for me to nerd the fuck out.
https://code.lengstorf.com
ISC License
7 stars 3 forks source link

Apache (CPanel/WHM) and Node.js run in one Server #18

Open kanonochina opened 7 years ago

kanonochina commented 7 years ago

Hi Jason,

Awesome video tutorials, followed a couple of your videos and worked just as it is. Brilliant!

I was hoping that you can also do a tutorial where an Apache server with CPanel or WHM can also run Node.js side by side, if that's possible.

Anyway, looking forward to your next amazing tutorial.

Best, Markos

jlengstorf commented 7 years ago

Hi, Markos!

It's possible to set up Node and Apache on the same server for sure. You'd just use Apache as your reverse proxy instead of Nginx. So if you've got a box running Apache/CPanel right now, and you've got SSH access to it, you can just install that Node app using the same steps in the Node.js + Nginx tutorial, but use the Apache reverse proxy to make it publicly accessible.

Does that make sense?

My own experience has been that Nginx tends to outperform Apache, which is why I use it — however, I haven't done any research on how Apache and Nginx have changed in the last year or two, so the performance gaps may have been closed.