{"id":20912,"date":"2015-06-16T18:09:20","date_gmt":"2015-06-16T12:39:20","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=20912"},"modified":"2015-08-09T22:09:52","modified_gmt":"2015-08-09T16:39:52","slug":"aws-elastic-beanstalk-php","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/aws-elastic-beanstalk-php\/","title":{"rendered":"AWS Elastic Beanstalk ( PHP Application )"},"content":{"rendered":"<p>In continuation to my previous Blog on Elastic Beanstalk (Grails Application) , I would now tell you how to deploy a PHP application via Elastic Beanstalk. So, again, we will quickly go through what AWS Elastic Beanstalk does. It is deploying your application in the AWS Cloud without worrying about the infrastructure &amp; making your application production ready within few minutes.<\/p>\n<p>AWS Elastic Beanstalk supports PHP 5.3, 5.4, 5.5, 5.6 &amp; will soon be supporting PHP 6.0. In this blog we will deploy a simple WordPress site &amp; while going through all the necessary steps.<\/p>\n<p><span style=\"text-decoration: underline\"><span style=\"color: #ff6600;text-decoration: underline\"><strong>Steps to deploy a PHP application via Elastic Beanstalk<\/strong>\u00a0:-<\/span><\/span><\/p>\n<p>1. Go to your AWS Elastic Beanstalk console.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20962\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130249.png\" alt=\"Screenshot from 2015-06-12 13:02:49\" width=\"1329\" height=\"454\" \/><\/p>\n<p>2.Create a New Application. Choose the Type of application. For now EB Supports Docker, PHP, Java Tomcat, Ruby etc. For this we will use PHP 5. We will deploy a basic WordPress application.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20965\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130540.png\" alt=\"Screenshot from 2015-06-12 13:05:40\" width=\"1333\" height=\"317\" \/><\/p>\n<p>3.\u00a0Now, Create a new Environment. Choose Web Server.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20963\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130440.png\" alt=\"Screenshot from 2015-06-12 13:04:40\" width=\"1332\" height=\"436\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20966\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130659.png\" alt=\"Screenshot from 2015-06-12 13:06:59\" width=\"1342\" height=\"589\" \/><\/p>\n<p>Since at this point of time we don&#8217;t know the RDS endpoint &amp; the Elastic Beanstalk Environment URL we will choose sample application.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20967\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130854.png\" alt=\"Screenshot from 2015-06-12 13:08:54\" width=\"1344\" height=\"336\" \/><\/p>\n<p>5.\u00a0Select the required settings like Auto-scaled or single Instance Environment, VPC\/EC2. You can also select an SNS for reporting changes to your environment.\u00a0You will have to choose an existing database ( RDS ) or you can create a new one by choosing the DB option. Then if you have chosen to do all this inside a VPC, you need to select the VPC &amp; the subnets.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20968\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-130954.png\" alt=\"Screenshot from 2015-06-12 13:09:54\" width=\"1348\" height=\"579\" \/><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-20969\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-132249.png\" alt=\"Screenshot from 2015-06-12 13:22:49\" width=\"1346\" height=\"629\" \/><\/p>\n<p><span style=\"text-decoration: underline;color: #ff6600\"><span style=\"text-decoration: underline\"><strong>RDS options<\/strong> :<\/span>&#8211;<\/span><\/p>\n<ul>\n<li><strong>Snapshot<\/strong> : none<\/li>\n<li><strong>DB Engine<\/strong> : mysql<\/li>\n<li><strong>Instance Class<\/strong>: db.t2.micro (if you want to stay in the free tier)<\/li>\n<li><strong>Allocated Storage<\/strong>: 5 to 20 Gb (if you want to stay in the free tier)<\/li>\n<li><strong>Availability<\/strong>: Single Availability<\/li>\n<\/ul>\n<p>Now, VPC configurations for EC2 instances, ELB &amp; RDS. Remember ELB &amp; RDS would require two AZs.<\/p>\n<div>\n<div id=\"highlighter_278722\" class=\"syntaxhighlighter  jscript\">\n<div class=\"container\">\n<div class=\"line number4 index3 alt1\">\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-20975\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-132441.png\" alt=\"Screenshot from 2015-06-12 13:24:41\" width=\"751\" height=\"265\" \/><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\">6. After this the environment setup starts &amp; you can check the events in the recent events. Also, other configurations, Logs, Alarms &amp; monitoring can be managed from the Elastic Beanstalk Dashboard itself.<\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-20973\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-142113.png\" alt=\"Screenshot from 2015-06-12 14:21:13\" width=\"753\" height=\"285\" \/><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\">7. The last step is to change the endpoint, DB Name, username &amp; password for mysql in <strong>wp-config.php<\/strong> which should now look like :-<\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-20971\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-142209.png\" alt=\"Screenshot from 2015-06-12 14:22:09\" width=\"662\" height=\"305\" \/><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\">The reason for using &#8220;ebdb&#8221; is that Elastic Beanstalk by default creates a database with that name in the RDS.<\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\">Now, just create a zip of all the WordPress files &amp; upload via Elastic Beanstalk dashboard &amp; you can access previous application versions as well. Just hit the link given in the Elastic Beanstalk dashboard &amp; the following should open.<\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-20972\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-12-142137.png\" alt=\"\" width=\"725\" height=\"381\" \/><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number4 index3 alt1\">In my next blog on Elastic Beanstalk we shall talk about how we can use Elastic Beanstalk via API calls with integration with GIT.<\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In continuation to my previous Blog on Elastic Beanstalk (Grails Application) , I would now tell you how to deploy a PHP application via Elastic Beanstalk. So, again, we will quickly go through what AWS Elastic Beanstalk does. It is deploying your application in the AWS Cloud without worrying about the infrastructure &amp; making your [&hellip;]<\/p>\n","protected":false},"author":174,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":14},"categories":[1174],"tags":[248,1327,1701,1877],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20912"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=20912"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20912\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=20912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=20912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=20912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}