aws beanstalk 403 error while deploying

若如初见. 提交于 2020-07-20 07:53:30

问题


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

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

What would be causing this? Thanks


回答1:


Credit to 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"




回答2:


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.

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.

You may change the document root to '/public' go to EBS console>Application>configuration>Software configuration and change the "Document root" under "container options"




回答3:


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.

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

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.com works fine




回答4:


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".

This one works for me ;)




回答5:


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.

$ git archive -v -o myapp.zip --format=zip HEAD


来源:https://stackoverflow.com/questions/23578567/aws-beanstalk-403-error-while-deploying

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!