Connect to the ECS server
-
Open the terminal tool that comes with the system.
Windows: CMD or Powershell.
MAC: Terminal. -
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
-
Enter yes.
-
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.
After successful login, the following information will be displayed.
Install the Apache service
- 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:
- Run the following command to start the Apache service.
systemctl start httpd.servicel
-
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:
Install the MySQL database
-
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-server
-
Execute the following command to start the MySQL database.
systemctl start mysqld.service
-
Run the following command to view the initial MySQL password.
grep "password" /var/log/mysqld.log
-
Execute the following command to log in to the database.
mysql -uroot -p
-
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'
-
Run the following command to grant remote management permission to the root user.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'
-
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/