El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Setting Up a WordPress Website (Linux)

Updated on 2024-11-04 GMT+08:00

Application Scenarios

WordPress (WP for short) is initially a blog system and gradually evolved to a free CMS or website setup system. The best practices for ECS guide you through the setup of LNMP on a Linux ECS running the CentOS 7.2 64bit OS and deploy WordPress on the website.

Architecture

Figure 1 Setting up a WordPress website (Linux)

Advantages

  • A website with a simple networking architecture can be quickly set up.
  • The website is secure and easy to use.

Resources and Costs

Table 1 Resources and costs

Resource

Description

Cost

VPC

VPC CIDR block: 192.168.0.0/16

Free

VPC subnet

  • AZ: AZ1
  • CIDR block: 192.168.0.0/24

Free

Security group

Inbound rule:

  • Priority: Set it to 1.
  • Action: Select Allow.
  • Type: Select IPv4.
  • Protocol & Port: Set it to TCP: 80.
  • Source: Set it to 0.0.0.0/0.

Free

ECS

  • Billing mode: Yearly/Monthly
  • AZ: AZ1
  • Flavor: s6.large.4
  • Image: CentOS 7.2 64bit
  • System disk: 40 GiB
  • EIP: Auto assign
  • EIP type: Dynamic BGP
  • Billed by: Traffic
  • Bandwidth: 5 Mbit/s

The following resources generate costs:

  • ECSs
  • EVS disks
  • EIPs

For billing details, see Billing Modes.

Nginx

A high-performance HTTP and reverse proxy server.

Download URL:

http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

Free

MySQL

An open-source relational database software

Download URL:

https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm

Free

PHP

An open-source software used for web development

Download URL:

https://mirrors.huaweicloud.com/remi/enterprise/remi-release-7.rpm

Free

WordPress

An open-source blogging software.

Download URL:

https://wordpress.org/download/releases/

Free

Domain name

Used to access the created website.

The price of a domain name is subject to that provided by the domain name registrar. For details, see the help document of the domain name registrar.

Process

The process of manually setting up a WordPress website on a Linux ECS is as follows:
  1. Set up the LNMP environment.
  2. Create a database.
  3. Install WordPress.
  4. Purchase a domain name.
  5. Configure DNS records.

Procedure

Preparations

Procedure

  1. Log in to the ECS.
  2. Set up the LNMP environment. For details, see Manually Deploying LNMP (CentOS 7.2).
  3. Create a database.

    1. Run the following command and enter the root user password of MySQL as prompted to log in to the MySQL CLI:

      mysql -u root -p

    2. Run the following command to create a database:

      CREATE DATABASE wordpress;

      In the preceding command, wordpress is the database name, which can be customized.

    3. Run the following command to create a user:

      CREATE USER 'user'@'localhost' IDENTIFIED BY 'xxxxx';

      In the preceding command, user is the name of the database user, and xxxxx is the configurable user password.

    4. Run the following command to grant all permissions on the WordPress database to the user:

      GRANT ALL PRIVILEGES ON wordpress.* TO 'user'@'localhost';

    5. Run the following command to make all configurations take effect:

      FLUSH PRIVILEGES;

    6. Run the following command to exit the MySQL CLI:

      exit

    7. (Optional) Run the following commands to verify the creation of the database and user and then exit the MySQL CLI:

      mysql -u user -p

      SHOW DATABASES;

      exit

      In the preceding command, user is the created username for logging in to the database.

  4. Install WordPress.

    1. Run the following commands to go to the root directory of the Nginx website and download the WordPress package:

      cd /usr/share/nginx/html

      wget https://cn.wordpress.org/wordpress-6.6.1-zh_CN.tar.gz

    2. Run the following command to decompress the WordPress software package:

      tar zxvf wordpress-6.6.1-zh_CN.tar.gz

      After the decompression, the folder wordpress is obtained.

    3. Run the following commands to go to the WordPress installation directory, copy the wp-config-sample.php file to the wp-config.php file, and retain the original sample configuration file as a backup:

      cd /usr/share/nginx/html/wordpress

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

    4. Run the following command to open and edit the created configuration file:

      vim wp-config.php

    5. Press i to enter insert mode. Find MySQL configurations in the file and modify them to information in 3.
      Figure 2 Modifying MySQL configurations
    6. Press Esc to exit the editing mode. Then, enter :wq to save the settings and exit the file.
    7. Enter http://Server IP address/wordpress in the address bar of the browser to access the installation wizard.
    8. Set the site title, administrator username, password, and email address. Then, click Install WordPress.
      Table 3 Configuration parameters

      Parameter

      Description

      Site title

      Name of the WordPress website.

      Username

      Name of the WordPress administrator.

      Password

      Default or user-defined password.

      Do not reuse an existing password and keep your password secure.

      Email address

      Email address for receiving notifications.

    9. Check that the installation is successful.
    10. Click Log In. Alternatively, enter http://Server IP address/wordpress/wp-login.php in the address bar of the browser, enter the username or email address and password, and click Log In.

  5. Purchase a domain name.

    Configure a unique domain name for website access. You need to obtain an authorized domain name from the domain name registrar first.

  6. Configure DNS records.

    Your website can be visited using the registered domain name only after DNS records are configured. For details, see Routing Internet Traffic to a Website.

    For example, if the domain name is www.example.com, enter http://www.example.com in the address bar of the browser to access the website.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback