12/28/2021

Install Nginx Docker Centos 7

54

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

1. Run the following commands to add an update source

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

2. CentOS 7.9 install and run Docker

3. CentOS 8.4 install and run Docker

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


Install docker

Nginx


Start docker and view the installation results

5. Start using Docker

6. Modify mirror warehouse

Enter modify profile

Add the following and enter: wq saveexit


Restart docker
Use the docker info command to check whether it is successful

1. Deploy Nginx

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

Install Nginx Docker Centos 7 64

2. View container log

Query running container ID

Query stopped container ID
Query Docker log

Nginx

3. Stop, start container

Stop container


Start container

1. Install MySQL database

Install Nginx Docker Centos 7 64-bit

Find any path on the server and install the mysql database using the following command:

2. Check whether the installation is successful

2. MySQL database connection

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)

Nginx

Install Nginx Docker Centos 7 32-bit

Posted by r270ba on Tue, 28 Sep 2021 03:06:57 -0700

  • Most Viewed News

    • Brew Installer
    • El Capitan Download Bootable Usb
    • Best Mac Clean Up Tool
    • Install Mojave From Internet
    • Google Meet App For Mac Os