Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iron-chest/deploying-wordpress-to-an-amazon-ec2-instance

Deploying WordPress to an Amazon EC2 instance
https://github.com/iron-chest/deploying-wordpress-to-an-amazon-ec2-instance

amazon-web-services apache2 ec2-instance mysql-database php8 wordpress

Last synced: about 2 months ago
JSON representation

Deploying WordPress to an Amazon EC2 instance

Awesome Lists containing this project

README

        

# Deploying WordPress to an Amazon EC2 Instance

## WordPress
WordPress is a web content management system. It was originally created as a tool to publish blogs but has evolved to support publishing other web content, including more traditional websites, mailing lists and Internet forum, media galleries, membership sites, learning management systems and online stores.

## Amazon EC2 Instance
Amazon Elastic Compute Cloud is a part of Amazon.com's cloud-computing platform, Amazon Web Services, that allows users to rent virtual computers on which to run their own computer applications.

### Step 1: Launch and configure an Ubuntu Amazon EC2 instance

1. Sign in into your AWS Console and Click on EC2

2. Navigate to the EC2 Dashboard and Launch Instance

3. Choose the Server Name.
![Choosing the Server Name](./Images/server1.png)

4. Choose the Amazon Machine Image.
![Choosing the Amazon Machine Image](./Images/server2.png)

5. Choose the Instance type and KeyPair
![Choosing the Amazon Machine Image](./Images/server3.png)

6. Configure the Network Settings
![Choosing the Amazon Machine Image](./Images/server4.png)

7. Configure Storage for the EC2 Instance
![Choosing the Amazon Machine Image](./Images/server5.png)

8. Then, Click on Launch Instance and the server should be running.
![Choosing the Amazon Machine Image](./Images/server6.png)

### Step 2: Connecting to the EC2 Instance
1. Click on your Public IPv4 address
2. I would be using a ssh-client called Mobaxterm to access my EC2 Instance
3. [Download Mobaxterm](https://mobaxterm.mobatek.net/download.html)

4. Login your EC2 Instance using:
- Public IpAddress
- Private Key (.pem)
- Server Name (Ubuntu)

### Step 3: Download Apache, PHP, MySQL.
1. Make sure your server is updated
```
sudo apt-get update

```

2. Install Apache server on Ubuntu
```
sudo apt install apache2 -y

```

3. Install php runtime and php mysql connector
```
sudo apt install php libapache2-mod-php php-mysql -y

```

4. Install MySQL server
```
sudo apt install mysql-server -y

```
### Step 4: Creating and Configuring MySQL Database
1. Login to MySQL server
```
sudo mysql -u root

```

2. Change authentication plugin to mysql_native_password (change the password to something strong)
```
ALTER USER 'root'@localhost IDENTIFIED WITH mysql_native_password BY 'Your Password';

```

3. Create a new database user for wordpress (change the password to something strong)
```
CREATE USER 'UserName'@localhost IDENTIFIED BY 'Password';

```

4. Create a database for wordpress
```
CREATE DATABASE wp;

```

5. Grant all privilges on the database 'wp' to the newly created user
```
GRANT ALL PRIVILEGES ON wp.* TO 'UserName'@localhost;

```
### Step 5: Download WordPress and configure it
1. Download the latest Wordpress archive file
```
cd /tmp
wget [Lastest Wordpress version](https://wordpress.org/latest.tar.gz)

```

2. Unzip the Wordpress archive file
```
tar -xvf latest.tar.gz

```

3. Move wordpress folder to apache document root
```
sudo mv wordpress/ /var/www/html

```

4. Command to restart/reload apache server
```
sudo systemctl restart apache2

```
OR
```
sudo systemctl reload apache2

```

5. Sign in the wordpress website using (http://ipaddress/wordpress/)

6. Login using the required credentials like password, username e.t.c

7. To configure the wp-config.php file
```
sudo vim wp-config.php

```
8. and paste this details

```
0>3ubw