This topic describes how to deploy a Linux, Apache, MySQL, and PHP (LAMP) environment by creating a stack in the Resource Orchestration Service (ROS) console.

Background information

The LAMP architecture is a web framework that is popular across the globe. Its main components include the Linux operating system, Apache network server, MySQL database, and PHP programming language. All of these components are open source software. LAMP provides a general-purpose high-performance environment that can be used across platforms at low costs.

The Deploy a LAMP (Linux, Apache, MySQL, and PHP) Stack sample template creates a CentOS instance based on existing resources such as a virtual private cloud (VPC), a vSwitch, and a security group, and installs necessary software such as the Apache network server, MySQL database, and PHP programming language on the instance. After a stack is created by using the sample template, you can obtain the URL of the Apache web server and log on to the Apache management console.

Step 1: Create a stack

  1. Log on to the ROS console.
  2. In the left-side navigation pane, choose Templates > Sample Templates.
  3. Find the Deploy a LAMP (Linux, Apache, MySQL, and PHP) Stack template.
  4. Click Create Stack.
  5. In the Configure Template Parameters step, set Stack Name and the following parameters.
    Parameter Description Example
    Existing VPC Instance ID The ID of the VPC.

    For more information about how to create and query a VPC, see Create a VPC.

    vpc-bp1m6fww66xbntjyc****
    VSwitch ID The ID of the vSwitch in the VPC.

    For more information about how to create and query a vSwitch, see Create a vSwitch.

    vsw-bp183p93qs667muql****
    VSwitch Availability Zone The zone ID of the vSwitch in the VPC. Hangzhou Zone K
    Image The image ID of the Elastic Compute Service (ECS) instance. By default, centos_7 is used.

    For more information, see Image overview.

    centos_7
    Instance Type The instance type of the ECS instance.

    Select a valid instance type. For more information, see Instance families.

    ecs.c5.large
    System Disk Type The system disk category of the ECS instance. Valid values:
    • cloud_efficiency: ultra disk
    • cloud_ssd: standard SSD
    • cloud_essd: enhanced SSD (ESSD)
    • cloud: basic disk
    • ephemeral_ssd: local SSD

    For more information, see Cloud disks.

    cloud_efficiency
    Instance Password The password that is used to log on to the ECS instance. Test_12****
    DB Name The name of the ApsaraDB RDS for MySQL database.

    For more information, see Overview of ApsaraDB RDS for MySQL.

    MyDatabase
    DB UserName The username of the ApsaraDB RDS for MySQL database. DefaultUser
    DB User Password The user password of the ApsaraDB RDS for MySQL database. Test_23****
    DB Root Password The root password of the ApsaraDB RDS for MySQL database. Test_34****
  6. Click Create.
  7. View the stack status on the Stack Information tab of the stack management page. After the stack is created, click the Outputs tab to view the URL of the Apache web server.
  8. Use the URL to log on to the Apache management console.

Step 2: View resources

  1. Log on to the ROS console.
  2. In the left-side navigation pane, click Stacks.
  3. On the Stacks page, click the ID of the stack that you created.
  4. On the stack management page, click the Resources tab to view the resource list.
    The following table describes the resources in this example.
    Item Quantity Description Specifications
    ALIYUN::ECS::Instance 1 Creates an ECS instance to deploy a LAMP environment.
    • A single instance of the following specifications is created:
    • InstanceType: ecs.c5.large
    • SystemDiskCategory: cloud_efficiency
    • SystemDiskSize: 40 (Unit: GB)
    • AllocatePublicIP: true
    ALIYUN::ECS::SecurityGroup 1 Creates a security group to control the inbound and outbound traffic of ECS instances in the security group to enhance security. None
    Note For more information about the resource charges, see the pricing schedule on the official website or the product pricing documentation.