Hello everyone welcome to master2
teach step by step guide in this video
you will learn creating an EC2 instance
in AWS installing Ubuntu server Apache
MySQL and PHP finally we will setup
WordPress in EC2 instance I will try my best
to explain step by step if you haven't
subscribed to our channel please click
on the subscribe button and subscribe to
our youtube channel let's start
creating an EC2 instance in AWS
open the AWS console page
 
search for the EC2 instance click and open
it
navigate to instance menu where you
can see the list of instance that are
created before we are creating our new
EC2 intense where we will set up
the WordPress site click in launch
instance
Step 1 choosing AMI you can see the list
of different kinds of servers available
in AWS choose the server as per
your requirement for now we are going to
set up Ubuntu server 16. 04 
LDS after selecting the operating system
the second step is choose the instance
type choose the CPU and memory capacity
as per your requirement for this demo
let's choose one core CPU and 1GB RAM
next third step configure instance
details it's all about setting the
network and rules for now we are going
to is skipping it and going through the
default setup another step is adding
storage which means the capacity after
hard drive for setting up the WordPress
site 15 GB will be sufficient for
now we have option to choose the drive
type like SSD or magnetic
SSD is faster and expensive than
magnetic for this demo propose let's go
with SSD next tag tax are used to
identify the project or instance as well
as billing report which can also
generate according to tags like username
master2teach
next is configuring the security group
which means firewalls in the cloud
company how can you allow to assess the
server like through SSH using TCP
protocol in port number 22 allow from
anywhere let's add HTTP as well cause the
user will request to assess our site
using HTTP protocol through HTTP using
TCP protocol in port number 80 can
access from anywhere in the world
last step review instance launch we
select the Ubuntu server as an operating
system which contain one core CPU and
1GB RAM in the security group we allowed
to access our server through this port
all instance you tell listed here
storage up 15 GB SSD drive
also we placed the tag click in the
launch instance now we need to generate
the key pair which is used to access the
server as a password the private key
story in the server whereas we download
the public key create a new key pair
name the key pair we are going through
WordPress so let's name it as WordPress
and download the key pair  wordpress.pem
now launch the instance
okay instance is running now now the
second step is installing Apache MySQL
and PHP open the terminal
for all guidance select the instance and
click connect button where you can see
all details step by step to connect the
server
let's follow step by step open an SSH
client which is our terminal for us locate
your private key files it's in my
download folder
the third one your key must not be
publicly viewable for SSH to work
let's check the permission for now
admin can read right the group can
read it through the network can read it
we have to change the permission for
which here is the command for us copy it
and paste it to run this command will
remove the read permission for others
and even admin can't change the file let's
check it
okay now only I can read this file other
can't okay moving to the fourth one
connect to your instance using its
Public DNS either you can just copy it
and paste it to connect the server or
ssh - I wordpress.pem
Ubuntu
@ IP address connecting
through SSH private key act as a
password Ubuntu has default username as
Ubuntu @ public IP we can use
Public DNS as well sure to connect yes
now you can see we are inside the Ubuntu
server connected successfully so far up
to now
we have done we set up the Ubutnu
server in AWS cloud
we ran the server we connect the server
using the terminal through SSH now we are
going to install Apache for the web
server so that we can run the PHP code
update the server sudo apt-get update
 
install Apache sudo apt-get
install apache2
are you sure yeah
 
okay successfully install the Apache in
the server now let's install the MySQL
server as well sudo
apt-get
install
mysql-server
are you sure yes okay need to set up a
password of the MySQL your default
username is root for now let's set root
as a password which is not a good
password but for demo I am using it
repeat the password
 
okay successfully install MySQL as well
one more thing to install in the server
that is PHP let's install the PHP
including some libraries sudo apt-get
install
php libapache2
-mod-php php-mcrypt
php-mysql
PHP MySQL is library file which helps to
connect to MySQL
 
