Alibaba Cloud ECS 7-day practical training camp-entry level Class 6

Class 6: Quickly build a LAMP environment

1. Open an ECS server for free

Insert picture description here

2. Connect to ECS server

1. Open the terminal tool or remote connection tool (Putty) that comes with the system

Windows:CMD或Powershell。
MAC:Terminal。

2. Enter the connection command ssh [username]@[ipaddress] in the terminal. You need to replace the username and ipaddress with the login name and public network address of the ECS server of the actual instance. E.g:

ssh [email protected]

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

Three, install the Apache service

Apache is the world's most used web server software. It can run on almost all widely used computer platforms. Because of its cross-platform and security is widely used, it is one of the most popular Web server-side software.
1. Execute the following commands to install the Apache service and its extension packages.

yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql

If a result similar to the following figure is returned, the installation is successful.
Insert picture description here
2. Execute the following command to start the Apache service.

systemctl start httpd.service

Insert picture description here
3. Test whether the Apache service is installed and started successfully.
Apache listens to port 80 by default, so just visit the IP address http://<ECS public network IP> assigned by ECS in the browser, as shown below:
Insert picture description here

Fourth, install MySQL database

1. Execute the following commands to download and install the official Yum Repository of MySQL.

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

Insert picture description here
Insert picture description here
2. Execute the following command to start the MySQL database.

systemctl start mysqld.service

Insert picture description here
3. Execute the following command to view the initial MySQL password.

grep "password" /var/log/mysqld.log

Insert picture description here
4. Execute the following command to log in to the database.

mysql -uroot -p

Insert picture description here
5. Execute the following command to modify the MySQL default password.

set global validate_password_policy=0; 	#修改密码安全策略为低(只校验密码长度,至少8位)。
ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';

6. Execute the following commands to grant the root user remote management permissions and refresh permissions.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678';
flush privileges;

7. Enter exit to exit the database.
Insert picture description here

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

Guess you like

Origin blog.csdn.net/qq_44750380/article/details/113093318