Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k points)

I am totally confused on how to host a Dynamic website created using PHP and MySQL in Amazon Cloud.

I went through Amazon S3 and I hosted a static website there!

Then I tried Amazon EC2 and I learned some aspects about the concept of VPC. I thought that the dynamic websites are hosting in Amazon Cloud using EC2. I followed some steps and they taught me how to launch a website using Drupal (But, I didn't want that !! )

No other tutorials on EC2 to deploy my web application was not found.

Then I found AWS Elastic Beanstalk, I uploaded a simple PHP document and I can see that deployed successfully.

But Still, I am not satisfied. Because I don't know which is the correct way to deploy my PHP application.

So can anyone direct me on Deploying a PHP MySQL Application in AWS?

1 Answer

0 votes
by (44.4k points)

Elastic Beanstalk or EC2 can be used. Elastic Beanstalk can be easily created and deployed. But you will have lesser options than EC2 to configure. I choose EC2 when you need a full-fledged application running on AWS. 

The steps are:

  • Login to your AWS management console and start a new EC2 instance. To start with, choose a Windows server (t2.micro - free tier eligible).
  • In “Step 6: Configure Security Group”, add Rules for at least HTTP, HTTPS and RDP.
  • Connect to the instance via Remote Desktop and install a browser to download required applications.  
  • Open your Windows Firewall and add rules for the same ports which you have opened in the security group of your instance. Go to Inbound Rules and then select New Rule.
  • Download and install XAMPP. It will automatically be installed to C: drive.
  • Now, open XAMPP Control Panel and install Apache, MySQL as services. Keep everything started.
  • Now put your PHP files inside this folder - C:\xampp\htdocs and your application are ready.

Also, follow these steps for further flexibility.

  • Download Filezilla FTP server so that you can download/upload data to your instance without making a remote desktop connection.

  • Also, get an Elastic IP and an SSL certificate. Elastic IP so that your IP address will not change. And SSL certificate so that you can use HTTPS.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories