Installing Nginx by Using the Yum Source Obtained from a Mirror Site
The following describes how to install Nginx 1.14.2 on CentOS 7.6 using the Yum command of the mirror site. You can also refer to this section to install Nginx 1.19.3.
Table 1 lists the Nginx version and OS version that can be installed using the mirror site Yum source.
|
Software Version |
Whether to Support CentOS 7.6 |
Whether to Support CentOS 8.1 |
Whether to Support openEuler 20.03 (LTS-SP1) |
|---|---|---|---|
|
Nginx 1.14.2 |
Yes |
Yes |
No |
|
Nginx 1.19.3 |
Yes |
No |
No |
- The binary packages available at the Kunpeng mirror site are compiled and packaged based on the open source code, and do not involve vulnerability or bug fixes.
- When using open source software, comply with the applicable license agreements.
- Run the curl command to access any website. If the website information is displayed, the proxy is successfully configured and the Internet is connected.
- Configure the network source.
- Go to the /etc/yum.repos.d directory.
1cd /etc/yum.repos.d
- Create a file named rpm.repo.
vi rpm.repo
- Press i to enter the insert mode and add the following content to the file:
[rpm] name=rpm baseurl=https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/ gpgcheck=0 enabled=1
Set baseurl to the address of the mirror site.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Go to the /etc/yum.repos.d directory.
- Make the network source take effect.
1 2 3
yum clean all yum makecache yum list
- Install Nginx.
1yum -y install nginx-1.14.2-1.el7_4.aarch64 --enablerepo=rpm
- View the Nginx installation directory.
ls /usr/local/nginx

- View the Nginx version.
1/usr/local/nginx/sbin/nginx -v
Parent topic: Installing Nginx