This topic provides an example on how to enable Internet access for an application that is deployed on SAE.

Prerequisites

Background information

For example, Enterprise A wants to create an application in the China (Beijing) region in SAE, deploy a WordPress service on the application, and use an ApsaraDB RDS database that resides in the China (Hangzhou) region.

Create and deploy a WordPress application

  1. Log on to the SAE console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region and click Create Application.
  3. In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.
    ParameterDescription
    Application Name

    Enter a custom application name.

    VPC

    Select a configuration method for the VPC. Valid values:

    • Custom Configuration: If you select this option, you must manually specify the namespace, VPC, vSwitch, and security group for the application that you want to create.
    • Automatic Configuration: If you select this option, SAE automatically specifies the namespace, VPC, vSwitch, and security group for the application.
    Namespace

    This parameter is required only if the VPC parameter is set to Custom Configuration. Select an existing namespace from the drop-down list.

    Note Namespaces and VPCs are in one-to-one mapping relationships. For information about how to modify a VPC, see Create and manage a VPC.
    vSwitch

    This parameter is required only if the VPC parameter is set to Custom Configuration. Click Select vSwitch. In the Select vSwitch dialog box, configure the parameters.

    You must specify at least one vSwitch. We recommend that you specify no more than three vSwitches. Each vSwitch must match at least one application instance.

    Security Group

    This parameter is required only if the VPC parameter is set to Custom Configuration. Select a security group from the drop-down list.

    Note If you have not created a security group in your VPC, click Create Security Group to create a security group as prompted. For more information, see Create a security group.
    Application InstancesSelect the number of instances that you want to create.
    VCPUSelect the CPU specification for the instances that you want to create.
    MemorySelect the memory specification for the instances that you want to create.
    Application DescriptionEnter the basic information about the application.
  4. In the Deployment Configurations step, set the Application Deployment Method parameter to Image and configure the parameters. Then, click Next: Confirm Specifications.
  5. In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.
    The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.
  6. Check the deployment result of the application.
    On the Basic Information page, view the basic information and instance deployment information of the application. If Running is displayed in the Status column on the Instance Deployment Information tab, the application is deployed.
  7. Bind a Server Load Balancer (SLB) instance to the application.
    1. On the Basic Information tab of the Basic Information page, click Add Internet-facing SLB Instance on the SLB-based Access tab in the Application Access Settings section.
    2. In the Add Internet-facing SLB Instance dialog box, configure an SLB listener and click OK.

      A listener defines how SLB routes requests to backend servers. Add at least one listener to an SLB instance.

      Add Internet-facing SLB Instance
  8. Use the Internet-facing SLB instance to access the WordPress application.
    Bind an SLB instance to WordPress

Configure Internet access for the WordPress application

For more information, see Configure a NAT gateway for an SAE application to enable Internet access.

Configure an ApsaraDB RDS database that resides in another region for the WordPress application

  1. Purchase an ApsaraDB RDS instance.
    1. Activate ApsaraDB RDS.
    2. Configure basic information for the ApsaraDB RDS instance.
      When you purchase an ApsaraDB RDS instance, set the Region parameter to China (Hangzhou), the Zone parameter to Hangzhou Zone K, and the Network Type parameter to VPC.
  2. Configure a whitelist.
    1. Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. On the Instances page, click the name of the ApsaraDB RDS instance that you purchased in Step 1 to go to the Basic Information page.
    2. In the left-side navigation pane, click Database Connection. In the top navigation bar of the Database Connection page, click Apply for Public Endpoint. In the Reminder dialog box, click OK.
      Apply for a public endpoint
      After the public endpoint is obtained, the public endpoint is displayed in the Public Endpoint field.
    3. Click Configure Whitelist in the Public Endpoint field to go to the Whitelist and SecGroup page. On the Whitelist Settings tab, click Create Whitelist.
    4. In the Create Whitelist dialog box, configure the Whitelist Name and IP Addresses parameters, and then click OK.
      Note In this example, the IP Addresses parameter is set to 0.0.0.0/0. This value indicates that all access from the Internet is allowed.
      Create Whitelist
  3. In the left-side navigation pane, click Accounts. On the Accounts tab, click Create Account. In the Create Account panel, configure the parameters and click OK.
    Create an account and a database for the ApsaraDB RDS instance based on your business requirements. For more information, see Create databases and accounts for an ApsaraDB RDS for MySQL instance. Create an account for an ApsaraDB RDS instance
  4. Check whether the ApsaraDB RDS database that is created for the WordPress application can be accessed over the Internet.
    Check whether the database can be accessed over the Internet