How to set-up Wordpress with EC2

Setting up an instance of Wordpress on Amazon's Elastic Compute Cloud.

Check out our main page Tutorial Home
If you already have an EC2 Server Set up please check out the Virtual Host tutorial instead

Introduction

Amazon Elastic Compute Cloud

Amazon Elastic Compute Cloud (EC2) is a highly scalable and versatile cloud computing service provided by Amazon Web Services (AWS). It offers businesses and developers the ability to rent virtual servers, known as instances, on-demand, providing them with complete control over their computing resources. With EC2, users can quickly scale their infrastructure up or down based on their needs, allowing them to respond effectively to changes in demand and optimize costs. EC2 instances are customizable, allowing users to select the desired operating system, storage options, networking configurations, and security settings. This flexibility, combined with AWS's global infrastructure, makes EC2 an essential component for building and deploying a wide range of applications, from simple web servers to complex, distributed computing systems.

WordPress

WordPress is a powerful and widely used content management system (CMS) that enables individuals and businesses to create and manage websites without requiring advanced technical expertise. It provides a user-friendly interface and a vast ecosystem of themes and plugins, making it accessible and customizable for users of all levels. Initially developed as a blogging platform, WordPress has evolved into a versatile CMS that supports various types of websites, including business websites, e-commerce stores, portfolios, and online magazines. It offers a robust set of features, including a rich text editor, media management, user management, search engine optimization (SEO) tools, and responsive design capabilities. With its extensive community support and frequent updates, WordPress remains a popular choice for individuals and organizations looking to establish a dynamic online presence.

EC2 Instance Creation

This step will help you set up an instance of a Linux ubuntu server with Amazon Web Services.

  • Log into AWS
  • Navigate to EC2 Services
  • Click launch instance
  • At the top of Step 1 click: "Try it Now!" for the new launch instance wizard.
  • Name your server
  • Choose Ubuntu
  • Instance type: t2.small or micro depending on scale (probably)
  • Select keypair as SparkX Web Servers
  • Uncheck SSH checkbox.
  • Click the Edit button to the right of 'network settings'
  • Click selecting existing security group
  • Click the common securty groups drop down
  • Select webservers and SSH
  • Configure storage: probably like 100gb
  • Advanced details: termination protation enabled
  • Click launch instance bottom right

Working with NameCheap

Learn how to reserve a name for your website using Namecheap.

  • Log into Namecheap
  • Click domain list
  • Click Manage next to our Sparkxcell domain
  • Click advanced DNS Tab
  • Click create a new CNAME record
  • Host: put the name of the webserver, value put the Public IPv4 DNS for your instance, looks like ec2-1-111-111-11.compute-1.amazonaws.com

Establish Server Connection using SSH

Interface with your newly set up Linux instance.

Connect to the server using PuTTy(PC) or the Mac Terminal.

Click this button to learn how to establish a connection with SSH

SSH Tutorial

LampStack

LAMP stands for Linux Apache, Mysql, PHP. learn how-to install these and get the webserver up and running.

  1. Install all updates to your new Linux server
  2. Type: sudo apt-get update && sudo apt-get dist-upgrade
  3. Reboot your newly updated linux server to apply the updates
  4. Type: sudo reboot
  5. Navigate to Digital Ocean for Lamp Install
  6. Install Apache, PHP, and Virtual Host.l
  7. Note: make sure index.html is deleted or change the file priority to index.php

    Note: Skip all portions of MYSQL

Database linking with AWS RDS

Instead of relying on an internal database, find out how to link it to our remote database service

  1. Download or open MySql Workbench
  2. In AWS click services > navigate to RDS located in Database.
  3. In Mysql Workbench
  4. At the top, Click Database
  5. Create New Connection
  6. Change HostName to RDS Endpoint found on AWS
  7. Put in the username
  8. You can click test connection or skip and go OK
  9. Connect to database
  10. Put in password
  11. On the right side, click schemas tab
  12. Right click and create new schema
  13. Type the name of the schema, then click apply
  14. A new window will open, click apply, then finish
  15. Next to the schema tab, click administration tab
  16. Click 'users and privleges'
  17. Create a new user
  18. Click schema privleges tab
  19. Click add entry > select schema(your project)
  20. Check all rights to that entry and click apply

Securing the Site with Certbot

Set up a secure connection to your wordpress website using Certbot

  1. SSH into the EC2 instance if you are not already
  2. Open up the Certbot webpage
  3. link to certbot for Apache on ubuntu 20
  4. do steps 3 through 9

Install Wordpress

Follow Digital Ocean on how to install Wordpress onto our Lamp stack.