AWS弹性魔豆 - 改变Web应用程序文件夹的所有者 [英] AWS Elastic Beanstalk - changing owner of webapp folder

查看:130
本文介绍了AWS弹性魔豆 - 改变Web应用程序文件夹的所有者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地创建使用AWS弹性魔豆的应用程序,并上传使用Git的应用程序。

I've successfully created an application using AWS Elastic Beanstalk and have uploaded the app using Git.

剩下的,我要做的就是创建我的settings.php文件,一切都应该工作。

All that's left for me to do is create my settings.php file and everything should work.

然而,当我通过SSH的使用方法用户EC2用户在 SSH记录连接弹性魔豆比如我无法浏览到Web应用程序目录中。下面是LS的输出-all

However when I connect via SSH as the user ec2-user using the method documented at SSH to Elastic Beanstalk instance I cannot navigate into the webapp directory. Here is output of ls -all

drwxr-xr-x  4 root     root     4096 Feb 10 16:21 .
dr-xr-xr-x 23 root     root     4096 Feb 10 16:23 ..
drwx------  3 ec2-user ec2-user 4096 Feb 10 16:41 ec2-user
drwx------  2 webapp   webapp   4096 Feb 10 16:21 webapp

当我尝试导航那里我得到:

And when I try to navigate there I get:

cd: webapp: Permission denied

我的问题是,我可以在Web应用程序文件夹的所有权更改为EC2用户的。如果我这样做,我会打破弹性魔豆?如果是的话,我很想知道其他人达到我所希望做的,这是不能跳过一个设置文件的Git的部署,以便它可以是从在亚马逊的版本在我的本地机器上的不同。

My question is, can I change the ownership of the webapp folder to that of ec2-user. If I do, will I break Elastic beanstalk? If so, I'd be interested to know how anyone else achieves what I am looking to do, which is not skip the Git deploy of a settings file so that it can be different on my local machine from that of the version on Amazon.

推荐答案

EC2用户的权限受到限制,而且可能不相同的运行你的应用程序的用户。使用Unix的须藤命令来执行管理任务,当你到你的EC2实例正在登录:

The permissions of the ec2-user are restricted, and probably not identical to the user running your application. Use the Unix sudo command to perform administrator tasks when you're logged on to your EC2 instance:

$ sudo ls webapp

然后,你可以很容易地看到事情是如何设置,并执行任何操作请你。只要记住,任何你做执行,可能会成为百废待兴,如果实例被创建。因此,您可能需要使用 的.config 文件,你应该自动希望此文件出现在由弹性魔豆创建任何新的EC2节点。

Then you're able to easily see how things are set up, and perform any actions you please. Just keep in mind that anything you DO perform, may become undone if the instance is recreated. Therefore, you may need to use .config files, should you automatically want this file to appear on any new EC2 nodes created by Elastic Beanstalk.

祝你好运!

这篇关于AWS弹性魔豆 - 改变Web应用程序文件夹的所有者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