简体   繁体   English

Amazon EC2中的403错误

[英]403 Error in Amazon EC2

I tried posting this in the AWS forums but nobody has replied... 我尝试将其发布在AWS论坛中,但没有人回复...

I can get the sample PHP app to work but not my own uploaded PHP app 我可以使示例PHP应用程序正常工作,但不能使我自己上传的PHP应用程序正常工作

I've been terminating and retrying numerous environments and instances the last day or two trying to get this going ( I just signed up for the free tier, and am using micro instance(s) ) 在过去的一两天内,我一直在终止并重试许多环境和实例,以实现这一目标(我刚刚注册了免费套餐,并且正在使用微型实例)

Right now I have two environments in 'My First Elastic Beanstalk Application' (I've also tried this as two separate applications and got the same problem) 现在,我的“我的第一个Elastic Beanstalk应用程序”中有两个环境(我也尝试将其作为两个单独的应用程序,但遇到了同样的问题)

I can get SSH to work on both of them, but whenever I click 'view running version' from the elastic beanstalk section of the console I get '403 Forbidden' on the application I have uploaded, but am able to view the sample app in my browser just fine(same results whether they are in the same instance and/or environment, or if they are completely separate). 我可以让SSH在这两个版本上都可以使用,但是每当我从控制台的弹性beantalk部分单击“查看运行版本”时,我在上传的应用程序上都显示“ 403 Forbidden”,但可以在其中查看示例应用程序我的浏览器就很好(无论它们是在相同的实例和/或环境中,还是完全独立,结果都是一样的)。

When uploading my PHP app in MacOSX I right click and choose 'compress' on the containing folder and create a .zip before uploading (it seems to uncompress fine when viewing the files through SSH) 在MacOSX中上传我的PHP应用程序时,我右键单击并在包含的文件夹中选择“压缩”,然后在上传之前创建一个.zip文件(通过SSH查看文件时似乎解压缩得很好)

I just launched the sample env along with my own env and just noticed a difference in the events, the sample app creates AutoScaling info, CloudWatch, and adds the instance it creates to the environment. 我刚刚启动了示例环境以及自己的环境,并注意到事件有所不同,示例应用程序创建了AutoScaling信息CloudWatch,并将其创建的实例添加到环境中。 My app doesn't say any of those, but it does say that it is available at * *.elasticbeanstalk.com, it creates and instance in my ec2 that I am able to connect to by ssh, and it says it successfully launched, but is still not available in the browser 我的应用程序没有说明任何问题,但确实说它可以在* * .elasticbeanstalk.com上找到,它在我的ec2中创建了一个实例,并可以通过ssh连接到该实例,并说它已成功启动,但在浏览器中仍然不可用

As far as security groups, I have had them both set to be on the same group and I've tried them on separate groups either way I get the same error on my app but never the sample app. 至于安全组,我已经将它们都设置在同一个组中,并且我在单独的组中尝试了它们,但是我都在我的应用程序上遇到了相同的错误,但从未遇到示例应用程序。

on ssh i ran "ls -l" on var/www and saw that var/www/html has the same permission on each setup but it shows: lrwxrwxrwx 1 root root 16 Apr 6 23:07 html -> /var/app/current 在ssh上,我在var / www上运行了“ ls -l”,并且看到var / www / html在每个设置上都具有相同的权限,但显示:lrwxrwxrwx 1 root root 16 Apr 6 23:07 html-> / var / app /当前

I hadn't seem the html -> /var/app/current before, I went to that folder and found the permissions different, -rw-r--r-- was shown for all files on the sample PHP app, the directory containing my app was drwxr-xr-x -> and so I changed to drw-r--r-- and that didn't change the 403 errors... 我之前似乎没有html-> / var / app / current,我转到该文件夹​​,发现权限不同,-rw-r--r--对于示例PHP应用程序上的所有文件(目录)都显示了包含我的应用程序是drwxr-xr-x->所以我改成了drw-r--r--那并没有改变403错误...

I'm confused as to why the root directory of the app that I uploaded would be drwxr-xr-x doesn't that mean that all people have execute access? 我对为什么我上载的应用程序的根目录为drwxr-xr-x感到困惑,这并不意味着所有人都有执行权限吗? It seems like drw-r--r-- would be what I want. 好像drw-r--r--就是我想要的。 Giving me read/write access and everyone else just read access would seem like what a webserver should be right? 给我读/写访问权限,而其他所有人都只有读访问权限,这看起来像Web服务器应该是正确的?

Either way, because this is over my head I'm terminating the instance in which I changed permissions just to be safe until I hear some advice from people.. 无论哪种方式,因为这很麻烦,所以我要终止为安全起见更改权限的实例,直到听到别人的建议为止。

For me it seems to be either file permissions or the fact that I don't see 'added ** instance' to environment on my PHP app's environment events, but I DO see it on the sample app, what am I not doing? 对我来说,这似乎是文件许可权,或者是我的PHP应用程序的环境事件中没有在环境中看到“添加的**实例”,但我确实在示例应用程序中看到了,这是什么意思?

Thanks in advance... 提前致谢...

If you just select all the files required, and then compress these into an archive, and upload through the Beanstalk App on AWS, they will be present in the root directory. 如果仅选择所需的所有文件,然后将它们压缩到一个档案中,并通过AWS上的Beanstalk App上传,它们将出现在根目录中。 As Ruchit Rami mentioned, if you compress the folder itself, the files will be present under a directory of the file name. 如Ruchit Rami所述,如果您压缩文件夹本身,则文件将出现在文件名目录下。

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

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