Amazon Elastic Compute Cloud (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. You can use Amazon EC2 to launch as many virtual servers as you want (you pay only for the resources that you consume). Amazon EC2 eliminates the need for customers to invest in procuring hardware, installing software, and managing infrastructure.
Amazon EC2 instances are running on physical hardware that is owned by Amazon, not by the user. Amazon does not charge any additional fees for using Amazon EC2. The main advantage of using this service is that it allows users to launch an instance in just a few minutes without having to install and manage operating systems or hardware.
Setting Up Ec2 Web Server
Step 1: Create a web server instance in AWS EC2
Go to the EC2 instance page and click Launch Instance. Select an AMI and choose an instance type. Click Step 2: Configure Instance Details. Under Instance Details, select the following options:
A1. Choose an Amazon Machine Image (AMI) (recommended)
A2. Choose an instance type
A3. Configure Security Group (recommended) – In Security Group, create a security group with access to port 80/tcp; click Add Rule to add a rule for port 80/tcp and click Save.
Amazon CloudFront is a fully managed global content delivery network (CDN) service that leverages Amazon’s cloud infrastructure to enable businesses to reliably deliver content to an audience. CloudFront receives HTTP and HTTPS requests, transmits the requests to your origin website, and returns the responses to the requester. You can use CloudFront as a standalone service or incorporate it into your existing AWS architecture.
There are several ways to install Apache on EC2:
You can install the latest version of Apache on Ubuntu 12.04 LTS as follows:
sudo apt-get update sudo apt-get upgrade sudo apt-get install apache2
Create a security group for your web server in AWS.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
On the navigation panel, choose Security Groups.
Create a security group and give it the name “my-web-security”. For the type of security groups, select Classic.
Selecting Classic creates a simple rule-based firewall that allows inbound traffic on TCP ports 80 (HTTP) and 443 (HTTPS).
Now click Add Rule and add two rules to allow HTTP and HTTPS traffic to your web server. The first rule allows TCP traffic on port 80 from anywhere, and the second rule allows TCP traffic on port 443 from anywhere (don’t forget to click Save).
This is a tutorial on how to install mariadb amazon linux 2 on a ec2 instance.
1. login to your aws account, click the ec2 tab and then click the Launch Instance button, you should see something like this:
2. Choose an Amazon Linux AMI, I will choose Amazon Linux 2 as my image, but you can choose any other image that suits your needs:
3. Click Next: Configure Instance Details and set up your database parameters as shown in the picture below:
4. Click Next: Add Storage and set up your storage parameters as shown in the picture below:
You can use a single database instance to host multiple websites. You can also host multiple database instances on a single instance. The following tutorials provide instructions for creating an Amazon RDS MariaDB DB instance and connecting it with a web server.
Connecting a MySQL Database Instance with a Web Server
This section shows how to connect a MySQL database instance with a web server in order to serve web traffic:
The article explains how to connect your Amazon RDS MySQL DB instance with an Apache web server running on an EC2 instance. It includes steps for creating the MySQL DB instance, connecting it with the web server, and configuring your website.
Install MariaDB on Amazon Linux 2
Amazon Linux is a free, fully compliant, and supported operating system for EC2. It includes all the features of Amazon Linux, plus MariaDB.
The following are the steps to install MariaDB on an Amazon Linux 2 instance:
Log in to your AWS account.
Navigate to the Instances page in the Management Console.
Click Launch Instance on the top menu bar.
Start by choosing an AMI from the list of available AMIs. This will be the starting point for your instance. You can choose any AMI that has MySQL installed, but we recommend using one of our official AMIs, which have been tested and tuned for best performance with our services.
Choose an instance type based on how many resources you want your instance to have (CPUs, RAM, storage). The bigger these numbers are, the more expensive they will be per hour but also more powerful. More powerful instances are suitable if you will be using multi-threaded applications or need higher performance than what a micro instance provides (for example, when running multiple database servers). We recommend using Micro or Small instances if possible because they cost less than other sizes.*
Install MariaDB 10.3 on Amazon Linux 2
This guide shows how to install MariaDB 10.3 on Amazon Linux 2.x, using the official RPMs released by MariaDB Corporation.
Prerequisites
To follow this guide, you will need an AWS account and an EC2 instance running Amazon Linux 2.x with sudo privileges and a public IP address. You can create this instance by following this guide: How To Create A Free AWS Account And Launch An EC2 Instance In Minutes On Any Cloud Platform.
Update the system packages:
sudo yum update -y
Install the required packages (MariaDB-client, MariaDB-server):
sudo yum install mariadb-server mariadb
In this tutorial, we are going to look at how to install Mariadb on Amazon Linux 2. We will be using the MariaDB repository provided by Amazon.
To get started, log in to your AWS account and click on the “EC2” button on the top navigation menu. Then select “Launch Instance” from the menu and click on “Community AMIs” tab.
Search for amazon-linux-mariadb-15.1 package from the search box and then click on it.
Click on “Launch” button and then select “Configure Instance Details” tab. Click on “Add Storage” button and select all three types of storage (EBS General Purpose SSD, EBS Provisioned IOPS SSD, and Magnetic). You can also add additional storage if you want but it is recommended not to add more than 10 TB of storage since it may impact performance. Then click on “Launch Instance” button again.