سؤال

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

هل كانت مفيدة؟

المحلول

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"

نصائح أخرى

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"

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

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

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 ;)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top