Tutorial: Create a web server and an Amazon Aurora DB cluster
This tutorial helps you install an Apache web server with PHP and create a MySQL database. The web server runs on an Amazon EC2 instance using Amazon Linux, and the MySQL database is an Aurora MySQL DB cluster. Both the Amazon EC2 instance and the DB cluster run in a virtual private cloud (VPC) based on the Amazon VPC service.
There's no charge for creating an Amazon account. However, by completing this tutorial, you might incur costs for the Amazon resources you use. You can delete these resources after you complete the tutorial if they are no longer needed.
This tutorial works with Amazon Linux and might not work for other versions of Linux such as Ubuntu.
In the tutorial that follows, you create an EC2 instance that uses the default VPC, subnets, and security group for your Amazon Web Services account. This tutorial shows you how to create the DB cluster and automatically set up connectivity with the EC2 instance that you created. The tutorial then shows you how to install the web server on the EC2 instance. You connect your web server to your DB cluster in the VPC using the DB cluster writer endpoint.
The following diagram shows the configuration when the tutorial is complete.

After you complete the tutorial, there is a public and private subnet in each Availability Zone in your VPC. This tutorial uses the default VPC for your Amazon Web Services account and automatically sets up connectivity between your EC2 instance and DB cluster. If you would rather configure a new VPC for this scenario instead, complete the tasks in Tutorial: Create a VPC for use with a DB cluster (IPv4 only).