Node.js可以在Tomcat服务器中运行吗?

问题描述:

从我在本博客中看到的内容 http://nowjs.com/ 我需要在服务器机器中安装nodejs它工作。但是,我正在使用共享服务器并且没有任何权限将某些内容放入服务器计算机。

From what I have read so far in this blog http://nowjs.com/ I need to install nodejs in the server machine for it to work. But, I am using a shared server and don't really have any authority to put something into the server machine.

然后将其放入容器(tomcat)中我主要做的事情。
一般来说,当我们说服务器时我们指的是tomcat或者websphere或者jboss。

Putting it into the container(tomcat) is however another thing which I mostly do. Generally speaking, when we say server we mean tomcat or websphere or jboss.

但是如果我没有错,服务器就意味着tomcat真正的机器运行。

But with nodejs if I am not wrong server means the real machine on which tomcat etc. runs.

那么有什么办法可以在tomcat服务器中运行nodejs服务器,还是我想错了?

So is there any way I can run the nodejs server inside tomcat server or am I thinking about it the wrong way ?

是的,你认为这是错误的方式。 Nodejs的关键特性是它包含一个相当天真的嵌入式HTTP服务器。想想码头。但是现在或将来可能可以在tomcat中运行JavaScript。

Yes, you are thinking of it it the wrong way. The key feature of Nodejs is that it contains, amongst other things, a rather natty embedded HTTP server. Think Jetty. However it might be possible now or in the future to run JavaScript in tomcat.

我建议去http://nodejs.org/ 并观看视频,肯定会为您解决此事。

I recommend going to http://nodejs.org/ and watching the video, it will surely clear the matter up for you.

同时我建议主持包括SSH访问,最好是root访问。 Root访问将使安装节点更容易整个加载,并允许您在常用端口上运行它(避免以root身份运行节点,使用端口映射)。但是你不需要一个单独的Web服务器来开始,你可以在windows,mac和linux上安装Node.js.

Meanwhile I would recommend getting hosting which includes SSH access, and preferably root access. Root access will make installing node a whole load easier and allow you to run it on a commonly used port (avoid running node as root, use port mapping) . But you don't need a seperate web server to get started, you can install Node.js on windows, mac and linux.