0

I have bought some time ago an apache server and hosting. I would like to add some nodeJs code.

I know they are different types of servers, but maybe Is there a way to run a nodeJS server inside an apache one?

Maybe Is some other solution? What can I do?

Paul
  • 34,558
  • 9
  • 85
  • 118
Pablo
  • 8,001
  • 13
  • 50
  • 74

2 Answers2

2

You can't run Node inside Apache - but you can run Node as a separate app and have Apache "talk" to node. You should read this:

Apache and Node.js on the Same Server

Community
  • 1
  • 1
noderman
  • 1,884
  • 18
  • 34
1

Look into how to proxy a request using apache. Basically when people hit your apache server at port 80. You want it to pass on the request to your nodejs process on whatever port its running.

I haven't used apache, however nginx is another great webserver.

See this great digital ocean tutorial using nginx. I just recently did it myself and it was pretty straight forward. Step by step.

(The nginx portion is towards the bottom of the tutorial)

matt
  • 1,590
  • 1
  • 12
  • 16