Deploy Laravel on Elastic Beanstalk with Mysql:
1. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html
2. Install amazon comman line interface in system.
sudo apt-get install python-pip
sudo pip install awscli
3. To check it is installed
aws help
4. Then Install
sudo pip install awsebcli
5. Then go to the https://us-west-2.console.aws.amazon.com/elasticbeanstalk/home?region=us-west-2#/applications and create the new application and write the name and description.
6. After that you will get the option for upload or select the simple php application. So then select the sample php application and do not upload your project.
7. After then your new enviornment is created.
8. Then go to your appplication example www/var/laravel and then write command
eb init
9. That will ask few details like (Access Key ID and Secret Access Key) for that go to your profile then you will see the security credentials then select Access Keys (Access Key ID and Secret Access Key) and generate new security key. Will also ask to select server so select the default one.
10. Then run the command eb deploy.
11. https://us-west-2.console.aws.amazon.com/rds/home?region=us-west-2 then go this link and create the mysql instance here.
12.After creating the instance you can the instance on clicking on instance on the left menu .
13. Now copy the End point and paste in the mysql workbench host name and port:3306. Also put the password that you given while creating the instance. Now your db is created.
14. So now when you will go to the generated url in the enviornment you will see the file not found so then append /public in the url and you will see your application running will ciper key error.
15. To fix that go to the Configuration menu in the left side and do to the software configuration and will see the in the botton envornment variables to put all your enviornment variables here.
Eg.
Property Name Property Value
APP_KEY base64:/hjkhjkhkjhkdfgdgdfgjhjk/hjk++rA=
So this is how to setup laravel enviornment on the aws elastic beanstalk.
Here is the video tutorial that will help in the process.
https://www.youtube.com/watch?v=rvxucBBDlPQ
Comments
Post a Comment