在服务器上运行node.js脚本需要什么?

时间:2022-02-21 15:53:32

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

我有一个标准的Apache服务器。在服务器端运行node.js脚本(http://socket.io/)需要什么特别的东西吗?

2 个解决方案

#1


10  

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

Node.js提供了自己的HTTP服务器,因此不需要Apache。

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

如果您希望在同一服务器上运行Apache和Node.js,请将节点设置为侦听端口80并将未处理的请求转发给Apache,反之亦然

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

在这两种情况下,Node / Apache将监听公共端口80,并转发到某些非公共端口上的Apache / Node侦听。

#2


1  

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

您将需要shell访问权来启动node.js服务器。所以它很可能不适用于共享主机。

#1


10  

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

Node.js提供了自己的HTTP服务器,因此不需要Apache。

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

如果您希望在同一服务器上运行Apache和Node.js,请将节点设置为侦听端口80并将未处理的请求转发给Apache,反之亦然

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

在这两种情况下,Node / Apache将监听公共端口80,并转发到某些非公共端口上的Apache / Node侦听。

#2


1  

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

您将需要shell访问权来启动node.js服务器。所以它很可能不适用于共享主机。