Node.js 部署问题
我的任务是本地化一个用 Node.js 构建的 Facebook 应用程序,据说该应用程序使用 Nginx 进行 SSL。
这是我第一次涉足 Node.js 的世界,在理解将节点应用程序推送到万维网(以便通过 facebook 访问它)所涉及的部署过程方面,我遇到了困难。
我有 javascript、AJAX、html 和 css 前端开发背景。以及后端PHP,和MYSQL。我并不担心本地化内容的任务,因为这只是交换几个图像的问题。这是我对 Node.js 难题如何在失败的地方拼凑起来的核心理解。更不用说 Nginx 是如何融入其中的。
我在网上做了很多搜索,发现了很多初学者教程,例如 http:// www.nodebeginner.org/ 很好,但没有涉及 Node Web 应用程序的部署方式。我可以在本地构建简单的 hello world 示例,但这如何成为“正确的 www.website”。还有大量其他资源,但它们需要更高级的理解和技术知识。我只是需要用外行的话来说。
我知道 Node.js 是服务器端 javascript,所以这显然意味着它存在于服务器上,对吗?我目前有域名、网站和托管计划,我可以使用该服务器吗?我通过 cpanel 或 ftp 访问它。或者我必须从头开始创建一个新服务器?也许虚拟服务器可能使用 https://www.virtualbox.org/ 这会涉及什么?
非常感谢您能给我的任何帮助。
干杯
Ive been given the task of localising a facebook app that is built in Node.js that am told uses Nginx for SSL.
This is my first foray into the world of Node.js and I have hit a wall in understanding the deployment process involved in pushing an node app to the world wide web (in order to access it through facebook).
I have a background in front-end development with javascript, AJAX, html and css. As well as backend PHP, and MYSQL. The task of localising the content I'm not worried about as it is only a matter of swapping out a couple of images. Its my core understanding of how the node.js puzzle fits together where it falls down. Not to metion how Nginx even fits in.
I have done alot of searching online and found a lot of beginners tutorials eg http://www.nodebeginner.org/ which is fine but doesn't touch on how node web apps are deployed. I can build the simple hello world example locally but how does this become a "proper www.website". There are also a tonne of other resources out there but they presume a more advanced level of understanding and technical know-how. I just need it in layman's terms.
I get that Node.js is server-side javascript so this obviously means it lives on a server right? i currently have a domain, website and hosting plan can i use this server? i access it through a cpanel or ftp. Or do i have to create a new server from scratch? Maybe a virtual server maybe using https://www.virtualbox.org/ what would be this involve?
any help you guy may be able to give me is much appreciated.
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,您可能无法在典型的“托管服务器”上使用 Node.js。这些服务器通常运行 Apache 并且仅支持有限的语言集。有多家提供商提供 Node.JS 托管,其中包括创建者:Joyent。
否则,您将需要控制实际服务器,以便可以运行
node myapp.js
命令。有关可能的提供程序的列表,请参阅此处。一旦应用运行
node myapp.js
,它就应该开始处理传入的 Web 请求,就像任何其他 Web 服务器一样。现在,如果有人使用 nginx,他们可能会将其用作负载平衡器或提供静态内容。如果您不明白如何或为何以这种方式配置,您绝对需要与项目所有者交谈。其余细节完全取决于您的托管位置/方式以及 nginx 问题的答案。
So, you probably won't be able to use Node.js on a typical 'hosted server'. These servers are typically running Apache and only support a limited set of languages. There are several providers that offer Node.JS hosting, including the creators: Joyent.
Otherwise, you'll need control of the actual server so that you can run the
node myapp.js
command. For a list of possible providers, see here.Once you get the app running
node myapp.js
, it should start handling incoming web requests, just like any other web server. Now, if someone is using nginx, they're probably using it as a load-balancer or to serve static content.If you don't understand how or why it's configured this way, you definitely need to talk to the project owners. The rest of the details depend completely on where / how you're hosting and the answers to the nginx questions.