Deploy a LAMP stack with an extension

更新时间:
复制 MD 格式

A LAMP stack is a popular web development environment that consists of Linux, Apache, MySQL, and PHP. The flexibility and customizability of a LAMP stack let you adjust each component's configuration for optimal performance and security based on your project's needs.

Note

For bulk installations, log in to the CloudOps Orchestration Service console. In the left-side navigation pane, choose Server Management > Extension, and then select One-click Installation for LAMP.

Limitations

  • Your security group must have an inbound rule that allows traffic on port 80. If you need to remotely access MySQL, you must also allow traffic on port 3306. For more information, see Add a security group rule.

  • Your instance must meet the following requirements:

    • The ECS instance must be Running.

    • A public IP address is automatically assigned to the ECS instance. Alternatively, an elastic IP address (EIP) is associated with the ECS instance. For instructions on how to enable public bandwidth, see Enable public bandwidth.

    • The Cloud Assistant agent on the ECS instance must be Normal.

  • If you are a RAM user, follow the principle of least privilege and grant the required permissions to the RAM user by using the following custom policy.

    Custom permission JSON

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "bssopenapi:GetOrderDetail",
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "ecs:DescribeCloudAssistantStatus",
            "ecs:DescribeInstances",
            "ecs:DescribeInvocationResults",
            "ecs:DescribeInvocations",
            "ecs:RunCommand"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "oos:GetTemplate",
            "oos:ListInstancePackageStates",
            "oos:StartExecution",
            "oos:UpdateInstancePackageState"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": "oss:GetObject",
          "Resource": "*"
        }
      ]
    }

Procedure

  1. Log in to the ECS Console - Instances, find the target ECS instance, and click the instance ID to open the instance details page.

  2. Choose Scheduled and Automated Tasks > Extension Installation/Uninstallation > Install Extension.

  3. In the Install Extension dialog box, set Extension to Install to Public Extension, find and select One-click Installation for LAMP from the drop-down list, and then click Next. Follow the on-screen instructions.

    A task status of Completed indicates that the LAMP stack is deployed. You can view the final status on the Install Extension tab of the Install / Uninstall Extension page.

    Note

    You can find the MySQL root password in the extension details for the installation task.

  4. To verify the installation, open a browser on your local machine and navigate to http://<public_ip_address_of_your_ecs_instance>/phpinfo.php. A successful installation displays a page with the PHP version and configuration details. An example output is shown below.

    PHP Version 8.0.30
    System: Linux iZbpxxxxxxxxxxxxxxxxxxx 17.2.al8.x86_64 #1 SMP Fri Aug 9 15:49:42 CST 2024 x86_64
    Build Date: Sep 26 2024 10:55:59
    Build System: Red Hat Enterprise Linux release 8.10 (Ootpa)
    Build Provider: Remi's RPM repository &lt;https://rpms.remirepo.net/&gt; #StandWithUkraine
    Compiler: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21)
    Architecture: x86_64
    Server API: FPM/FastCGI
    Virtual Directory Support: disabled
    Configuration File (php.ini) Path: /etc
    Loaded Configuration File: /etc/php.ini
    Scan this dir for additional .ini files: /etc/php.d
    Additional .ini files parsed: /etc/php.d/10-opcache.ini, /etc/php.d/20-bz2.ini, /etc/php.d/20-calendar.ini, /etc/php.d/20-ctype.ini, ...