SlideShare a Scribd company logo
How To Create RDS Database in AWS for WordPress
i | P a g e
Table of Contents
Overview.......................................................................................................................................................1
Applies To......................................................................................................................................................1
Pre-Requisites ...............................................................................................................................................1
RDS Database................................................................................................................................................1
Launch RDS Console..................................................................................................................................1
Select Engine – Database..........................................................................................................................2
DB Instance – High Availability .................................................................................................................2
DB Instance – Specifications .....................................................................................................................3
DB Instance – Settings...............................................................................................................................3
DB Instance – Configure Advanced Settings.............................................................................................4
DB Instance – Database Options...............................................................................................................5
DB Instance – Backup................................................................................................................................5
Backup Retention Period ......................................................................................................................5
Backup Window ....................................................................................................................................6
DB Instance – Maintenance......................................................................................................................6
Auto Minor Version Upgrade................................................................................................................6
Maintenance Window...........................................................................................................................6
DB Instance – View Your DB Instance.......................................................................................................7
DB Instance – Launch Status - Creating ....................................................................................................8
DB Instance – Launch Status - Available ...................................................................................................8
DB Instance – Configure Security Group...................................................................................................9
DB Instance – Configure Security Group – Add Rule ................................................................................9
DB Instance – MySQL Workbench – Parameters....................................................................................10
DB Instance – Connect MySQL Workbench – SSL...................................................................................11
DB Instance – Connect MySQL Workbench............................................................................................12
DB Instance – RDS DB Connection – SSL CA Download..........................................................................13
MySQL – RDS DB Connection - SSL Certificate Connectivity...................................................................13
MySQL – SSL Certificate Connection – DB ..............................................................................................14
MySQL – Non SSL Connectivity ...............................................................................................................14
Configure SELinux .......................................................................................................................................15
SELinux – httpd .......................................................................................................................................15
How To Create RDS Database in AWS for WordPress
ii | P a g e
SELinux – httpd .......................................................................................................................................16
WordPress – Download Package ................................................................................................................16
WordPress - Extract Package ......................................................................................................................17
WordPress – Configure Database Parameters........................................................................................17
WordPress - Launch Portal......................................................................................................................18
Troubleshooting..........................................................................................................................................19
Error establishing a database connection...............................................................................................19
Error Message.....................................................................................................................................19
Cause...................................................................................................................................................19
Resolution ...........................................................................................................................................19
How To Create RDS Database in AWS for WordPress
1 | P a g e
Overview
One of the main features in AWS environment is RDS database, wherein database does need a server to
create a database. You just need to create a new instance and start utilizing the database service, once
you configure the security group and you need to establish connection via endpoint.
Applies To
RHEL 7, CentOS 7, AWS, RDS – MySQL
Pre-Requisites
 MySQL workbench (optional) if you want to connect from Windows machine
