将 MEAN 堆栈应用程序部署到现有服务器

Deploy a MEAN stack application to an existing server

我在托管网站的 DigitalOcean 上有一个 Ubuntu 服务器,在托管另一个网站的 AWS 上有一个 Windows 服务器。

我刚刚在 MAC 上构建了一个 mean.js 堆栈应用程序,我打算将其部署到生产环境。

似乎大多数现有线程都在讨论使用新的专用服务器。比如this thread is about deploying on a new AWS EC2 instance; this video is about deploying on a new Windows Azure server; this是在DigitalOcean中新建一个droplet。

我的问题是,是否可以使用现有服务器(托管其他网站)而不是创建新服务器?如果是,在性能方面会有什么不同吗?

My question is, is it possible to use an existing server (which hosts other websites), rather than creating a new server?

是的。 Windows 和 Ubuntu 都允许您在同一个实例上部署多个应用程序。

对于 Ubuntu,您可以阅读 this post,这将帮助您为多个应用程序提供服务。 在此示例中使用了 Nginx,但您可以按照 this 示例并在没有任何服务器(如 Apache 或 Nginx)的情况下使用它。如果您需要子域,我建议使用带有反向代理模块和 pm2

的 Apache 虚拟主机

对于 Windows 及其 IIS 我建议使用 iisnode,在 google 中你可以找到很多关于如何配置它的文章。

will there be any difference in terms of performance?

这取决于您的应用程序,如果您已经在为处理大量流量并需要 CPU 和内存的应用程序提供服务,我不建议您在同一个实例上使用多个应用程序,但如果您打算要使用简单的网络应用程序,您可以轻松地使用相同的实例。

希望这个回答对您有所帮助!