search
HomeCMS TutorialWordPressHow to use EC2 to build wordpress on AWS (steps with pictures and text)

The following column of WordPress Tutorial will introduce to you how to use EC2 to build wordpress on AWS. I hope it will be helpful to friends in need!

0. First, you must have an AWS account

1. Generate a key pair

(1) EC2 -> Network and Security-> Key pair -> Create key pair -> Download pem file (private key)

To access a virtual server in AWS, customers need a key pair consisting of a private key and a public key.
The public key is uploaded to AWS and configured into the virtual server. The private key is private to the customer.
To access the Linux server, use the SSH protocol. Customers authenticate with keys rather than passwords when logging in.
How to use EC2 to build wordpress on AWS (steps with pictures and text)

(2) Convert pem file to ppk file

How to use EC2 to build wordpress on AWS (steps with pictures and text)

2. Create EC2 instance

(1) First enter the EC2 control panel, click "Start Instance", select Ubuntu Server 18.04 LTS (HVM), SSD Volume Type, 64-bit (x86)

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(2) Select t2.micro, free package

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(3) Next step, default configuration

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(4) Next step, Add memory, 8g

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(5) Add a label, that is, the name of the instance, etc.

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(6) Configure security Group, add http, https, mysql and other port mapping

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(7) Review and start

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(8) After startup, you can see

How to use EC2 to build wordpress on AWS (steps with pictures and text)

#3. Enter the EC2 instance and install the software

(1) Use putty to connect to the instance

Fill in the public IP address of EC2 as the host name, and the connection type is SSH. Then click the menu "Connect" - "SSH" - "Authentication" and select the PPK format authentication private key file just converted.
How to use EC2 to build wordpress on AWS (steps with pictures and text)

How to use EC2 to build wordpress on AWS (steps with pictures and text)

How to use EC2 to build wordpress on AWS (steps with pictures and text)

(2) Log in and enter the root account

login as: ubuntu
sudo su
apt-get update

(3) Install apache

apt-get install apache2

After the installation is complete, access the public IP address of http://EC2 instance in the browser, and the default page of Apache will appear.

(4) Install php

apt-get install php

(5) Install mysql

apt-get install mysql-server

(6) Let php support mysql

apt-get install php-mysql

(7) Restart apache

service apache2 restart

(8) Test PHP and create a probe file

vi /var/www/html/info.php

<?php phpinfo();
?>

Use the browser to http://public ip/info.php and you can see the php info interface
How to use EC2 to build wordpress on AWS (steps with pictures and text)

(9) Use MySQL client to create a WordPress database and a user

mysql -u root 

CREATE DATABASE wordpress
GRANT ALL PRIVILEGES ON wordpress.* TO "chenxin"@"localhost" IDENTIFIED BY "123456";
FLUSH PRIVILEGES;

EXIT

(10) Set up the wp-config.php file

wget  https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz    #下载中文版WordPress
tar -xzvf wordpress-4.9.4-zh_CN.tar.gz    #解压
cd wordpress
mv wp-config-sample.php wp-config.php      #将wp-config-sample.php重命名为wp-config.php
vim wp-config.php
//把database_name_here,username_here,password_here分别替换成自己设置的数据库,用户名和密码。
define('DB_NAME', 'wordpress');
define('DB_USER', 'chenxin');
define('DB_PASSWORD', '123456');

(11) Put the files in WordPress Copy to the default website root directory

cp -Rv /root/wordpress/* /var/www/html/ 
rm /var/www/html/index.thml
chown -R www-data:www-data /var/www/
systemctl restart apache2

(12) Use a browser to access http://public IP/wp-admin/instal...

How to use EC2 to build wordpress on AWS (steps with pictures and text)


The above is the detailed content of How to use EC2 to build wordpress on AWS (steps with pictures and text). For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete
The 5 Best IDEs for WordPress Development (And Why)The 5 Best IDEs for WordPress Development (And Why)Mar 03, 2025 am 10:53 AM

Choosing the Right Integrated Development Environment (IDE) for WordPress Development For ten years, I've explored numerous Integrated Development Environments (IDEs) for WordPress development. The sheer variety—from free to commercial, basic to fea

Create WordPress Plugins With OOP TechniquesCreate WordPress Plugins With OOP TechniquesMar 06, 2025 am 10:30 AM

This tutorial demonstrates building a WordPress plugin using object-oriented programming (OOP) principles, leveraging the Dribbble API. Let's refine the text for clarity and conciseness while preserving the original meaning and structure. Object-Ori

How to Pass PHP Data and Strings to JavaScript in WordPressHow to Pass PHP Data and Strings to JavaScript in WordPressMar 07, 2025 am 09:28 AM

Best Practices for Passing PHP Data to JavaScript: A Comparison of wp_localize_script and wp_add_inline_script Storing data within static strings in your PHP files is a recommended practice. If this data is needed in your JavaScript code, incorporat

How to Embed and Protect PDF Files With a WordPress PluginHow to Embed and Protect PDF Files With a WordPress PluginMar 09, 2025 am 11:08 AM

This guide demonstrates how to embed and protect PDF files within WordPress posts and pages using a WordPress PDF plugin. PDFs offer a user-friendly, universally accessible format for various content, from catalogs to presentations. This method ens

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor