简体   繁体   English

在AWS EC2上部署应用

[英]Deploy app on AWS EC2

I am using Windows 10. I have created an AWS EC2 Linux instance, following the instructions on the AWS tutorial . 我正在使用Windows10。我已经按照AWS教程中的说明创建了一个AWS EC2 Linux实例。 I have successfully connected to my instance with WinSCP , but now I don't know how to upload my app (only javascript) to the server and make it run. 我已经使用WinSCP成功连接到我的实例,但是现在我不知道如何将我的应用程序(仅JavaScript)上传到服务器并使其运行。 The tutorial only explains how to use Drupal. 本教程仅说明如何使用Drupal。 I do not want to use Drupal. 我不想使用Drupal。 The 3rd party explanations are specific to certain frameworks. 第三方的解释特定于某些框架。 Can some one please tell me what the next steps are to deploy my app? 有人可以告诉我下一步要部署我的应用程序吗?

Thank you. 谢谢。

Amazon EC2 is a virtual machine. Amazon EC2是虚拟机。 For your purposes, think of it as a server. 为了您的目的,请将其视为服务器。 This means that it does nothing except provide you with an operating system and some "disk" space. 这意味着除了为您提供操作系统和一些“磁盘”空间外,它什么也不做。 Any applications you want on it need to be installed yourself. 您要安装的任何应用程序都需要自己安装。 So, if you want to spin up your own instance and run a Javascript application, you would need to install whatever applications you need (eg Drupal, Wordpress, Apache, etc.). 因此,如果您想启动自己的实例并运行Javascript应用程序,则需要安装所需的任何应用程序(例如Drupal,Wordpress,Apache等)。 For starting out, I would suggest you take a look at the various AMI's that are out there, Bitnami has created a number of them. 首先,我建议您看一下现有的各种AMI,Bitnami创建了许多AMI。 You mentioned you DON'T want to use Drupal; 您提到您不想使用Drupal; would you rather use Wordpress? 您愿意使用Wordpress吗? I'm not familiar with any of the CMS'. 我不熟悉任何CMS。

https://aws.amazon.com/marketplace/pp/B007IP8BKQ https://aws.amazon.com/marketplace/pp/B007IP8BKQ

Or, Bitnami has a LAMP AMI you can use. 或者,Bitnami有可以使用的LAMP AMI。

https://aws.amazon.com/marketplace/pp/B007IN7GJA https://aws.amazon.com/marketplace/pp/B007IN7GJA

Another way to go is to use the Elastic Beanstalk service. 另一种方法是使用Elastic Beanstalk服务。 Beanstalk starts up an EC2 instance for you and offers a preconfigured web-server environment that you deploy your application into, one of which is Node.js. Beanstalk为您启动了一个EC2实例,并提供了一个预配置的Web服务器环境,您可以将应用程序部署到该环境中,其中一个便是Node.js。 Its documentation is available here: 它的文档可以在这里找到:

https://aws.amazon.com/documentation/elastic-beanstalk/ https://aws.amazon.com/documentation/elastic-beanstalk/

The 3rd party link you referenced was for MEAN (Mongo, Express, Angular, Node). 您引用的第三方链接用于MEAN(Mongo,Express,Angular,Node)。 Are you trying to setup a MEAN application? 您是否要设置MEAN应用程序? If so, Elastic Beanstalk may not be the way to go, as there will likely be a lot of configuration to get Angular and Express setup and the configuration process is not straight forward...and so an EC2 instance may be better, at least to start out with. 如果是这样的话,Elastic Beanstalk可能不是要走的路,因为可能会进行很多配置来进行Angular和Express设置,并且配置过程不是一帆风顺的……因此,至少,EC2实例可能更好。首先开始。

If it's a simple PHP backend / Javascript frontend application, Beanstalk would be fine (just be sure that you're NOT deploying code directly to the EC2 instance that gets created as it will NOT persist indefinitely). 如果它是一个简单的PHP后端/ Javascript前端应用程序,那么Beanstalk会很好(请确保您没有将代码直接部署到创建的EC2实例上,因为它不会无限期存在)。 Any changes to the website or JS code must be deployed via the Beanstalk application. 网站或JS代码的任何更改都必须通过Beanstalk应用程序进行部署。

So, without knowing what environment you're looking to host your application in, it's impossible to provide any further advice, but you can start there. 因此,在不知道要在哪个环境中托管应用程序的情况下,不可能提供任何进一步的建议,但是您可以从那里开始。

If you want to provide any further information on what you're trying to do, edit your question and I can help further. 如果您想提供有关您要做什么的更多信息,请编辑问题,我们将为您提供进一步的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM