What do I need to run a node.js script on my serve

2019-04-26 02:07发布

I have a standard Apache server. Do I need anything special to run a node.js script (http://socket.io/) on the serverside?

2条回答
Lonely孤独者°
2楼-- · 2019-04-26 02:17

You will need shell access to start the node.js server. So it most likely won't work on shared hosting.

查看更多
Melony?
3楼-- · 2019-04-26 02:38

Node.js provides its own HTTP server, thus making Apache unnecessary.

If you wish to run Apache and Node.js on the same server, either set node to listen to port 80 and forward unhandled requests to Apache, or vice versa

In both instances, Node/Apache will listen to the publicly open port 80, and forward to Apache/Node listening on some non-public port.

查看更多
登录 后发表回答