Skip to content

This repository provides a step-by-step guide and configuration files for deploying a WordPress website on an Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instance with your own custom domain name.

Notifications You must be signed in to change notification settings

Kiran090303/Hosted-WordPress-Website-On-Amazon-Aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Hosted-WordPress-Website-On-Amazon-Aws

Provides a step-by-step guide and configuration files for deploying a WordPress website on an Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instance with custom domain name (kiransinghverma.online)

aws


Step 1: Launch an instance

  • AMI — Ubuntu Server
  • Instance Type — t2.micro
  • Key Pair — ppk file format
  • Firewall (security groups) — ssh, http, https
  • Configuration Storage — 8 GB, gp2
  • No. of Instance — 01
  • Launch Instance
Screenshot 2023-09-05 023648

Step 2: Associate Elastic IP address

Screenshot 2023-09-05 023628

Step 3: Connect via SSH Client (Putty)

Screenshot 2023-09-05 115832

Step 4: Installing and Configuring mysql server:

Screenshot 2023-09-05 115850

Install Apache server on Ubuntu

sudo apt update

sudo apt install apache2 -y

Install php runtime and php mysql connector

sudo apt install php libapache2-mod-php php-mysql -y

Install MySQL server

sudo apt install mysql-server -y

Login to MySQL server

sudo mysql -u root

Change authentication plugin to mysql_native_password (change the password to something strong)

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'admin@123';

Create a new database user for wordpress (change the password to something strong)

CREATE USER 'wp_user'@localhost IDENTIFIED BY 'admin@123';

Create a database for wordpress

CREATE DATABASE wp;

Grant all privilges on the database 'wp' to the newly created user

GRANT ALL PRIVILEGES ON wp. TO 'wp_user'@localhost;*

Exit or ctrl-D

Step 5: Download, Configure & Install Wordpress:

Screenshot 2023-09-05 120019

cd /tmp wget https://wordpress.org/latest.tar.gz

Unzip

tar -xvf latest.tar.gz

Move wordpress folder to apache document root

sudo mv wordpress/ /var/www/html

Screenshot 2023-09-05 120035 Screenshot 2023-09-05 120104

create the wp-config.php

cd /var/www/html/wordpress vi wp-config.php

ip-address followed by wordpress

3.89.166.68/wordpress/

I want Wordpress website to the server at this root path. for that I need to modify apache configuration, so I go back to my terminal rest follow below commands.

cd /etc/apache2/sites-available/ vi 000-default.conf

Screenshot 2023-09-05 120730 Screenshot 2023-09-05 120755

Change document root to /var/www/html/wordpress

sudo systemctl restart apache2

http://3.89.166.68/ # hit on browser


Step 6: Link Domain name to our website

Screenshot 2023-09-05 123415

I purchased a domain called kiransinghverma.online from Hostinger

Here in Points to — ec2 instance public ip address Add Record cd /etc/apache2/sites-available/ vi 000-default.conf

sudo systemctl restart apache2

kiransinghverma.online # hit on browser probably it takes 15-20 minutes to reflect wait until Now we can access WordPress website by my domain name.


Step 7: Secure Connection (HTTPS)

install certbot

sudo apt-get update sudo apt install certbot python3-certbot-apache -y

Request and install ssl on your site with certbot

sudo certbot --apache

This will secure the connection

Screenshot 2023-09-05 123521

About

This repository provides a step-by-step guide and configuration files for deploying a WordPress website on an Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instance with your own custom domain name.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published