RDS Database
RDS Database.
It’s completely different from the way a conventional database where you build a server and install MySQL
server, client packages and create the database and create the required access privileges.
Launch RDS Console
Launch “RDS” from different AWS services from the AWS Management Services Console, when you click
on “RDS Dashboard” will be launched. If it’s a first time you are launching it, you will be seeing the below
screen, to create a new Instance, click on “Get Started Now”.
How To Create RDS Database in AWS for WordPress
2 | P a g e
Select Engine – Database
Next step is to choose database engine that needs to be created. In this document we are creating MySQL
instance, so click on “MySQL” and click on “Select” button.
DB Instance – High Availability
Next step is to choose whether the database have to be configured in “Multi-AZ Deployment” which is
the database would be configured in more than one availability zone for higher availability or choose it to
be a standalone database, typically for a non-production deployments.
How To Create RDS Database in AWS for WordPress
3 | P a g e
DB Instance – Specifications
Next step, after selecting DB Engine choose Instance options and configurations.
Options When to choose
DB Engine Version Choose the Version that you intend to deploy, typically depends on the
application compatibility
DB Instance Class Choose the compute, memory and workload, depends on workloads
Multi-AZ Deployment Choose, wherein High-availability is mandatory
Storage Type Depends on the application needs and IOPs required for the application
performance
Allocated Storage 5 GB Size
DB Instance – Settings
Next step, select the database settings and parameters.
Setting Purpose
DB Instance Identifier DB instance identifier, unique identifier for the AWS account
Master Username Set master username for the database
Master Password Set master password for the database
Confirm Password Set the master username password
How To Create RDS Database in AWS for WordPress
4 | P a g e
DB Instance – Configure Advanced Settings
Next step is to configure advanced settings, wherein security parameters is set or configured. Also ensure
that you download the “SSL Certificate” if you intend to connect securely, click on link “new certificate
bundle”
Setting Purpose
VPC If you intend to create new VPC wherein you DB will be configured on
different VPC and DB Subnet group
Subnet Group Default or new subnet group to be configured, according to the VPC option
Publicly Accessible If the database is accessible within VPC or publicly
Availability Zone Choose the default, ideally choose in the EC2 configured zone
VPC Security Group(s) Configure the authorized network to connect to database
How To Create RDS Database in AWS for WordPress
5 | P a g e
DB Instance – Database Options
Next step is to configure database options, wherein database options.
Setting Purpose
Database Name Database name to be created by the RDS installation process
Database Port Database service port to be configured
DB Parameter Group Choose the configuration setting for the version (container for the engine)
Option Group Amazon RDS uses option groups to enable and configure these features. An
option group can specify features, called options, that are available for a
particular Amazon RDS DB instance
Copy Tags To Group Select this option to have any DB instance tags copied to a DB snapshot
when you create a snapshot.
Enable Encryption Encrypt data transfer and data stored
DB Instance – Backup
Next step is to configure database backup retention and backup window options. These two options are
by default enabled.
Backup Retention Period
One of the feature wherein database or backup administrators take of is configuring backup and
subsequently retention period wherein the previous backup that needs to be retained. Currently it can
be configured anywhere between 1 to 35 days.
How To Create RDS Database in AWS for WordPress
6 | P a g e
Backup Window
When you configure Backup retention period, “Backup Window” should also be configured according to
the business needs and within stipulated timeframe. If you need the backup should be done at specific
time intervals, choose the “Backup Window” option and set the “Start Time” and “Duration” parameters.
Backup window should not be configured same as “Maintenance Window” and also ensure that you have
given sufficient time to complete the backup task, such that ongoing backup should not be disrupted.
See the “Maintenance Window”. Hence it is very import to configure backup windows that doesn’t
overlap with maintenance activity.
DB Instance – Maintenance
Once you have configured backup options. Next step is to configure “Maintenance”. There are two
options.
Auto Minor Version Upgrade
The first option is to choose the “Auto Minor Version Upgrade” wherein minor database upgrade will be
done automatically, when the option is set to “Yes”.
Maintenance Window
When you configure Upgrade to “Yes”, “Maintenance Window” should also be configured according to
the business needs. If you need the maintained activity to be implemented at specific time intervals,
choose the “Maintenance Window” option and set the “Start Time” and “Duration” parameters.
Maintenance window should not be configured same as “Backup Window” and also ensure that you have
given sufficient time to complete the backup task, such that ongoing backup should not be disrupted.
See the “Backup Window”. Hence it is very import to configure backup windows that doesn’t overlap
with maintenance activity.
After configuring this option, click on “Launch DB Instance”.
How To Create RDS Database in AWS for WordPress
7 | P a g e
DB Instance – View Your DB Instance
After configuring all the options and clicking on “Launch DB Instance”, you can view the launch status by
clicking the “View Your DB Instance” button.
How To Create RDS Database in AWS for WordPress
8 | P a g e
DB Instance – Launch Status - Creating
When you click on “View Your DB Instance” button, you DB instance current creation status will be
displayed. In order to connect the Database Instance that we launched, we will have to wait till the Status
is set / updated to “available” and “Endpoint” is shown.
DB Instance – Launch Status - Available
After creating the DB Instance is created, the status will be set to “available” and endpoint for the DB
instance will be displayed and the authorized networks will also be set. Endpoint is nothing but
“hostname” for MySQL client connect string and authorized is nothing but security groups configured list.
How To Create RDS Database in AWS for WordPress
9 | P a g e
DB Instance – Configure Security Group
In order to connect to the database you need to configure security group in the AWS Management console
with the IP Address range for the port 3306. To add a new rule or modify click on security “Group ID”.
Click on “InBound” tab and click on “Edit” button.
DB Instance – Configure Security Group – Add Rule
After adding the new rule, click on “Save” button. After that you can establish connection to the database.
Setting Purpose
Type Choose type of connection (MySQL/Aurora)
Database Port Automatically updated
Source Add access rule for the Source IP from where the database connection
would to be established
Connect from – Anywhere (0.0.0.0/0), My IP and Custom IP
How To Create RDS Database in AWS for WordPress
10 | P a g e
DB Instance – MySQL Workbench – Parameters
Once the instance status is set to “available”, Create a new the MySQL workbench connection. Configure
New connection as per the below parameters and click on “Test Connection” and “OK” button.
Parameters Values
Hostname copy and paste endpoint string from RDS Instance information
Username Username, set during the “DB instance – Settings” section
Password Password, set during the “DB instance – Settings” section
How To Create RDS Database in AWS for WordPress
11 | P a g e
DB Instance – Connect MySQL Workbench – SSL
Optionally, you can configure SSL Certificate downloaded from AWS Portal.
https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
Download the security file when configuring “Network & Security” option.
How To Create RDS Database in AWS for WordPress
12 | P a g e
DB Instance – Connect MySQL Workbench
Once saved, double click on the saved connection, you should be able to launch SQL query window.
Database server information is displayed.
How To Create RDS Database in AWS for WordPress
13 | P a g e
DB Instance – RDS DB Connection – SSL CA Download
Optionally, you can configure SSL Certificate downloaded from AWS Portal.
Download the SSL CA certificate for RDS database instance connection. When configuring the network &
security section click on download link “new certificate bundle”.
wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
MySQL – RDS DB Connection - SSL Certificate Connectivity
Connect the database with SSL certificate with specific database.
mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb
-pmywordpressdb --ssl-ca=/root/rds-combined-ca-bundle.pem -s
How To Create RDS Database in AWS for WordPress
14 | P a g e
MySQL – SSL Certificate Connection – DB
Connect the database with SSL certificate with specific database.
mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb
-pmywordpressdb --ssl-ca=/root/rds-combined-ca-bundle.pem -Dmywordpressdb
MySQL – Non SSL Connectivity
Connect the database without SSL certificate with specific database.
mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb -
pmywordpressdb -Dmywordpressdb
How To Create RDS Database in AWS for WordPress
15 | P a g e
Configure SELinux
One of the important step after configuring wordpress database is to configure SELinux and enable “httpd
network db connection”. This step is applicable when the SELinux is enabled.
SELinux – httpd
To list all SELinux attributes that can be configured httpd related SELinx parameters that can be configured
can be listed with command “getsebool -a | grep httpd” though we need to configure database
connectivity to get filter by below command.
getsebool -a | grep httpd_can_network
How To Create RDS Database in AWS for WordPress
16 | P a g e
SELinux – httpd
Modify current state of particular SElinux boolean; for httpd database connection via network should be
set to “on” to turn off modify the object to “off”, which is 0.
setsebool -P httpd_can_network_connect_db 1
WordPress – Download Package
Download the WordPress package on the server, run the command.
wget http://wordpress.org/latest.tar.gz
How To Create RDS Database in AWS for WordPress
17 | P a g e
WordPress - Extract Package
Extract the package in the DocumentRoot folder of Apache httpd server.
cd /var/www/html
tar -zxf latest.tar.gz
WordPress – Configure Database Parameters
Configure the database connection parameters for the WordPress portal in the configuration file “wp-
config.php”.
Setting Purpose
DB Name Configured database name (database – settings)
Master Username Configured username
Master Password Set master password for the database
Confirm Password Set the master username password
How To Create RDS Database in AWS for WordPress
18 | P a g e
WordPress - Launch Portal
Launch the WordPress portal and configure the Site Information, administrator username, password and
email ID. Once you are done posting administrator information click on “Install WordPress” button.
http://WordPressServerIP/wordpress/
How To Create RDS Database in AWS for WordPress
19 | P a g e
Troubleshooting
Error establishing a database connection
Error Message
Cause
SELinux is not configured to establish database connection for httpd service. To verify this run the
command;
getsebool -a | grep httpd_can_network
Resolution
Since WordPress connects to a database SELinux needs to be configured via httpd service, you need to
turn on SELinux attribute “httpd_can_network_connect_db”.
setsebool -P httpd_can_network_connect_db 1
How To Create RDS Database in AWS for WordPress
20 | P a g e

