All Products
Search
Document Center

Elastic Compute Service:Create a WordPress environment by using ROS

Last Updated:Mar 19, 2024

This topic describes how to use a Resource Orchestration Service (ROS) template to create a WordPress environment based on Elastic Compute Service (ECS) and ApsaraDB Relational Database Service (RDS).

Prerequisites

  • ROS is activated. The first time you use ROS, you are prompted to activate it. You can activate ROS free of charge.

Background information

WordPress is a blogging platform written in Hypertext Preprocessor (PHP). On servers that support PHP and MySQL databases, you can use WordPress to build your websites or as a content management system (CMS). This topic describes how to use the Create a WordPress Environment Based on ECS and ApsaraDB for RDS template to install a WordPress environment based on a CentOS 7.9 ECS instance and a CentOS 7.9 ApsaraDB RDS for MySQL instance.

Important

In this example, a pay-as-you-go ECS instance and a pay-as-you-go ApsaraDB RDS for MySQL instance are created by using ROS. For information about the billing of ECS instances and ApsaraDB RDS for MySQL instances, see ECS billing overview and ApsaraDB RDS for MySQL billing overview.

Create a stack

  1. Log on to the ROS console.

  2. Select the template that you want to use.

    1. In the left-side navigation pane, choose Templates > Sample Templates.

      The common templates provided by ROS are displayed on the Sample Templates page.

    2. In the search box in the upper-right corner of the Sample Templates page, enter Create a WordPress Environment Based on ECS and ApsaraDB for RDS to search for the template.

      View the Create a WordPress Environment Based on ECS and ApsaraDB for RDS sample template.add56

    3. (Optional) Click View Details to view the template file in the JSON format.

      The following table describes the top-level fields in the JSON file.

      Top-level field

      Description

      "ROSTemplateFormatVersion" : "2015-09-01"

      The version of the template.

      Description

      The description of the template, including the use scenarios and architecture of the template.

      Metadata

      The metadata of the template, including information such as layouts for visualizations.

      "Parameters" : { }

      The parameters of the template.

      In this example, this field specifies the parameters such as the image ID and instance type, and provides the default values of some parameters.

      "Resources" : { }

      The Alibaba Cloud resources that you want to use the template to create.

      In this example, this field declares that the resources that you want to create include an ECS instance and a security group. The properties of these resources are defined in the Parameters field.

      "Outputs": { }

      The resource information that the stack generates after the specified resources are created.

      In this example, the stack generates the ECS instance ID, public IP address, and security group ID.

      Note

      For information about sample templates of ROS, see Template structure.

  3. Click Create Stack.

  4. Configure the parameters and click Next.

    1. In the upper-left corner of the top navigation bar, select a region.

    2. Configure the parameters in the stack template.

      The following table describes the stack template parameters.

      Parameter

      Description

      Stack Name

      The name of the stack. The stack name must be unique and cannot be modified after the stack is created.

      VPC

      VPC CIDR Block

      The private CIDR block of the virtual private cloud (VPC).

      For more information, see Plan networks.

      VSwitch Availability Zone

      The ID of the zone in which to create the resource.

      VSwitch CIDR Block

      The CIDR block of the vSwitch must fall within the CIDR block of the VPC to which the vSwitch belongs and cannot overlap with the CIDR block of an existing vSwitch. For more information, see Plan networks.

      ECS

      Instance Type

      The instance type of the ECS instance.

      For information about ECS instance types, see Overview of instance families.

      System Disk Type

      The type of system disks that you want to use to create the ECS instance.

      Instance Password

      The logon password of the ECS instance.

      The password must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and any of the following special characters: ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' <> , . ? /

      Note

      The password of a Windows instance cannot start with a forward slash (/).

      RDS

      Engine Version

      The database engine that you want to use.

      Instance Class

      The type of the RDS instance.

      Instance Storage

      The storage capacity of the RDS instance.

      DB Name

      The name of the WordPress database.

      DB Username

      The username of the WordPress database.

      DB Password

      The logon password of the WordPress database.

      The password must be 8 to 32 characters in length and can contain letters, digits, and underscores (_).

    3. (Optional) Perform compliance precheck.

      Note

      Only specific resources support the compliance precheck feature. For more information, see Compliance precheck of ROS.

      1. In the Evaluate Rules section, add compliance rules.

        You can add compliance rules based on the cloud resources in the template.

      2. Click Evaluate.

        You can modify the template content based on the provided suggestions to remediate invalid resources and ensure the compliance of the resources.

    4. (Optional) Configure stack settings.

      The following table describes the stack parameters. For parameters that are not described in the following table, use the default settings. For more information about the parameters, see Create a stack.

      Parameter

      Description

      Stack Policy (Optional)

      The stack policy.

      Rollback on Failure

      Specifies whether to roll back the stack if the stack creation fails.

      • If you select Yes, ROS deletes the created resources when errors such as creation timeout occur during the creation process.

      • If you select No, ROS does not delete the created resources when errors such as creation timeout occur during the creation process.

      Timeout Period

      Specifies the timeout period of the stack creation request. If the specified resources cannot be created within the period, the creation operation times out.

    5. Click Next.

      In the Check and Confirm step, check whether the stack parameters are configured correctly.

  5. Click Create.

  6. On the Stack Information tab, check the status of the stack.

    If the status of the stack is Created, the stack is created.

Install WordPress

  1. On the Outputs tab, click the http://<Public IP address of the ECS instance> WordPress URL next to WordPressUrl to go to the WordPress installation page.

  2. Select an installation language and click Continue.

  3. Enter basic information of the website and click Run the installation.

    Take note of the following parameters:

    • Site Title: the name of the WordPress website. Example: demowp.

    • Username: the username that you want to use to log on to WordPress. Make sure that you keep your username confidential. Example: testwp.

    • Password: the password that you want to use to log on to WordPress. We recommend that you specify a strong password.

    • Your Email: the email address that you want to use to receive notifications. Example: username@example.com.

  4. Click Install Wordpress.

  5. Enter the username testwp and password Wp.123456 that you specified when you installed WordPress, and then click LOGIN.

    You are logged on to your WordPress website.

What to do next

Click the stack name to go to the stack details page. Click the following tabs to view information about the stack:

  • Stack Information: displays the basic information of the stack, such as the status and timeout period.

  • Events: records the operations that ROS performs during the stack creation. The causes of failed operations are also displayed in the list.

  • Resources: displays all resources of the stack.

  • Template: displays the original template of the stack.