git 部署时出现 aws beanstalk 403 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23578567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
aws beanstalk 403 error while deploying
提问by user1424508
Hi I'm using amazon web services elastic beanstalk. Everytime I use git aws.push, my php application uploads successfully However, when I click on the url it says
嗨,我正在使用亚马逊网络服务弹性 beantalk。每次我使用 git aws.push 时,我的 php 应用程序都会成功上传但是,当我点击 url 时,它说
Forbidden You don't have permission to access / on this server.
Forbidden You don't have permission to access / on this server.
My server specs:
我的服务器规格:
64bit Amazon Linux 2014.03 v1.0.2 running PHP 5.4
64 位 Amazon Linux 2014.03 v1.0.2 运行 PHP 5.4
What would be causing this? Thanks
什么会导致这种情况?谢谢
回答by user1424508
Credit to Rakesh Bollampally:
归功于 Rakesh Bollampally:
I think your application is inside a folder. If that is the case, change the EBS configuration for document root or have a file in root to redirect to that sub folder. To Change document root, go to EBS console>Application>configuration>Software configuration and change the "Document root" under "container options"
我认为您的应用程序在一个文件夹中。如果是这种情况,请更改文档根目录的 EBS 配置或在根目录中设置一个文件以重定向到该子文件夹。要更改文档根目录,请转到 EBS 控制台>应用程序>配置>软件配置并更改“容器选项”下的“文档根目录”
回答by Habeeb
If your laravel project is in a folder called AppFolder for instance on your local drive, do not generate your zip file by rightclicking on AppFolder. Use the below instead.
如果您的 Laravel 项目位于本地驱动器上名为 AppFolder 的文件夹中,请不要通过右键单击 AppFolder 来生成您的 zip 文件。请改用以下内容。
Open the AppFolder, highlight all files (includes your public folder) and select to add to anyName.zip (anyName can be AppFolder also). Upload this anyName.zip to your Beanstalk environment.
打开 AppFolder,突出显示所有文件(包括您的公共文件夹)并选择添加到 anyName.zip(anyName 也可以是 AppFolder)。将此 anyName.zip 上传到您的 Beanstalk 环境。
You may change the document root to '/public' go to EBS console>Application>configuration>Software configuration and change the "Document root" under "container options"
您可以将文档根目录更改为“/public”,然后转到 EBS 控制台>应用程序>配置>软件配置并更改“容器选项”下的“文档根目录”
回答by Gvs Akhil
Generally we have two ways to solve this issue:
一般我们有两种方法来解决这个问题:
Let's think you uploaded a zip file with folder named test. So after you uploaded it unzips the file and it pushes all the files into the folder named test.
假设您上传了一个文件夹名为 test 的 zip 文件。因此,在您上传后,解压缩文件并将所有文件推送到名为 test 的文件夹中。
So to access it we have 2 ways:
所以要访问它,我们有两种方法:
1st way: Get the url from aws elastic bean console and add your folder name at the end Ex: http://xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.com/test/index.php
第一种方式:从 aws 弹性 bean 控制台获取 url 并在末尾添加您的文件夹名称 例如:http: //xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.com/test/index.php
2nd way: Go to your EBS Console -> configuration -> software -> edit add /test in Document Root If we do that http://xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.comworks fine
第二种方式:转到您的 EBS 控制台 -> 配置 -> 软件 -> 在文档根目录中编辑 add /test 如果我们这样做http://xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.com工作正常
回答by Lecagy
The URL itself isn't the right adress to open your webpage. My webpage is organized in folders. To open the page with the local path "/views/index.html", the right URL would be "http://namespace.region.elasticbeanstalk.com/views/index.html".
URL 本身不是打开网页的正确地址。我的网页是按文件夹组织的。要使用本地路径“/views/index.html”打开页面,正确的 URL 将是“ http://namespace.region.elasticbeanstalk.com /views/index.html”。
This one works for me ;)
这个对我有用;)
回答by Akash Kashyap
This might help you better..
这可能会更好地帮助你..
The normal zip download from github will create issues for directories and subdirectories. Better use gitbash for zipping any file. If you're using Git to manage your application source code, use the git archive command to create your source bundle.
来自 github 的普通 zip 下载将为目录和子目录创建问题。最好使用 gitbash 来压缩任何文件。如果您使用 Git 来管理您的应用程序源代码,请使用 git archive 命令来创建您的源包。
$ git archive -v -o myapp.zip --format=zip HEAD