Tutorial: Create a web server and an Amazon Aurora DB cluster - Amazon Aurora

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 AWS account. However, by completing this tutorial, you might incur costs for the AWS 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 specify the VPC, subnets, and security groups when you create the DB cluster. You also specify them when you create the EC2 instance to host your web server. The VPC, subnets, and security groups are required for the DB cluster and the web server to communicate. After the VPC is set up, this tutorial shows you how to create the DB cluster and install the web server. You connect your web server to your DB cluster in the VPC using the DB cluster writer endpoint.

  1. Complete the tasks in Tutorial: Create an Amazon VPC for use with a DB instance.

    Before you begin this tutorial, make sure that you have a VPC with both public and private subnets, and corresponding security groups. If you don't have these, complete the following tasks in the tutorial:

    1. Create a VPC with private and public subnets

    2. Create additional subnets

    3. Create a VPC security group for a public web server

    4. Create a VPC security group for a private DB instance

    5. Create a DB subnet group

  2. Create an Amazon Aurora DB cluster

  3. Create an EC2 instance and install a web server

The following diagram shows the configuration when the tutorial is complete.

            Single VPC Scenario