Winter combat camp hands-on combat - cloud essential environment preparation, hands-on practical operation, quickly build LAMP environment, lead mouse cloud Xiaobao backpack without shadow

Yunqi laboratory winter training camp (1.17-3.8)

Refillable card!!!
The fifth phase of winter actual combat, from entry to advanced, helps developers with best practices to quickly practice and learn on the cloud.
Experience courtesy, click to: https://developer.aliyun.com/adc/series/wintercamp
Winter camp phase I: play cloud server from zero to one

Single task reward: practical camp skill certificate + customized mouse
Phase III task reward: the first limited edition cloud Xiaobao of the Winter Olympics in the whole network
Phase V task reward: Winter combat camp medal + customized schoolbag + shadowless trial

Experience introduction

This scenario will provide an ECS instance (ECS) configured with CentOS 7.7. Through the operation of this tutorial, you can quickly build a LAMP environment based on ECs instances.

background knowledge

This scenario mainly involves the following cloud products and services:

1. ECS

ECS (Elastic Compute Service) is an IaaS (Infrastructure as a Service) level cloud computing service with excellent performance, stability, reliability and elastic expansion provided by Alibaba cloud. ECS eliminates the preparation for purchasing IT hardware and allows you to use the server as easily and efficiently as using public resources such as water, electricity and natural gas, so as to realize the open and flexible expansion of computing resources. Alibaba cloud ECS continues to provide innovative servers to meet a variety of business needs and help your business development.

2,Linux
Linux is a Unix like operating system that is free to use and spread. It is a multi-user, multi tasking, multithreading and multi CPU operating system based on POSIX and Unix.

Linux can run the main UNIX tools, software, applications and network protocols. It supports 32-bit and 64 bit hardware.

Linux inherits the design idea of Unix with network as the core. It is a multi-user network operating system with stable performance.

3,Apache

Apache HTTP Server (APACHE for short) is an open source Web server of Apache Software Foundation. It can run in most computer operating systems. It is widely used because of its cross platform and security. It is one of the most popular Web server-side software.

4,MySQL

MySQL is the most popular relational database management system. In terms of WEB application, MySQL is one of the best RDBMS(Relational Database Management System) application software.

5,PHP

The Chinese name of PHP (PHP: Hypertext Preprocessor recursive abbreviation) is "Hypertext Preprocessor". It is a widely used general open source scripting language, which is suitable for Web site development. It can be embedded in HTML. Programming paradigm is object-oriented and imperative programming.

Installing Apache services

Apache is the world's No. 1 Web server software. It can run on almost all widely used computer platforms. It is one of the most popular Web server-side software because of its cross platform and security.

1. On the right side of the page, switch to Web Terminal.

2. Execute the following command to install Apache service and its extension package.

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.

3. Execute the following command to start the Apache service.

systemctl start httpd.service

4. In the address bar of the browser of the local computer, Enter the ECS public network login address and press Enter.

If the return page is shown in the figure below, it indicates that the Apache service has been started successfully.

Install and configure MySQL

MySQL is the most popular relational database management system. In terms of WEB application, MySQL is one of the best RDBMS(Relational Database Management System) application software.

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

rpm -e mariadb-libs --nodeps
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-common-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-compat-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-client-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-server-5.7.35-1.el7.x86_64.rpm

2. Run the following command to view the MySQL version number.

mysql -V

The returned results are as follows, indicating that MySQL is successfully installed.


3. Execute the following command to start the MySQL database.

systemctl start mysqld.service

4. Execute the following command to view the initial password of MySQL.

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


5. Execute the following command to log in to the database.

mysql -uroot -p


6. Execute the following command to modify the default password of MySQL.

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';


7. Execute the following command to grant the root user remote management permission.

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

8. Enter exit to exit the database.

Install PHP

The Chinese name of PHP (PHP: Hypertext Preprocessor recursive abbreviation) is "Hypertext Preprocessor". It is a widely used general open source scripting language, which is suitable for Web site development. It can be embedded in HTML. Programming paradigm is object-oriented and imperative programming.

1. Execute the following command to install the PHP environment.

yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap


2. Execute the following command to create a PHP test page.

echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php


3. Execute the following command to restart the Apache service.

systemctl restart httpd


4. In the address bar of the local browser, visit http: / / < ECS public IP > / phpinfo PHP, the following page is displayed, indicating that the PHP locale has been successfully installed.

Install phpMyAdmin

phpMyAdmin is a MySQL database management tool, which is convenient and fast to manage the database through the Web interface.

1. Execute the following command to create the phpMyAdmin data storage directory.

mkdir -p /var/www/html/phpmyadmin


2. Execute the following command to download the phpMyAdmin compressed package.

wget --no-check-certificate https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip


3. Execute the following command to install unzip and unzip the phpMyAdmin package.

yum install -y unzip
unzip phpMyAdmin-4.0.10.20-all-languages.zip

4. Execute the following command to copy the phpMyAdmin file to the data storage directory.

mv phpMyAdmin-4.0.10.20-all-languages/*  /var/www/html/phpmyadmin

5. In the address bar of the local browser, enter http: / / instance public IP/phpmyadmin to access phpMyAdmin.

The return page is shown in the figure below, indicating that phpMyAdmin has been successfully installed.

6. On the phpMyAdmin login page, enter the user name and password of MySQL in turn, and click execute.


The return page is shown in the figure below, indicating that MySQL connection is successful.

Added by derekm on Thu, 27 Jan 2022 14:20:57 +0200