{"id":21818,"date":"2015-06-29T16:38:51","date_gmt":"2015-06-29T11:08:51","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=21818"},"modified":"2015-12-12T11:15:20","modified_gmt":"2015-12-12T05:45:20","slug":"aws-opsworksphp-app-deployment-using-git","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/aws-opsworksphp-app-deployment-using-git\/","title":{"rendered":"AWS OpsWorks: PHP App Deployment using Git"},"content":{"rendered":"<p>AWS OpsWorks is a service which can be used to manage applications and can be used to operate applications of all shapes and sizes. In this blog we will discuss steps to automate a PHP app using AWS OpsWorks and Git. OpsWorks is <a href=\"http:\/\/www.tothenew.com\/devops-aws\">an AWS service that can be used<\/a> to automate the different kinds of app deployments. It is highly versatile as it can be used to deploy applications of Ruby, Java, PHP, Angular.js and node.js etc.\u00a0OpsWorks basically uses chef in the backend for automation and configuration management\u00a0purposes.<\/p>\n<p>Refer <a href=\"http:\/\/www.tothenew.com\/blog\/using-custom-chef-recipes-in-aws-opsworks\/\">here<\/a> to know about launching an instance using AWS OpsWorks. Steps to deploy PHP app\u00a0after successfully\u00a0launching an instance using OpsWorks are listed below.<\/p>\n<p>When we click on the Apps on AWS OpsWorks Console, then we will get console shown below.<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21916\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-28-094430.png\" alt=\"Screenshot from 2015-06-28 09:44:30\" width=\"865\" height=\"227\" \/>1) First of all generate a ssh keypair\u00a0by:-<\/p>\n<p>[js]ssh-keygen -t rsa [\/js]<\/p>\n<p><span style=\"color: red\">NOTE:<\/span> We have to generate the ssh keypair for root user as OpsWorks deploys the app as root user.<br \/>\nNow, we copy the private SSH key generated which is present in the \/root\/.ssh\/id_rsa, then:<br \/>\nIn\u00a0\u00a0&#8220;Repository SSH key&#8221; we put the Private SSH Key of the instance, and\u00a0further can be read <a href=\"http:\/\/docs.aws.amazon.com\/opsworks\/latest\/userguide\/workingapps-deploykeys.html\">here<\/a>.<\/p>\n<p>2) Click on &#8220;Add an app&#8221; button, we get console asking for details of the app. Choose the option as shown in the snapshot below:-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-22029\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-29-143145.png\" alt=\"Screenshot from 2015-06-29 14:31:45\" width=\"765\" height=\"743\" \/><\/p>\n<p>After filling all the details, click on &#8220;Add App&#8221; button at the bottom of\u00a0page to add and list the app as shown below,<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21921\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-28-094558.png\" alt=\"Screenshot from 2015-06-28 09:45:58\" width=\"743\" height=\"217\" \/><\/p>\n<p>Now, we are going to deploy the app by clicking the &#8220;Deploy&#8221; button and check the satus\u00a0of the app.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21923\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-28-094620.png\" alt=\"Screenshot from 2015-06-28 09:46:20\" width=\"819\" height=\"270\" \/><\/p>\n<p>Wait for a few seconds to see our app running.<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-21924\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-28-094954.png\" alt=\"Screenshot from 2015-06-28 09:49:54\" width=\"773\" height=\"250\" \/><br \/>\nAnd now when we hit the address of the instance and we can check that our app is running.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-22090\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/Screenshot-from-2015-06-28-0950393.png\" alt=\"Screenshot from 2015-06-28 09:50:39\" width=\"1114\" height=\"429\" \/><\/p>\n<p>Our basic idea of using AWS OpsWorks is to automate the app deployment, and when we push something on the repository, then we have to just click on deploy button, and all the changes will be successfully implemented.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS OpsWorks is a service which can be used to manage applications and can be used to operate applications of all shapes and sizes. In this blog we will discuss steps to automate a PHP app using AWS OpsWorks and Git. OpsWorks is an AWS service that can be used to automate the different kinds [&hellip;]<\/p>\n","protected":false},"author":261,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1},"categories":[1174],"tags":[1935],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/21818"}],"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\/261"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=21818"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/21818\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=21818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=21818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=21818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}