More Related Content

PDF
Installation CentOS 6.3
PDF
How To Install and Configure AWS CLI for Windows
PDF
Connect Amazon EC2 Linux Instance
PDF
How To Configure Amazon EC2 Security Groups
PDF
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
DOCX
How to Configure Amazon AWS EC2 Elastic IP Address
PDF
How To Install and Configure VSFTPD on RHEL 7 or CentOS 7
PDF
How To Configure FirewallD on RHEL 7 or CentOS 7
Installation CentOS 6.3
How To Install and Configure AWS CLI for Windows
Connect Amazon EC2 Linux Instance
How To Configure Amazon EC2 Security Groups
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
How to Configure Amazon AWS EC2 Elastic IP Address
How To Install and Configure VSFTPD on RHEL 7 or CentOS 7
How To Configure FirewallD on RHEL 7 or CentOS 7

What's hot (20)

PDF
How To Install and Configure Apache SSL on CentOS 7
PDF
How To Connect Amazon AWS EC2 with Key Pair – Linux
PDF
How To Install and Configure AWS CLI on RHEL 7
PDF
How to Change Hostname in CentOS 7 or RHEL 7
PDF
How To Create EC2 instance Linux Server
PDF
How To Configure Apache VirtualHost on RHEL 7 on AWS
PDF
How To Install OpenFire in CentOS 7
PDF
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
PDF
Install VMWare Tools CentOS 7
PDF
How to install and configure firewall on ubuntu os
PDF
How To Configure Amazon EC2 Load Balancer
DOCX
How to configure amazon ec2 load balancer
PDF
How to Install and Configure Cacti on Linux
PDF
Amazon AWS Identity Access Management
PDF
How to Install MariaDB Server or MySQL Server on CentOS 7
PDF
Install and Configure RSyslog – CentOS 7 / RHEL 7
PDF
How To List Nginx Modules Installed / Complied on CentOS 7
PDF
How to Upgrade Openfire on CentOS 7
PDF
Batch script for nslookup range of ip address
PDF
How To Install and Configure Open SSH Server on Ubuntu
How To Install and Configure Apache SSL on CentOS 7
How To Connect Amazon AWS EC2 with Key Pair – Linux
How To Install and Configure AWS CLI on RHEL 7
How to Change Hostname in CentOS 7 or RHEL 7
How To Create EC2 instance Linux Server
How To Configure Apache VirtualHost on RHEL 7 on AWS
How To Install OpenFire in CentOS 7
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
Install VMWare Tools CentOS 7
How to install and configure firewall on ubuntu os
How To Configure Amazon EC2 Load Balancer
How to configure amazon ec2 load balancer
How to Install and Configure Cacti on Linux
Amazon AWS Identity Access Management
How to Install MariaDB Server or MySQL Server on CentOS 7
Install and Configure RSyslog – CentOS 7 / RHEL 7
How To List Nginx Modules Installed / Complied on CentOS 7
How to Upgrade Openfire on CentOS 7
Batch script for nslookup range of ip address
How To Install and Configure Open SSH Server on Ubuntu
Ad

