我想在 EC2 中部署我的应用程序(Nodejs + Mongodb)。在 EC2 实例中安装 Nodejs 和 MongoDb 后,我不知道如何将我的源代码上传到实例以及上传到哪里?
谢谢!
我想在 EC2 中部署我的应用程序(Nodejs + Mongodb)。在 EC2 实例中安装 Nodejs 和 MongoDb 后,我不知道如何将我的源代码上传到实例以及上传到哪里?
谢谢!
When you created your instances you should have also created an ssh key that you use to access the EC2 instance via SSH which you clearly have if you were able to install additional packages.
You can use this same key and method to connect to the instance with SFTP and upload the files you want like that.
You could also use scp to copy the files directly from the commandline or from a custom script.
With regard to where to upload the files - that all depends on you. What web servers are you using (if at all). Depending on your application you need to select a location that is accessible via your web server. The default location for an apache server would be /var/www
您可以使用 WinScp ( https://winscp.net/eng/download.php ) 对您的 EC2 linux 进行“类似浏览器”的访问:
注意:ppk 私钥是使用 AWS 的“node.pem”密钥创建的。但是您必须通过运行使其可访问:
chown :Users node.pem
chmod 400 node.pem