I'm a beginner on cloud providers, and I have a website to deploy. The website is made with PHP, HTML, CSS and Javascript, and it uses an API developed on NodeJS to access a database.
Is there a way to deploy all of this (Inteface + NodeJS API) on one AWS Elastic Beanstalk application? Or should I deploy only the API on AWS Elastic Beanstalk and deploy the website's interface with other AWS solution, e.g. a static website on Amazon S3.
I'm really lost on so many solutions, can someone give me some tips on this scenario?
One solution is you can deploy PHP application using Elastic Beanstalk and then apply edits to the configuration file of Elastic Beanstalk to Install Nodejs on the EC2 instance.
Or another solution is you can setup you PHP and Node application on a standalone EC2 instance and after everything is set you can create the AMI of that instance and use it in Elastic beanstalk .
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.customenv.html
Related
Recently I have been involved in a project where I have set up a LAMP stack in AWS and also helping out the team for building other infrastructure. As per company policy, we need to create a new instance in every 60 days taking the latest ami and kill the previous one. For this reason, I requested the development team to move the php code to git repo. This would help me automate the build so that I can directly pull the code from git. But, they are saying they don't want to move the code in git for some licensing reason as the code they are using have been purchased from phpgrid (vendor). This is little strange to me...anyways, if the code is NOT in git, how can we automate the code deployment in webserver? Any thoughts on the best practices? Don't want to ftp the code from someone's machine :(
AWS Code Deploy service is purpose-built for code deployments like this.
AWS CodeDeploy is part of a family of AWS deployment services that
includes AWS Elastic Beanstalk, AWS CodePipeline, AWS CloudFormation,
and AWS OpsWorks. AWS CodeDeploy coordinates application deployments
to Amazon EC2 instances, on-premises instances, or both. (On-premises
instances are physical devices that are not Amazon EC2 instances.)
An application can contain deployable content like code, web, and
configuration files, executables, packages, scripts, and so on. AWS
CodeDeploy deploys applications from Amazon S3 buckets and GitHub
repositories.
You can use any repository really. You just need a process to move the code from its repo to an designated S3 bucket. The code can be anywhere: SVN, on-premise, etc. Just zip it up, move to S3 and register the revision and deploy as needed. A GIT repository is not required, but it is directly supported by CodeDeploy.
We integrate the process with Jenkins our Continuous Integration server so all builds are sent to S3 as a CodeDeploy-ready revision.
There is no cost for using this feature when deploying to AWS instances - its free!
Total newb question I'm sure but I'm new to S3 and trying to open a simple PHP file on my server. Yet it prompts to Save the file each time instead of opening it. Is S3 not able to run PHP files?
I believe Amazon S3 is a storage not a server.
Amazon S3:
Amazon Simple Storage Service (Amazon S3), provides developers and IT teams with secure, durable, highly-scalable object storage. Amazon S3 is easy to use, with a simple web service interface to store and retrieve any amount of data from anywhere on the web. With Amazon S3, you pay only for the storage you actually use. There is no minimum fee and no setup cost.
Link: https://aws.amazon.com/s3/
Amazon EC2:
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
Link: https://aws.amazon.com/ec2/
You want to get an instance from EC2 and install php on its linux server.
AWS has a great tutorial to do so here.
Basically AWS EC2 linux servers are the same as any other linux server except lots of features from AWS so you can follow other tutorials on how to install PHP on an Apache2 servers.
Good luck!
EDIT: However, you can host a static website. Static website is a website that shows the same content for all users. Basic informational websites are the example. As opposed to static website, dynamic website is a website that shows different contents for different users. The purpose of php script is to create a dynamic website, so you must look for other options than AWS S3. So EC2 would be great fit for you.
I'm trying to run an app on Amazon Elastic Beanstalk, this app is programmed in Symfony2 and is able to run in any normal server, however I want to use it in Amazon Elastic Beanstalk.
Until now I have uploaded the code using git(thanks to the tutorial: http://vincent.composieux.fr/article/deploy-a-symfony-project-on-amazon-elastic-beanstalk),
Then I also connected to the server using SSH.
But now I want to configurate the symfony2 app parameters inside parameters.yml, but I cannot find the root location of the app in the server, does anybody know where Amazon stores source code of such an web-app?
Under /var/www/html I couldn't find anything :S
Found the location myself /var/app/ondeck
thanks to http://vincent.composieux.fr/article/deploy-a-symfony-project-on-amazon-elastic-beanstalk
So I am trying out AWS (Amazon Web Services) and I figured out how to put my db and its information on their server however I am not sure as to where I will put my php web service which gives a JSON response. Is there a tutorial or can someone tell me how I can accomplish this?
Suppose you are going to use the LAMP stack. I would either install LAMP on your EC2 instance or find a community image that has LAMP already installed and create an instance using that image.
You can start with Amazon Lightsail which is a beginner friendly service to deploy applications.
Or you can put your Application in Elastic Beanstalk and use its build in RDS feature for your database.
Attached you see the documentation for deploying a PHP application.
I'm playing around with Elastic Beanstalk and I'm trying to figure out how I might add background-workers to my application.
Is there an easy way to launch an EC2 instance with the code that's on my elastic beanstalk application servers? And have the deploy mechanism that comes with Elastic beanstalk update these instances?
I am sorry I really have no idea about workers
But You can use AMAZON SDK and build an application to launch an ec2 instance based on regions and also you can specify AMI too , so there are various api calls from which you could get available regions , and also you can decide or building your own AMI with the required specification .