Viewers also liked (15)

PDF
How to Install Configure and Use sysstat utils on RHEL 7
PDF
How To Reset root Password on CentOS 7
PDF
How To Install and Configure Splunk on RHEL 7 in AWS
PDF
How To Manage Services on RHEL 7 or CentOS 7
PDF
How to Manage journalctl Logging System on RHEL 7
PDF
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
PDF
SystemD Usage Guide
PDF
How To Install and Configure Chrony on RHEL 7
PDF
How To Manage Linux User on RHEL 7
PDF
LSOF Command Usage on RHEL 7
PDF
Configure Run Levels RHEL 7 or CentOS 7
PDF
How To Check file exists and Delete PowerShell
PDF
How To Install and Use ABRT CLI on RHEL 7
PDF
How To View Current Execution Policy PowerShell
PDF
DNF Failed To Open Cache
How to Install Configure and Use sysstat utils on RHEL 7
How To Reset root Password on CentOS 7
How To Install and Configure Splunk on RHEL 7 in AWS
How To Manage Services on RHEL 7 or CentOS 7
How to Manage journalctl Logging System on RHEL 7
How To Install and Configure Log Rotation on RHEL 7 or CentOS 7
SystemD Usage Guide
How To Install and Configure Chrony on RHEL 7
How To Manage Linux User on RHEL 7
LSOF Command Usage on RHEL 7
Configure Run Levels RHEL 7 or CentOS 7
How To Check file exists and Delete PowerShell
How To Install and Use ABRT CLI on RHEL 7
How To View Current Execution Policy PowerShell
DNF Failed To Open Cache
Ad