we have successfully installed the PHP
as well let's restart the Apache server
sudo service
apache2
restart
now let's move to place a few PHP code
for that we need to access the HTML
folder
cd /var/
www/HTML which is located at var
www HTML now let's create a new PHP
file in the server sudo nano test dot
PHP open the text editor write the PHP
code for now I am going to place PHP
info which is a library function which
gives all the details about the install
PHP press ctrl + o to write out and
press ctrl + X to exit
we can view the file content using
command cat test dot PHP
let's view the page in the browser
here you can see the file click on it
here are all details about the PHP that
we have install on the server in this way
we can set up a Ubuntu server in the
AWS cloud and install Apache MySQL and
PHP to run the PHP and MySQL on the
server now let's move to WordPress
we can download the WordPress setup
files from WordPress.org we need to
upload the set up files in the server
for which we can upload in different
ways like upload from the command line
or enabling FTP or we can directly
download the set of files in the server
from terminal
copy the setup file link address
sudo wget and paste the link
list the file here it download the zip file
now let's unzip the file
the program unzip is currently not
installed you can install it by typing
sudo apt install unzip let's install it
as well just copy and paste to install
okay now let's unzip the zip file
sudo unzip latest dot zip
list
here is a WordPress folder that
contains WordPress setup files
now let's check the site in the browser
here it goes now we can install the
WordPress let's start here we need to
create the database first let's go for
it in terminal
mysql
-u root as a username -p
and enter it will ask for the password
root as a password now I am in MySQL
server where we can use the SQL query to
use MySQL like show databases
for now we need to create a new database
create database database name master2
teach
_db
show databases
here is our new database now moving back
to the browser database named master2
teach_db
user name root password root database
host we are on the same server so the
localhost is fine if you are using RDS
for the database we need to place the
Host URL which is provided by RDS while
configuring the RDS database you can
learn from my previous video tutorial
Amazon RDS table prefix for now m2t on
the score
unable to write to the wp - config dot
PHP file which is due to no permission
we can set the permission or we can just
copy this code and make a WP - config
dot PHP file in the WordPress folder
let's exit from the MySQL first exit
navigate to WordPress folder CD
WordPress
sudo nano
wp-config.php
paste the code here and save it same as
before press ctrl + o to write out and
press ctrl + x to exit
list
here is the wp - config dot PHP
file
moving forward run the installation give a
site name
side admin username admin side admin
password M@ster2Teach
email master2teach
@gmail.com
successfully install the WordPress site
let's login to the admin panel admin
M@ster2Teach
let's view the frontend
in this way you can host WordPress site in
your own configuration in AWS at
last one more thing due to permission
you may face the issues like while
installing a new theme in WordPress it
will ask for the details so let's
configure the permission of the WordPress
folder
sudo change ownership chown
www-data
: www-data adding this folder in Apache
www - data group - R which
is recursive ownership and folder
location /var/www
/html/wordpress/
sudo chown www-data:www
-data - R /var/www
/HTML/wordpress
now let's try to install the theme
okay great it's working fine now
 
now let's check for the plugin
 
okay great it's working fine as well
one more issue you can face in the site
while changing the paramlink setting
to post name
it's showing the not found issue for this
solution you have to enable the read
write mode in the Apache server sudo
a2enmod rewrite sudo Apache2 enable
mod rewrite let's restart the server
sudo service Apache2 restart
let's check the site it's still not
working
it may be due to allowing override non
let's change the allow override to all in
the Apache configuration file sudo nano
/ etc / apache2 /
apache2.conf
let's search for the word ctrl + w /var/www
here it is we need to modify allowoverride
to allowoverride all
save it as before ctrl + o ctrl + x
again restart the server sudo service
apache2
restart
let's check it in the browser refresh
okay here it works now you can install
the theme plugins post the post and pages
as per your requirements and host the
WordPress site in AWS by yourself with
your own configure server I hope you
learn from this video tutorial if you
have any questions or comments please
make sure to leave a comments in the
comment section below also please be
sure to like this video and subscribe to
my channel if you haven't already thank
you very much for watching
check us out for more in tutorial and
guide on website master2teach.com
and we will see you again soon bye
 
