Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting CakePHP app with Amazon Web Services (EC2, etc.)?

I don't think I fully understand Amazon Web Services yet, which is why I'm asking this question. I want to know if AWS would be a nice host for a CakePHP application that of course runs off PHP, and MySQL?

Would I have to change or add anything to my code if used a service like EC2? I also noticed that Amazon has it's own database system, does that mean no mysql.

Also as a side question, what do you guys think of the cost AWS?

Sorry if my question is a little scattered, or somewhat "noobish," but that is why I ask it. Thanks in advance!

like image 965
Amir Rustamzadeh Avatar asked Aug 03 '10 09:08

Amir Rustamzadeh


People also ask

How do I host an EC2 web app?

Create an AWS CDK stack with an Amazon EC2 instance, a security group with inbound access, and an IAM instance profile. Install software packages on the EC2 instance's first launch by creating a user data asset. Configure the software packages after installation using a script downloaded by the user data.

Is Amazon EC2 for hosting?

Use Amazon Elastic Cloud Computing (Amazon EC2) Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. To use EC2 to host your website, you will need to create and configure an EC2 instance in the AWS Management Console.

Can I host PHP in AWS?

A: You can host Laravel, CodeIgniter, CakePHP, Symfony, and many other PHP frameworks on AWS Cloud servers. All of these frameworks are quite advanced and provides optimized features to be deployed with PHP7 AWS EC2 servers.


2 Answers

It seems this question has been answered 2 weeks ago. Yes, my current company hosted their CakePHP app (1.2.1, production & development) on AWS Asia Pacific (singapore) and EU West (Ireland). Both production and development servers are m1.xlarge (standard 4-core, 15GB, Fedora 8 64-bit). We tried LAMP starter before, but it's too small and cannot handle web traffic demand.

Basically you don't have change your code, unless you have reached the milestone having enough traffic that forces you to switch to CloudFront (CDN), RDS, and Load Balancer features (that's currently I am doing now.) But you have been warned to plan it as early as possible.

For the cost, the bill we received for June is around USD$550 ~ 600 (roughly m1.xlarge server running 24x7), and for July is USD$1100 ~ 1200 (roughly two m1.xlarge server running 24x7.) This would give you the idea how much it cost.

like image 170
Ming Hsieh Avatar answered Sep 30 '22 13:09

Ming Hsieh


unless you need a dedicated instance just for your cakephp application you may be better off using a host that provides a full lamp hosting stack on a shared server.

with aws you would need to create an instance, configure that instance, eg install mysql if that is what you want, etc.

then you pay-per-hour while it is running, so for a full year it would be like 24*365*12c = $1050 approx. (you will need to check the exact rates for what you want)

like image 45
bumperbox Avatar answered Sep 30 '22 11:09

bumperbox