Similar to How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7 (20)

PPTX
Databases on aws part 1
PDF
Awsgsg wah-linux
PDF
Awsgsg wah-linux
PPTX
Spring boot-application
PDF
Awsgsg wah
PDF
Awsgsg wah
PDF
Accessing my sql_from_java
PDF
AWS essentials EC2
PDF
Connect to RDS MySQL 101: Your Easy Guide on How to Banish Glitches | The Ent...
PDF
How to become cloud backup provider
PPTX
Creating a RDS MySQL instance from AWS Console and CloudFormation
PPTX
2015 SQL Pass Summit Breakfast session #1
PPTX
Databases overview & concepts
PDF
Rapid deployment of Sitecore on AWS
PDF
How to Become Cloud Backup Provider
PPTX
Word press site
PDF
Backup and recovery_of_sap_systems_on_aws_v2-0
PDF
How to Install WordPress on AWS.pdf
PDF
Configuring amazon-rds-as-peoplesoft-database
DOCX
SAP SQL Anywhere High Availability Tutorial for Business Objects
Databases on aws part 1
Awsgsg wah-linux
Awsgsg wah-linux
Spring boot-application
Awsgsg wah
Awsgsg wah
Accessing my sql_from_java
AWS essentials EC2
Connect to RDS MySQL 101: Your Easy Guide on How to Banish Glitches | The Ent...
How to become cloud backup provider
Creating a RDS MySQL instance from AWS Console and CloudFormation
2015 SQL Pass Summit Breakfast session #1
Databases overview & concepts
Rapid deployment of Sitecore on AWS
How to Become Cloud Backup Provider
Word press site
Backup and recovery_of_sap_systems_on_aws_v2-0
How to Install WordPress on AWS.pdf
Configuring amazon-rds-as-peoplesoft-database
SAP SQL Anywhere High Availability Tutorial for Business Objects

More from VCP Muthukrishna (20)

PDF
How to Fix Duplicate Packages in YUM on CentOS 7
PDF
How To Install and Configure GNome on CentOS 7
PDF
How To Connect to Active Directory User Validation
PDF
How To Connect To Active Directory PowerShell
PDF
How To List Files on Remote Server - PowerShell
PDF
How To List Files and Display In HTML Format
PDF
How To Check and Delete a File via PowerShell
PDF
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
PDF
How To Setup SSH Keys on CentOS 7
PDF
Windows PowerShell Basics - How To List PSDrive Info
PDF
Windows PowerShell Basics – How To Create powershell for loop
PDF
How To Construct IF and Else Conditional Statements
PDF
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
PDF
How To Create Power Shell Function Mandatory Parameter Value
PDF
How To Create PowerShell Function
PDF
How To Disable IE Enhanced Security Windows PowerShell
PDF
How To Check IE Enhanced Security Is Enabled Windows PowerShell
PDF
How To Configure Nginx Load Balancer on CentOS 7
PDF
Nginx bind() to 0.0.0.0:9080 failed
PDF
How To Install and Configure Screen on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7
How To Install and Configure GNome on CentOS 7
How To Connect to Active Directory User Validation
How To Connect To Active Directory PowerShell
How To List Files on Remote Server - PowerShell
How To List Files and Display In HTML Format
How To Check and Delete a File via PowerShell
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
How To Setup SSH Keys on CentOS 7
Windows PowerShell Basics - How To List PSDrive Info
Windows PowerShell Basics – How To Create powershell for loop
How To Construct IF and Else Conditional Statements
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
How To Create Power Shell Function Mandatory Parameter Value
How To Create PowerShell Function
How To Disable IE Enhanced Security Windows PowerShell
How To Check IE Enhanced Security Is Enabled Windows PowerShell
How To Configure Nginx Load Balancer on CentOS 7
Nginx bind() to 0.0.0.0:9080 failed
How To Install and Configure Screen on CentOS 7

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PDF
Machine learning based COVID-19 study performance prediction
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
Machine learning based COVID-19 study performance prediction
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?

