Quickly build a LAMP environment

Connect to the ECS server

  1. Open the terminal tool that comes with the system.
    Windows: CMD or Powershell.
    MAC: Terminal.

  2. Enter the command to connect to the ECS server in the terminal:
    ssh ECS login name @ ECS public network address
    For example: ssh [email protected]
    the command displays the following results
    insert image description here

  3. Enter yes.

  4. After agreeing to continue, you will be prompted to enter the login password. The password is the ECS login password of the created cloud service. insert image description here
    After successful login, the following information will be displayed.insert image description here

Install the Apache service

  1. Run the following command to install the Apache service and its extension packages.

yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
The installation is successful as shown in the figure below:insert image description here

  1. Run the following command to start the Apache service.

systemctl start httpd.servicel

  1. Test whether the Apache service is installed and started successfully.

    Apache listens to port 80 by default, so you only need to visit the IP address assigned by ECS http://<ECS public network IP> in the browser, as shown in the figure below:
    insert image description here

Install the MySQL database

  1. Execute the following commands to download and install the official MySQL Yum Repository.
    wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
    yum -y install mysql57-community-release-el7-10.noarch.rpm
    yum -y install mysql-community-serverinsert image description here

  2. Execute the following command to start the MySQL database.
    systemctl start mysqld.service

  3. Run the following command to view the initial MySQL password.
    grep "password" /var/log/mysqld.log
    insert image description here

  4. Execute the following command to log in to the database.
    mysql -uroot -p

  5. Run the following command to change the default MySQL password.
    set global validate_password_policy=0;
    #Modify the password security policy to low (only verify the password length, at least 8 digits).
    ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678'

  6. Run the following command to grant remote management permission to the root user.
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'

  7. Enter exit to exit the database.

The Alibaba Cloud University Project will accompany more than 2,000 college students to practice and grow on the cloud. Here you can receive free cpu resources, and you can also participate in free training camps to practice and improve: https://developer.aliyun.com/adc/student/

Guess you like

Origin blog.csdn.net/qq_42293067/article/details/115271071