gpt4 book ai didi

node.js - 如何在Hostgator VPS上设置基于node.js和socket.io的应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 00:38:51 25 4
gpt4 key购买 nike

我在 Hostgator 中有 VPS 计划,我有一个基于 socket.io 和 node.js 的聊天应用程序。我想知道如何设置此应用程序以在 Hostgator 上工作。以及如何使其监听除端口 80,因为它已经用于运行基于 apache 的应用程序。

最佳答案

这个问题回答起来很长。首先,您可能需要将应用程序作为服务运行,如下所示:Running Node from hostgator's vps

由于端口 80 被阻止,您需要打开一个新端口,如下所述:how to install a node.js server at chat.mydomain.com on a hostgator vps hosting?

然后,如果您不希望仅从端口访问您的聊天应用程序,您可以安装 nginx 以通过子域访问它。不过,您应该从这里开始阅读:http://forums.hostgator.com/adding-nginx-vps-t93880.html

我三年前问过一个非常类似的问题,您可以在这里阅读:hostgator vps level 1 & node.js这导致我离开了 Hostgator,转而使用 digitalocean 来处理我的所有 Node.js 应用程序。这是一种幸福,而且很快就能得到您所要求的一切并运行!

关于node.js - 如何在Hostgator VPS上设置基于node.js和socket.io的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37727099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com