How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7

  • 1. How To Create RDS Database in AWS for WordPress i | P a g e Table of Contents Overview.......................................................................................................................................................1 Applies To......................................................................................................................................................1 Pre-Requisites ...............................................................................................................................................1 RDS Database................................................................................................................................................1 Launch RDS Console..................................................................................................................................1 Select Engine – Database..........................................................................................................................2 DB Instance – High Availability .................................................................................................................2 DB Instance – Specifications .....................................................................................................................3 DB Instance – Settings...............................................................................................................................3 DB Instance – Configure Advanced Settings.............................................................................................4 DB Instance – Database Options...............................................................................................................5 DB Instance – Backup................................................................................................................................5 Backup Retention Period ......................................................................................................................5 Backup Window ....................................................................................................................................6 DB Instance – Maintenance......................................................................................................................6 Auto Minor Version Upgrade................................................................................................................6 Maintenance Window...........................................................................................................................6 DB Instance – View Your DB Instance.......................................................................................................7 DB Instance – Launch Status - Creating ....................................................................................................8 DB Instance – Launch Status - Available ...................................................................................................8 DB Instance – Configure Security Group...................................................................................................9 DB Instance – Configure Security Group – Add Rule ................................................................................9 DB Instance – MySQL Workbench – Parameters....................................................................................10 DB Instance – Connect MySQL Workbench – SSL...................................................................................11 DB Instance – Connect MySQL Workbench............................................................................................12 DB Instance – RDS DB Connection – SSL CA Download..........................................................................13 MySQL – RDS DB Connection - SSL Certificate Connectivity...................................................................13 MySQL – SSL Certificate Connection – DB ..............................................................................................14 MySQL – Non SSL Connectivity ...............................................................................................................14 Configure SELinux .......................................................................................................................................15 SELinux – httpd .......................................................................................................................................15
  • 2. How To Create RDS Database in AWS for WordPress ii | P a g e SELinux – httpd .......................................................................................................................................16 WordPress – Download Package ................................................................................................................16 WordPress - Extract Package ......................................................................................................................17 WordPress – Configure Database Parameters........................................................................................17 WordPress - Launch Portal......................................................................................................................18 Troubleshooting..........................................................................................................................................19 Error establishing a database connection...............................................................................................19 Error Message.....................................................................................................................................19 Cause...................................................................................................................................................19 Resolution ...........................................................................................................................................19
  • 3. How To Create RDS Database in AWS for WordPress 1 | P a g e Overview One of the main features in AWS environment is RDS database, wherein database does need a server to create a database. You just need to create a new instance and start utilizing the database service, once you configure the security group and you need to establish connection via endpoint. Applies To RHEL 7, CentOS 7, AWS, RDS – MySQL Pre-Requisites  MySQL workbench (optional) if you want to connect from Windows machine RDS Database RDS Database. It’s completely different from the way a conventional database where you build a server and install MySQL server, client packages and create the database and create the required access privileges. Launch RDS Console Launch “RDS” from different AWS services from the AWS Management Services Console, when you click on “RDS Dashboard” will be launched. If it’s a first time you are launching it, you will be seeing the below screen, to create a new Instance, click on “Get Started Now”.
  • 4. How To Create RDS Database in AWS for WordPress 2 | P a g e Select Engine – Database Next step is to choose database engine that needs to be created. In this document we are creating MySQL instance, so click on “MySQL” and click on “Select” button. DB Instance – High Availability Next step is to choose whether the database have to be configured in “Multi-AZ Deployment” which is the database would be configured in more than one availability zone for higher availability or choose it to be a standalone database, typically for a non-production deployments.
  • 5. How To Create RDS Database in AWS for WordPress 3 | P a g e DB Instance – Specifications Next step, after selecting DB Engine choose Instance options and configurations. Options When to choose DB Engine Version Choose the Version that you intend to deploy, typically depends on the application compatibility DB Instance Class Choose the compute, memory and workload, depends on workloads Multi-AZ Deployment Choose, wherein High-availability is mandatory Storage Type Depends on the application needs and IOPs required for the application performance Allocated Storage 5 GB Size DB Instance – Settings Next step, select the database settings and parameters. Setting Purpose DB Instance Identifier DB instance identifier, unique identifier for the AWS account Master Username Set master username for the database Master Password Set master password for the database Confirm Password Set the master username password
  • 6. How To Create RDS Database in AWS for WordPress 4 | P a g e DB Instance – Configure Advanced Settings Next step is to configure advanced settings, wherein security parameters is set or configured. Also ensure that you download the “SSL Certificate” if you intend to connect securely, click on link “new certificate bundle” Setting Purpose VPC If you intend to create new VPC wherein you DB will be configured on different VPC and DB Subnet group Subnet Group Default or new subnet group to be configured, according to the VPC option Publicly Accessible If the database is accessible within VPC or publicly Availability Zone Choose the default, ideally choose in the EC2 configured zone VPC Security Group(s) Configure the authorized network to connect to database
  • 7. How To Create RDS Database in AWS for WordPress 5 | P a g e DB Instance – Database Options Next step is to configure database options, wherein database options. Setting Purpose Database Name Database name to be created by the RDS installation process Database Port Database service port to be configured DB Parameter Group Choose the configuration setting for the version (container for the engine) Option Group Amazon RDS uses option groups to enable and configure these features. An option group can specify features, called options, that are available for a particular Amazon RDS DB instance Copy Tags To Group Select this option to have any DB instance tags copied to a DB snapshot when you create a snapshot. Enable Encryption Encrypt data transfer and data stored DB Instance – Backup Next step is to configure database backup retention and backup window options. These two options are by default enabled. Backup Retention Period One of the feature wherein database or backup administrators take of is configuring backup and subsequently retention period wherein the previous backup that needs to be retained. Currently it can be configured anywhere between 1 to 35 days.
  • 8. How To Create RDS Database in AWS for WordPress 6 | P a g e Backup Window When you configure Backup retention period, “Backup Window” should also be configured according to the business needs and within stipulated timeframe. If you need the backup should be done at specific time intervals, choose the “Backup Window” option and set the “Start Time” and “Duration” parameters. Backup window should not be configured same as “Maintenance Window” and also ensure that you have given sufficient time to complete the backup task, such that ongoing backup should not be disrupted. See the “Maintenance Window”. Hence it is very import to configure backup windows that doesn’t overlap with maintenance activity. DB Instance – Maintenance Once you have configured backup options. Next step is to configure “Maintenance”. There are two options. Auto Minor Version Upgrade The first option is to choose the “Auto Minor Version Upgrade” wherein minor database upgrade will be done automatically, when the option is set to “Yes”. Maintenance Window When you configure Upgrade to “Yes”, “Maintenance Window” should also be configured according to the business needs. If you need the maintained activity to be implemented at specific time intervals, choose the “Maintenance Window” option and set the “Start Time” and “Duration” parameters. Maintenance window should not be configured same as “Backup Window” and also ensure that you have given sufficient time to complete the backup task, such that ongoing backup should not be disrupted. See the “Backup Window”. Hence it is very import to configure backup windows that doesn’t overlap with maintenance activity. After configuring this option, click on “Launch DB Instance”.
  • 9. How To Create RDS Database in AWS for WordPress 7 | P a g e DB Instance – View Your DB Instance After configuring all the options and clicking on “Launch DB Instance”, you can view the launch status by clicking the “View Your DB Instance” button.
  • 10. How To Create RDS Database in AWS for WordPress 8 | P a g e DB Instance – Launch Status - Creating When you click on “View Your DB Instance” button, you DB instance current creation status will be displayed. In order to connect the Database Instance that we launched, we will have to wait till the Status is set / updated to “available” and “Endpoint” is shown. DB Instance – Launch Status - Available After creating the DB Instance is created, the status will be set to “available” and endpoint for the DB instance will be displayed and the authorized networks will also be set. Endpoint is nothing but “hostname” for MySQL client connect string and authorized is nothing but security groups configured list.
  • 11. How To Create RDS Database in AWS for WordPress 9 | P a g e DB Instance – Configure Security Group In order to connect to the database you need to configure security group in the AWS Management console with the IP Address range for the port 3306. To add a new rule or modify click on security “Group ID”. Click on “InBound” tab and click on “Edit” button. DB Instance – Configure Security Group – Add Rule After adding the new rule, click on “Save” button. After that you can establish connection to the database. Setting Purpose Type Choose type of connection (MySQL/Aurora) Database Port Automatically updated Source Add access rule for the Source IP from where the database connection would to be established Connect from – Anywhere (0.0.0.0/0), My IP and Custom IP
  • 12. How To Create RDS Database in AWS for WordPress 10 | P a g e DB Instance – MySQL Workbench – Parameters Once the instance status is set to “available”, Create a new the MySQL workbench connection. Configure New connection as per the below parameters and click on “Test Connection” and “OK” button. Parameters Values Hostname copy and paste endpoint string from RDS Instance information Username Username, set during the “DB instance – Settings” section Password Password, set during the “DB instance – Settings” section
  • 13. How To Create RDS Database in AWS for WordPress 11 | P a g e DB Instance – Connect MySQL Workbench – SSL Optionally, you can configure SSL Certificate downloaded from AWS Portal. https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem Download the security file when configuring “Network & Security” option.
  • 14. How To Create RDS Database in AWS for WordPress 12 | P a g e DB Instance – Connect MySQL Workbench Once saved, double click on the saved connection, you should be able to launch SQL query window. Database server information is displayed.
  • 15. How To Create RDS Database in AWS for WordPress 13 | P a g e DB Instance – RDS DB Connection – SSL CA Download Optionally, you can configure SSL Certificate downloaded from AWS Portal. Download the SSL CA certificate for RDS database instance connection. When configuring the network & security section click on download link “new certificate bundle”. wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem MySQL – RDS DB Connection - SSL Certificate Connectivity Connect the database with SSL certificate with specific database. mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb -pmywordpressdb --ssl-ca=/root/rds-combined-ca-bundle.pem -s
  • 16. How To Create RDS Database in AWS for WordPress 14 | P a g e MySQL – SSL Certificate Connection – DB Connect the database with SSL certificate with specific database. mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb -pmywordpressdb --ssl-ca=/root/rds-combined-ca-bundle.pem -Dmywordpressdb MySQL – Non SSL Connectivity Connect the database without SSL certificate with specific database. mysql -h mywordpress.cnntryehtcnj.us-east-1.rds.amazonaws.com -umywordpressdb - pmywordpressdb -Dmywordpressdb
  • 17. How To Create RDS Database in AWS for WordPress 15 | P a g e Configure SELinux One of the important step after configuring wordpress database is to configure SELinux and enable “httpd network db connection”. This step is applicable when the SELinux is enabled. SELinux – httpd To list all SELinux attributes that can be configured httpd related SELinx parameters that can be configured can be listed with command “getsebool -a | grep httpd” though we need to configure database connectivity to get filter by below command. getsebool -a | grep httpd_can_network
  • 18. How To Create RDS Database in AWS for WordPress 16 | P a g e SELinux – httpd Modify current state of particular SElinux boolean; for httpd database connection via network should be set to “on” to turn off modify the object to “off”, which is 0. setsebool -P httpd_can_network_connect_db 1 WordPress – Download Package Download the WordPress package on the server, run the command. wget http://wordpress.org/latest.tar.gz
  • 19. How To Create RDS Database in AWS for WordPress 17 | P a g e WordPress - Extract Package Extract the package in the DocumentRoot folder of Apache httpd server. cd /var/www/html tar -zxf latest.tar.gz WordPress – Configure Database Parameters Configure the database connection parameters for the WordPress portal in the configuration file “wp- config.php”. Setting Purpose DB Name Configured database name (database – settings) Master Username Configured username Master Password Set master password for the database Confirm Password Set the master username password
  • 20. How To Create RDS Database in AWS for WordPress 18 | P a g e WordPress - Launch Portal Launch the WordPress portal and configure the Site Information, administrator username, password and email ID. Once you are done posting administrator information click on “Install WordPress” button. http://WordPressServerIP/wordpress/
  • 21. How To Create RDS Database in AWS for WordPress 19 | P a g e Troubleshooting Error establishing a database connection Error Message Cause SELinux is not configured to establish database connection for httpd service. To verify this run the command; getsebool -a | grep httpd_can_network Resolution Since WordPress connects to a database SELinux needs to be configured via httpd service, you need to turn on SELinux attribute “httpd_can_network_connect_db”. setsebool -P httpd_can_network_connect_db 1
  • 22. How To Create RDS Database in AWS for WordPress 20 | P a g e