AWS OpsWorks: PHP App Deployment using Git

29 / Jun / 2015 by Aakash Garg 0 comments

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 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. OpsWorks basically uses chef in the backend for automation and configuration management purposes.

Refer here to know about launching an instance using AWS OpsWorks. Steps to deploy PHP app after successfully launching an instance using OpsWorks are listed below.

When we click on the Apps on AWS OpsWorks Console, then we will get console shown below.Screenshot from 2015-06-28 09:44:301) First of all generate a ssh keypair by:-

[js]ssh-keygen -t rsa [/js]

NOTE: We have to generate the ssh keypair for root user as OpsWorks deploys the app as root user.
Now, we copy the private SSH key generated which is present in the /root/.ssh/id_rsa, then:
In  “Repository SSH key” we put the Private SSH Key of the instance, and further can be read here.

2) Click on “Add an app” button, we get console asking for details of the app. Choose the option as shown in the snapshot below:-

Screenshot from 2015-06-29 14:31:45

After filling all the details, click on “Add App” button at the bottom of page to add and list the app as shown below,

Screenshot from 2015-06-28 09:45:58

Now, we are going to deploy the app by clicking the “Deploy” button and check the satus of the app.

Screenshot from 2015-06-28 09:46:20

Wait for a few seconds to see our app running.
Screenshot from 2015-06-28 09:49:54
And now when we hit the address of the instance and we can check that our app is running.

Screenshot from 2015-06-28 09:50:39

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.


Tag -

AWS OpsWorks

Leave a Reply

Your email address will not be published. Required fields are marked *