Install Nginx Web Server. First update the system software packages to the latest version. # yum -y update. Next, install Nginx HTTP server from the EPEL repository using the YUM package manager as follows. # yum install epel-release # yum install nginx. Install Nginx on CentOS 7. Install Docker from Base Repository. Docker is available in the standard repository of CentOS, so we don’t have to search for the package. For RHEL 7, you must have a valid Redhat subscription to enable Extras rpm’s repository on the server.
Introduction: 1. What is Dokcer?
An open source application container engine allows developers to package their applications and dependency packages into a portable container, and then publish them to any popular Linux machine. Virtualization can also be realized.
The container is completely encapsulated on the basis of LCX (linux container) by using the sandbox mechanism, without any interface between them, and written in go language.
2. Why use docker?
Provide a one-time environment. If Mysql, RocketMQ and RabbitMQ need to be installed, many dependent libraries and versions need to be installed. If Docker is used, it can be started and run directly through image
For rapid dynamic capacity expansion, an application is deployed with docker, which can be made into an image, and then quickly started through Dokcer
Build a microservice architecture, which can simulate multiple microservices and start multiple applications on one machine
Better resource isolation and sharing
yum update: execute and select yes, and wait for the update to succeed
Yum install EPEL release - y wait for success
Execute yum clean all and wait for success. If you don't execute it, it won't affect you, but it's best to avoid reporting errors
yum list is executed successfully. It will not be affected if it is not executed, but it is best to avoid error reporting
Note: CentOS 8 uses podman instead of docker by default, so containerd.io needs to be installed
Use the following command to install and its dependent packages
Install other dependent packages
Start docker and view the installation results
Enter modify profile
Add the following and enter: wq saveexit
Use the docker info command to check whether it is successful
Start Nginx deployment using the following command
Alicloud security group opens the corresponding 8080 port
Check whether Nginx is successful: enter 'ecs server public ip +: + 8080' in the browser address, and a message appears
Welcome to nginx
Query running container ID
Query stopped container ID
Query Docker log
Find any path on the server and install the mysql database using the following command:
New connection - MySQL
Enter the host IP and password: after configuration, click [connection test] to test. If successful, the configuration is OK (Alibaba cloud security group must open port 3306)
Posted by r270ba on Tue, 28 Sep 2021 03:06:57 -0700