Skip to main content

Install WordPress on AWS Ubuntu EC2 Instance

Step By Step Installing WordPress on EC2 Ubuntu Server

Creating a EC2 instance

Note down the IPv4 Public IP

Make sure to add Auth Key to insure successful session

Click Yes and provide user name. In my case it is ‘ubuntu’ which is default by AWS. Once we are logged in, our first task to update apt source so that we can have updated packages and module.

sudo apt update

As WordPress is a web based application so our next tast is to install Apache Web Server. Install apache via below command.

apt-get install apache2 –y

Once installed you can verity it via typing hostname or IP on the web browser. It should get you Apache2 Ubuntu Default Page

However WordPress needs other mandatory component as PHP, MySQL so combo of all these service environment is known as LAMP (Linux, Apache, MySQL, PHP). We can install all these component one by one like Apache or directly via typing below command.

apt-get install lamp-server^

Now it’s time to download latest version of WordPress. Let’s go to temp folder and download the zip installer.

cd /tmp

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

Let’s unzip the installer for further install.

sudo tar xvfz latest.tar.gz

After this you should be able to see WordPress folder. You can verify via running ‘ls’ command. Now it’s time to move installation files and components to Document Root folder. By default installer folder for Apache Web Server is /var/www/html.

cd /tmp/wordpress

cp –a * /var/www/html

To check the permission and ownership we can use ls –ll command. www-data should have ownership of the html folder in order to work. If not we can update the ownership via below command.

chown -R www-data:www-data /var/www/html

Now it’s time create a Database for WordPress so that installer can make a connection to the database. It’s a mandate for WordPress installation. Login into MySQL via below command.

mysql –u root –p

As you are first time login into MySQL, it will ask for to configure a new password for root user. Make sure to provide an strong password here. Once you logged in you will get mysql>prompt. Now let’s check databases. Below command will show you all the available databases.

show databases;

To create a new Database

create database wordpress;

To create a new user for DB

create user 'abhay'@'localhost' identified by 'admin@123';

Assign permission to user

GRANT ALL PRIVILEGES ON * . * TO 'abhay'@'localhost';

flush privileges;

quit

We are all set for the databases prerequisite prospective. Now navigate to Root Directory folder (cd /var/www/html)and copy wp-config-sample.php to wp-config.php.

cp wp-config-sample.php wp-config.php

update the file by changing

/** The name of the database for WordPress */

define( 'DB_NAME', 'wordpress' );

 /** MySQL database username */

define( 'DB_USER', 'abhay' );

 /** MySQL database password */

define( 'DB_PASSWORD', 'admin@123' );

 add below parameter at the end

define("FS_METHOD", "direct");


Navigate to sites-available. Verify the vim  000-default.conf. Document root path should be /var/www/html/. If not change it to /var/www/html/.

cd /etc/apache2/sites-available/

Now navigate to Sites-enabled to check how many enabled sites are there. If single default one is there ensure that is loaded by below command.

cd /etc/apache2/sites-enabled/

a2ensite 000-default.conf

It should show Site 000-default already enabled. Now restart the Apache service. And we are good to go to final installation of WordPress.

service apache2 restart

Try to browse using IP



We are all set now! We will also needed to install below modules in order to run smoothly with WordPress plugins.

apt-get install php-xml libapache2-mod-php php-curl

Many Thanks!

 Home

 

 

 


Comments

Popular posts from this blog

PKI Lab Setup

Resource Forest Active Directory Domain Service – DC01 Root Certificate Authority (Offline) – RCA01 Issuing Certificate Authority – ICA01 Client Server – WS01 Account Forest ADC01 AWS01 ------------------------------------------------------------------------------------------------------------------------------------------------------ Step 1 – Installing the Domain Controller Step 2 – Installing the Root Certificate Authority Ø   Install the AD CS Role on the server (RCA01) Ø   Configure the AD CS Role ü   Click – Configure Active Directory Certificate Service on the Destination Server ü   Click Next – If you have logged in with Administration Account or Choose the Account which will be responsible for CA ü   Select Role Service to configure – For my case I am selecting only Certification Authority ü   Select Standalone CA – As this will be offline CA on a work group machine ü   Select Root CA – As this will be the Root CA Server ü   Create a new private key – Mandato

Active Directory Replication

Active Directory Replication: is the process by which a change made to an Active Directory objects on one domain controller is propagate to another domain controller. Type of change can be addition, modification, container change or deletion of an object. When a change occurs, domain controller notify to other domain controller which is called Change Notification . Then replication partners generates Change Request . Then the source domain controller send the Update to replication partners.  The delay between the time a change occurs and the time it is propagated to all domain controllers in the site is known as  Replication Latency . 15 Sec for first direct replication partner (Configurable) 3 sec for rest replication partner (Configurable) Security updates like Password lock do not wait for 15 sec and replicates immediately and known as Urgent Replication . Changes can take place on any DC. It may possible that same change take place on multiple DC at same time and this can cause

What is Active Directory

Active Directory (AD)   is a  directory  service that Microsoft developed for Windows domain networks. It is included in most Windows Server operating systems as a set of processes and services. Active Directory is a database that keeps track of all the user accounts and passwords in your organization. It allows you to store your user accounts and passwords in one protected location, improving your organization's security. Active Directory is subdivided into one or more domains By simple meaning,  Active Directory   is a centralize repository of  O bjects . Everything like User, Group, Service, Resources etc, is an object for Active Directory.  Active Directory  is simply a collection of all these resources. When we put all these object together under a logical grouping or boundary including network resources to construct  Active Directory  is know as  Domain . A single/ multiple  Domains  in contiguous namespace together construct a  Tree   and  single/ multiple  Trees  with a t